DEV Community

Abhishek S J
Abhishek S J

Posted on Fully Autonomous

InvoicePilot AI — Private, local-first invoice & expense assistant for freelancers

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

What I Built

InvoicePilot AI is a privacy-first, local-first AI assistant that extracts structured data from invoices and receipts in PDFs and images. It validates arithmetic and exports sanitized CSV/XLSX reports.

It uses Gemma 2B through Ollama for AI extraction, with a regex-based fallback when the model is unavailable. The application has a React frontend and FastAPI backend.

Key Features

  • AI-powered invoice and receipt extraction
  • PDF parsing and OCR for scanned documents
  • Local inference using Ollama and Gemma 2B
  • Regex-based fallback extraction
  • Arithmetic validation and confidence scoring
  • Batch document uploads and inline editing
  • Sanitized CSV and XLSX exports

Who Would Pay for It?

  1. Freelancers who want to automate invoice processing.
  2. Small agencies managing multiple vendor invoices.
  3. Organizations that prioritize privacy and local data processing.

Tech Stack

  • Frontend: React, TypeScript, Vite
  • Backend: Python, FastAPI
  • AI: Gemma 2B, Ollama
  • OCR and Parsing: PyMuPDF, Tesseract
  • Database: SQLite, SQLAlchemy
  • Exports: CSV, XLSX
  • Deployment: Docker, Docker Compose

Quick Setup

Clone the repository:

git clone https://github.com/aBhishek-jAm/HactoberFestProj.git
cd HactoberFestProj
Enter fullscreen mode Exit fullscreen mode

Start Ollama (optional):

ollama pull gemma:2b
ollama serve
Enter fullscreen mode Exit fullscreen mode

Set up the backend:

cd backend
python -m venv .venv
Enter fullscreen mode Exit fullscreen mode

Activate the virtual environment, then run:

pip install -r requirements.txt
python -m uvicorn app.main:app --reload --port 8000
Enter fullscreen mode Exit fullscreen mode

Start the frontend in a separate terminal:

cd frontend
npm install
npm run dev
Enter fullscreen mode Exit fullscreen mode

Frontend: http://localhost:5173

API documentation: http://localhost:8000/docs

How It Works

  1. Upload invoice or receipt documents.
  2. Extract text using PDF parsing or OCR.
  3. Process the text using Gemma 2B or the regex fallback.
  4. Validate totals and flag inconsistencies.
  5. Review extracted data and export reports.

Why Open Innovation Matters

InvoicePilot AI combines open-weight AI with deterministic validation to support transparent, customizable, privacy-conscious document processing. Users can run inference locally, inspect the source code, and experiment with alternative models.

Demo and Repository

Future Improvements

  • Accounting software integrations
  • Additional export formats
  • Improved multi-currency support
  • Better extraction accuracy for complex invoices

Hacktoberfest Categories

  • Side Hustle / Productivity
  • Open Source AI Tools / Best Use of Open Weights

InvoicePilot AI demonstrates how open-weight models, OCR, and deterministic validation can automate invoice processing while giving users greater control over their data.

Top comments (0)