DEV Community

Qadeer Durrani
Qadeer Durrani

Posted on

Title: Smart Invoice AI: private, local bookkeeping for freelancers

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

*his is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

Smart Invoice AI is a bookkeeping tool for freelancers. You upload a photo or screenshot of an invoice or receipt, and a local AI reads it, extracts the date, vendor, total, currency and items, and suggests a category. You review the result, correct anything that is wrong and save it. At the end of the month you get an income, expense and profit report with a category breakdown and CSV export.

Who would pay for it: freelancers who bill foreign clients and also pay platform fees, software subscriptions and internet bills, but have no real bookkeeping. I built it with Pakistani freelancers in mind. Tax season means digging through screenshots and half-finished spreadsheets, and their invoices contain client names and amounts that many people do not want to upload to a cloud service. Smart Invoice AI does everything on the user’s own computer.

Business model: a one-time paid desktop licence (I am testing an early-access price of around Rs. 400), with a paid tax-season report planned later. I have no revenue yet, so this is a plan I still need to validate.

Demo

There is no hosted demo, and that is deliberate. Hosting the app would send invoices to a server, which would defeat its purpose. The video shows the full flow: upload, extraction, editing, saving and the monthly report.

Here is an honest result from a real garage invoice. The date (2025-10-22) and total (472.70) were extracted correctly. The vendor was wrong: the 3B model picked the customer’s name instead of the company that issued the invoice. This is exactly why every entry goes through an editable review form before it is saved.

Code

GitHub logo qadeerdurrani244-art / smart-invoice-ai

Private, local AI bookkeeping for freelancers. Upload an invoice or receipt, a local AI (Ollama + OCR) reads it and builds your monthly income, expense and profit report. Nothing leaves your computer.

Smart Invoice AI

Private, local AI bookkeeping for freelancers. Upload a photo of an invoice or receipt, and a local AI reads it and builds your monthly income, expense and profit report. Nothing leaves your computer.

Built for freelancers in Pakistan (PKR support, FBR tax-season report planned), useful for anyone who wants invoice tracking without sending client data to the cloud.

Features

  • OCR with RapidOCR reads text from invoice and receipt images (PNG/JPG)
  • Local AI (via Ollama) extracts date, vendor, total, currency and items as structured JSON
  • Review before saving: every field is editable, so AI mistakes never reach your books
  • Category suggestions from keyword rules (Platform Fees, Internet & Utilities, Equipment, ...)
  • Monthly report: income, expenses, profit, spending by category, CSV export
  • 100% local: SQLite database, no accounts, no cloud

How it works

Image -> RapidOCR (text) -> local LLM via Ollama (JSON) -> editable form
…

The README covers installation, usage, how to choose a model and the known limitations.

How I Built It
Python and Streamlit for the interface
RapidOCR (ONNX, runs on CPU) to read text from images
Ollama with qwen2.5:3b to turn the OCR text into structured JSON
SQLite and pandas for storage and monthly reports

The pipeline is: image, OCR, local LLM (JSON), editable form, SQLite, report.

A few decisions shaped the project:

OCR first, small text model second. My laptop is modest, and a vision model was too heavy. OCR reads numbers and dates well, so the LLM only has to structure the text.
A human confirms every entry. Small models make mistakes, so nothing reaches the books until the user approves the form.
Code handles what the prompt cannot. I instructed the model not to guess a currency from a lone $, and it ignored the rule. The app now accepts a currency only when a code such as USD or PKR is actually printed on the invoice, and otherwise falls back to the user’s default.
The model is swappable. The SMART_INVOICE_MODEL environment variable switches models. The default qwen2.5:3b is released under a research licence, so for a commercial version I plan to move to an Apache-2.0 model such as qwen2.5:7b.

I used an AI assistant to help write and debug the code, and I tested everything on my own machine. Setting it all up on a slow connection and a very new Python version took real effort.

Why Does Open Innovation Matter?
Privacy is the product. A freelancer’s invoices are their clients’ financial details. With open weights and local inference the data never leaves the laptop, which a closed API cannot offer because every invoice would travel to someone else’s server.
No per-invoice cost. There is no API bill in dollars and no card needed. After the one-time model download, the app runs offline.
I stay in control of the model. I can swap in a larger or differently licensed model with a single setting, which is how I will handle the commercial release.

Next on the roadmap: PDF export, an FBR tax-season report and Urdu invoice support.

Top comments (0)