DEV Community

Sumeet Choudhary
Sumeet Choudhary

Posted on

LocalLedger - Your private AI expense copilot.

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

LocalLedger โ€” Your Private AI Expense Copilot for Indian Freelancers

Your private AI expense copilot.

LocalLedger is a local-first AI expense intelligence tool built for Indian freelancers, solo developers, creators, consultants, and small businesses.

It turns receipts and invoices into a structured, searchable, validated expense ledger using local OCR, deterministic financial validation, SQLite, and an open-weight Gemma model running locally through Ollama.

The core idea is simple:

AI understands the document. Code protects the numbers.


๐Ÿš€ What I Built

Managing invoices and business expenses can quickly become messy, especially for freelancers and small businesses.

LocalLedger provides a privacy-focused workflow for turning financial documents into useful structured information:

IMPORT โ†’ EXTRACT โ†’ UNDERSTAND โ†’ VALIDATE โ†’ CLASSIFY โ†’ REVIEW โ†’ ANALYZE โ†’ EXPORT

Users can upload:

  • PDF invoices
  • Scanned PDFs
  • JPG/JPEG images
  • PNG images
  • WEBP images

LocalLedger then processes the document locally and extracts information such as:

  • Vendor name
  • Invoice number
  • Invoice date
  • Subtotal
  • Discount
  • Taxable amount
  • CGST
  • SGST
  • IGST
  • GST total
  • Total amount
  • GSTIN
  • Expense category
  • Description
  • Business-expense classification
  • Extraction confidence

The extracted information is then validated using deterministic rules before being stored in the expense ledger.


๐Ÿ’ก Why LocalLedger?

Financial documents contain sensitive information.

Instead of sending invoices and receipts to a cloud AI service, LocalLedger is designed around a local-first architecture.

The goal is to keep financial documents and AI processing under the user's control.

Local-first by design

  • ๐Ÿค– Gemma 3 4B runs locally through Ollama
  • ๐Ÿ” Local OCR
  • ๐Ÿ—„๏ธ SQLite local database
  • ๐Ÿ”’ No cloud AI required
  • ๐Ÿ“„ Documents remain local
  • ๐Ÿงฎ Financial calculations are handled by deterministic code
  • ๐Ÿง  AI is used for interpretation rather than blindly calculating financial values

This makes LocalLedger particularly useful for people who don't want their financial documents uploaded to third-party AI services.


๐Ÿ—๏ธ How It Works

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚      User Upload     โ”‚
                    โ”‚ PDF / JPG / PNG etc. โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚   Document Ingestion โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚                      โ”‚
                    โ–ผ                      โ–ผ
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚ Native PDF Text โ”‚    โ”‚   Local OCR     โ”‚
          โ”‚   Extraction    โ”‚    โ”‚   for Scans     โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚                      โ”‚
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚ Structured Extractionโ”‚
                    โ”‚       Pipeline       โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚    Gemma 3 4B        โ”‚
                    โ”‚  Local AI Reasoning  โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚ Pydantic Validation  โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚ Financial Validation โ”‚
                    โ”‚    & Duplicate Check โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚     Expense Ledger   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                 โ–ผ             โ–ผ             โ–ผ
            Dashboard       Review        Export
Enter fullscreen mode Exit fullscreen mode

๐ŸŽฅ Demo

GitHub Repository: https://github.com/sumeet156/LocalLedger

Video Demo: Watch the LocalLedger demo

๐ŸŒ Why Open Innovation Matters

LocalLedger would not have been possible in the same way without open-source and open-weight technologies.

The project combines open technologies across multiple layers:

  • Open-weight Gemma model
  • Ollama for local model execution
  • FastAPI
  • React
  • Python
  • SQLite
  • Pydantic
  • Local OCR tooling The open ecosystem makes it possible to build a useful AI application without depending entirely on proprietary cloud AI APIs.

More importantly, it allows developers to experiment with privacy-preserving AI applications.

For financial documents, this is especially important.

Instead of asking:
"How can I send this document to an AI?"

LocalLedger asks:
"How much intelligence can we bring to the user's machine?"

๐Ÿ… Prize Categories & Tools

  • ๐Ÿ† Hacktoberfest โ€” Side Hustle
  • ๐Ÿค– Google / Gemma
  • ๐ŸŒ Open-Weight AI
  • ๐Ÿ› ๏ธ AI-powered Productivity / Developer Tools
  • ๐ŸŽ™๏ธ *ElevenLabs for creating demo video

Top comments (0)