DEV Community

Cover image for LocalBooks AI: Turning Invoices into Structured Data with Open-Source AI
Piyush kumar
Piyush kumar

Posted on

LocalBooks AI: Turning Invoices into Structured Data with Open-Source AI

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission đź’¸

LocalBooks AI: A Private, Local-First AI Bookkeeping Assistant for Freelancers

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

What I Built

LocalBooks AI is a privacy-first invoice and receipt organizer designed for freelancers, independent professionals, and small businesses.

Bookkeeping shouldn't require hours of manually entering invoice details into spreadsheets. Freelancers often deal with dozens of receipts, vendor invoices, tax amounts, and payment records. Sending these sensitive documents to cloud AI services can also raise privacy and confidentiality concerns.

LocalBooks AI aims to simplify this workflow by processing invoices and receipts locally, extracting important information, and organizing it into structured records.

Key features include:

-Invoice and receipt processing: Upload PDF, PNG, JPG, or JPEG documents.
-Local OCR:** Use Tesseract to extract text from supported documents.
-AI-powered normalization: Use a locally running Ollama model to convert extracted text into structured invoice data.
-Bookkeeping dashboard: Review invoice records, amounts, vendors, and categories.
-Data validation: Help identify missing fields, duplicate records, and arithmetic discrepancies.
-Local-first privacy: Keep document processing on the user's own computer rather than sending financial documents to a hosted AI API.

The target users are freelancers, consultants, small-business owners, and accounting professionals who want a simpler way to organize financial documents.

The potential business model is a paid desktop or self-hosted edition with features such as batch processing, Excel-compatible exports, recurring reports, and multi-business support.

Demo

**Demo video: https://drive.google.com/file/d/1JUPdqCOddvKLqo75byagzUb0fYAdH8r4/view?usp=sharing

Because local inference is a core feature, the application is designed to work without sending financial documents to a cloud AI provider. Initial installation and model downloads require internet access; offline operation depends on the required software and model already being installed.

Code

GitHub repository: https://github.com/piyushkr1155/LocalBooks_AI

The project uses a modular architecture so the interface, document-processing pipeline, and AI inference can be developed and tested independently.

How I Built It

I built LocalBooks AI around open-source tools and an open-weight language model rather than making a proprietary cloud AI API the core of the application.

Technology stack

-Next.js and TypeScript:Dashboard, upload interface, invoice review, and visualization.
-FastAPI:Backend API and document-processing workflow.
-Tesseract OCR:Local text extraction from scanned invoices and receipts.
-Ollama:Local model runtime for AI-powered extraction and normalization.
-Llama 3.2:The initial open-weight model choice for structured extraction experiments.
-SQLite:Local persistence for invoice records and bookkeeping data.

Document-processing workflow

1.The user uploads an invoice or receipt.
2.The backend validates the file and extracts its text using the appropriate PDF text-extraction or OCR method.
3.The extracted text is passed to the locally running Ollama model.
4.The model produces structured fields such as vendor name, invoice number, date, taxable value, tax amounts, and total.
5.Validation logic checks required fields and arithmetic consistency.
6.The user reviews the extracted values before relying on them for bookkeeping.

AI-extracted values are treated as suggestions that require review, not as automatically verified accounting or tax facts.

Why Does Open Innovation Matter?

For financial software, privacy is a product feature—not just a technical detail.

Invoices and receipts can contain client identities, addresses, transaction details, and other commercially sensitive information. A local-first architecture gives users more control over where those documents are processed.

Open-weight models and local inference make several things possible:

-Privacy and control: Financial documents can remain on the user's machine.
-Offline capability: Once dependencies and model weights are installed, core inference can run without an internet connection.
-Model flexibility: Developers can experiment with different models without redesigning the entire application.
-Lower recurring inference costs: Local inference avoids per-request charges from a hosted model API, although hardware, electricity, maintenance, and support still have costs.
-*Transparency and experimentation: Developers can inspect the workflow, write tests, change prompts, and improve extraction for their own document formats.

A closed API could also provide excellent extraction quality, but it would introduce a different privacy and infrastructure trade-off. For this project, open innovation makes it practical to build a bookkeeping assistant that users can control, inspect, and run locally.

What I Learned

This project reinforced an important lesson: building an AI-powered product is not just about getting a model to generate a response.

The real challenge is turning unstructured documents into reliable, reviewable business records. OCR quality, structured output, numerical validation, error handling, and a clear user interface all matter.

For accounting-related workflows, the model should assist with extraction—not replace verification.

What's Next?

My next priorities are:

  • Improve extraction accuracy on real-world invoice layouts.
  • Add duplicate detection and confidence indicators.
  • Expand Excel and CSV export options.
  • Add automated tests for OCR, extraction, and tax arithmetic.
  • Improve the first-run setup experience for non-technical users.
  • Benchmark different open-weight models on the same invoice dataset.

The goal is to make LocalBooks AI useful enough that a freelancer or small business can save time on routine bookkeeping without giving up control of their financial data.

Conclusion

LocalBooks AI explores a practical use of open-source AI: helping small businesses organize their finances with local inference, flexible models, and a privacy-first workflow.

I built it for a simple reason: **small businesses deserve useful AI tools without having to send every financial document to someone else's server.

I'm looking forward to improving the project and learning from the open-source community.

Hacktoberfest #OpenSourceAI #LocalAI #Ollama #SideHustle

Top comments (0)