InvoicePilot AI — Private, local-first invoice & expense assistant for freelancers A developer built InvoicePilot AI, a privacy-first, local-first assistant that extracts structured data from invoices and receipts in PDFs and images, validates arithmetic, and exports sanitized CSV/XLSX reports. The app runs Gemma 2B through Ollama for extraction with a regex-based fallback when the model is unavailable, pairing a React/TypeScript frontend with a Python/FastAPI backend, PyMuPDF and Tesseract for OCR, and SQLite for storage, deployable via Docker Compose. 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: Start Ollama optional : Set up the backend: Activate the virtual environment, then run: Start the frontend in a separate terminal: Frontend: http://localhost:5173 http://localhost:5173 API documentation: http://localhost:8000/docs 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.