DEV Community

Priyansh Jikadra
Priyansh Jikadra

Posted on

Invoice Sorter

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

Invoice Sorter is a local, privacy-first command-line tool that turns a messy folder of invoices and receipts (PDFs and images) into organized, accounting-ready data. It reads each document with OCR, uses a local open-weight LLM to pull out the vendor, amount, date, invoice number and expense category, then sorts the files into folders and exports JSON, CSV and Excel.

It's built for freelancers, solo consultants and small bookkeeping practices. They handle dozens of documents a month, and the usual options are cloud tools that upload client financial data or monthly subscriptions that eat into thin margins. Invoice Sorter runs on their own laptop, works offline, and costs nothing per document. Anything the model can't read confidently is flagged needs_review instead of being silently guessed.

Demo

Code

The full source is open under the MIT license, and the repository is embedded below. It has a src/ layout and a 49-test pytest suite.

GitHub logo priyansh07-svnit / invoice-sorter

project for hacktober week 2

Invoice Sorter 🧾

A local, privacy-first invoice and receipt organizer for freelancers β€” powered by open-source AI.

Python License Hacktoberfest


🎯 Why This Exists

Freelancers deal with dozens of invoices and receipts every month. Existing solutions either:

  • Send your client data to the cloud (privacy nightmare)
  • Cost monthly subscriptions (eats into thin margins)
  • Don't work offline (useless on flights or secure environments)

Invoice Sorter runs 100% locally on your laptop using Ollama and open-weight models like Llama 3.2. Your financial documents never leave your machine.


✨ Features

Feature Description
πŸ”’ 100% Local No cloud APIs, no data leaves your machine
πŸ€– Open-Source AI Uses Ollama with Llama 3.2 (or any model you choose)
πŸ“„ Multi-Format Processes PDFs, PNG, JPG, TIFF, BMP
🏷️ Smart Extraction Vendor, amount, date, invoice number, category
πŸ“ Auto-Organization Sort by category, date, vendor, or document type
πŸ“Š Export JSON, CSV, Excel for accounting software
πŸ’° Free Forever No subscriptions,
…

How I Built It

Building it: I used the open-source agent harness opencode with NVIDIA's open-weight Nemotron 3 Ultra and Nemotron 3.5 Super VL models as my coding agents. Beyond writing the code, I used them to review it, find bugs and write tests.

Running it: The tool is a Python CLI built with Click and Rich. Pydantic models validate everything the LLM returns.

  • Text extraction: pdfplumber reads PDFs, and Tesseract OCR (via pytesseract and Pillow) reads images. Scanned PDFs without a text layer fall back to pypdfium2 rendering plus OCR.
  • Extraction: The text goes to a model served locally by Ollama, llama3.2:3b by default, and the model returns structured JSON. You can swap in any Ollama model with --model.
  • Guardrails: Model output is often messy, so parsing is lenient. It handles markdown fences, string amounts, European decimals like 1.234,56 EUR, currency symbols and null fields. Dates are validated, and anything that can't be read is flagged for review.
  • Output: The sorter copies files into folders by category, date, vendor or type without overwriting duplicates, and the exporter writes JSON, CSV and Excel.

Why Does Open Innovation Matter?

Invoices and receipts are some of the most sensitive documents a freelancer holds, because they contain client names, amounts and bank details. With a closed API, every document would have to be sent to a vendor's servers, and each one would cost money per call. Open-weight models make the opposite design possible. Everything runs on the user's own machine, so no data leaves it, the tool works offline, and there are no per-document costs or rate limits.

It also means users choose the model. They can run a small, fast model on a modest laptop or a larger one for better accuracy, and a model update never changes their pricing. The same openness applied to how I built the project: an open agent harness with open-weight Nemotron models meant I could build and iterate on it without being tied to a single vendor.

My Agent Session

I built this with opencode and NVIDIA's Nemotron models. [Embed your DevRelay agent_session here, or link to it.]

My First User

Prize Categories

Top comments (1)

Collapse
 
priyansh_9331_k profile image
Priyansh Jikadra •

Financial paperwork is a quiet burden for freelancers, gig workers and tiny businesses, who are often a one-person team with no finance department. Tools that automate it usually mean uploading sensitive client and bank data to a third-party cloud, or paying a monthly fee. Invoice Sorter gives them the same convenience for free and keeps everything on their own device. That protects privacy, helps people stay organized for tax time and bookkeeping, and removes a cost barrier for people with thin margins. Because it works offline, it’s also useful where internet access is unreliable or where confidential work rules out cloud tools.