DEV Community

Hardik Kumar
Hardik Kumar

Posted on

ReceiptGuard: A privacy-first, locally running invoice and receipt data extractor designed specifically for freelancers and solo-preneurs.

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission 💸

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

ReceiptGuard: A privacy-first, locally running invoice and receipt data extractor designed specifically for freelancers and solo-preneurs.

Freelancers hate manually typing out data from receipts for taxes, but cloud-based AI OCR tools require uploading sensitive financial documents, creating a privacy risk and often costing a recurring monthly subscription. ReceiptGuard solves this by running entirely on the user's laptop. It extracts structured JSON (Date, Vendor, Amount, Tax, Category) from PDFs and images, allowing users to export directly to CSV.

Because it runs locally with zero per-use API fees, it can be sold as a highly affordable, one-time-purchase desktop app ($39 lifetime) rather than a subscription, making it a viable side hustle that users actually want to pay for.

Demo

(Note: In your actual DEV post, you can replace this note with a short Loom video or GIF of the app in action. Below is the system architecture.)

graph TD
    A[User Uploads Receipt PDF/Image] --> B[Local OCR: Tesseract / Marker]
    B --> C{Extracted Raw Text}
    C --> D[Ollama Local Inference Server]
    D -->|Llama-3-8B-Instruct| E[LangChain Prompt Template]
    E --> F[Structured JSON Output via Pydantic]
    F --> G[Gradio Local Web UI]
    G --> H[Export to CSV/Excel]

    style D fill:#f9f,stroke:#333,stroke-width:2px
    style E fill:#bbf,stroke:#333,stroke-width:2px
    style A fill:#dfd,stroke:#333,stroke-width:2px

Code

The entire project is open-source. You can explore the codebase, run it locally, or fork it for your own use:
🔗 github.com/hardikxk/receiptguard-ai

How I Built It

ReceiptGuard is built entirely on open-source AI and local-first principles:

  1. Local Inference Engine: Ollama serves as the local inference backend, running the Llama-3-8B-Instruct open-weight model. This provides robust reasoning and formatting capabilities without needing an internet connection.
  2. Orchestration Framework: LangChain is used to chain the OCR output into a structured prompt, enforcing strict JSON schema output using Pydantic to ensure reliable data parsing.
  3. Document Parsing: Marker (an open-source PDF/OCR toolkit) handles the initial extraction of text from messy receipt images and PDFs before passing it to the LLM.
  4. User Interface: A simple, clean local web interface built with Gradio, making it accessible to non-technical users without requiring them to touch the command line.

Why Does Open Innovation Matter?

For this specific side hustle, open-source AI isn't just a nice-to-have; it is the core value proposition:

  • Uncompromising Privacy: Closed APIs require uploading sensitive client financial data to third-party servers. With open-weight models running locally, I can guarantee users that their data never leaves their machine. This is a massive selling point for freelancers with strict NDA or data-handling requirements.
  • Viable Side Hustle Economics: Closed API costs (e.g., $0.10–$0.50 per document) destroy the margins of a one-time-purchase desktop app. Local inference has a marginal cost of $0, making a $39 lifetime license genuinely profitable and sustainable.
  • Zero Vendor Lock-in: If a new, more hardware-efficient model drops (like Phi-3 or a new Mistral variant), I can swap the model backend in a single line of code. I am not at the mercy of a provider's pricing changes, deprecations, or rate limits.

My Agent Session

I used an open-source agent harness to iterate on the prompt engineering and ensure consistent JSON output across messy, real-world receipt formats.
(You can view the saved DevRelay agent session showing the prompt iteration and testing process here: DevRelay Session Link)

My First User

I shared an early build with Sarah, a freelance graphic designer who manages 10+ clients and constantly complains about tax season. She was immediately skeptical of cloud-based receipt scanners because her contracts require her to keep financial data confidential.

When I showed her ReceiptGuard running entirely offline via Ollama, her reaction was: "Wait, it actually doesn't upload anything to the cloud?"

She processed a month's worth of messy coffee shop and software subscription receipts in under 2 minutes. When I asked if she would pay for this, she said: "I currently pay $15/month for a cloud tool I hate. I would gladly pay $40 once for this if it stays offline and keeps my client data safe."

Her immediate feature request: A direct export to a QuickBooks-compatible CSV format (which I am actively adding to the v1.1 roadmap!).

Prize Categories

  • Open Source AI
  • Local First / Privacy
  • Developer Productivity

Thanks for participating!

Top comments (0)