This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle
What I Built
VaultDocs AI is a local-first, privacy-guaranteed contract risk screening assistant tailored for freelancers, contractors, and boutique agency owners.
Freelancers frequently sign Master Services Agreements (MSAs), Statements of Work (SOWs), and Non-Disclosure Agreements (NDAs) loaded with unfavorable clauses-such as unlimited indemnification, intellectual property handovers, oppressive payment terms (Net 90+), and unilateral termination rights. Hiring a legal professional for every contract review is cost-prohibitive for independent workers. However, uploading confidential client contracts to commercial cloud LLMs (like standard online AI chat tools) directly violates client non-disclosure agreements (NDAs) and risks exposing sensitive commercial data to server logs and third-party AI training pipelines.
VaultDocs AI solves this by running 100% on the user's local machine with zero cloud connectivity. No contract text, vector embeddings, or prompts ever leave local memory.
The application:
Parses PDF contracts into page-boundary chunks.
Uses a fast in-memory hybrid ranker (BM25 + legal keyword boost) and dense FAISS vector index to retrieve risk-prone sections in under 5 milliseconds.
Performs local open-weight LLM screening using llama3.2:1b, gemma:2b, or qwen2.5:3b via Ollama.
Validates model citations directly against extracted PDF text to eliminate hallucinations.
Renders a professional, interactive 3-column legal review workstation with customizable risk scoring (0–100) and downloadable Markdown audit reports.
Demo
YouTube Walkthrough: https://youtu.be/pede-5xhahY
Code
The complete project is open-source and up on GitHub:
https://github.com/RiyaDhami13/vaultdocs-ai
How I Built It
I wanted to build something practical that relies entirely on open-source AI tools running locally:
- Local LLM Runtime (Ollama): I hooked up Ollama (127.0.0.1:11434) so it runs lightweight, open-weight models like llama3.2:1b, gemma:2b, and qwen2.5:3b right on my machine without any external APIs. 2.PDF Processing (PyMuPDF): Used PyMuPDF to parse contracts page-by-page while keeping exact page numbers intact so citations map back correctly.
- Hybrid Retrieval (FastClauseRetriever): To avoid heavy search lags, I built a fast in-memory BM25 and legal keyword ranker that pulls relevant clauses in under 5ms, backed by SentenceTransformers and FAISS CPU when needed.
- Pydantic v2 & JSON Auto-Repair: Small local models sometimes cut off JSON responses or format things slightly differently. I wrote a custom auto-repair handler with Pydantic v2 to safely catch truncated responses, fix them up, and parse them cleanly without throwing errors.
- Citation Validation Engine: Cross-checks the model's extracted quotes against the actual contract text to verify page numbers and flag anything unverified.
Why Does Open Innovation Matter?
For a tool dealing with legal contracts and sensitive freelance client work, open innovation wasn't just a nice-to-have-it was the only way this could work.
If I used a closed cloud API, every single clause, financial rate, and proprietary scope would get piped through a third-party server, instantly breaking client non-disclosure agreements. Running open-weight models locally via Ollama means absolute data privacy with zero cloud leakage. Plus, keeping the per-query runtime cost at $0 makes it actually sustainable for freelancers who don't want to deal with unpredictable token billing.
Prize Categories
-
Best Use of Gemma: Used Google's open-weight model family (
gemma:2b) running locally via Ollama for fast, private contract screening. - Best Use of GitHub Copilot: Leveraged GitHub Copilot throughout project scaffolding, UI layout design, and service module refactoring.
Thanks for reading!


Top comments (0)