DEV Community

Cover image for Receipt Box: keeping freelancers' receipts private with Gemma, built for Hacktoberfest
E. Smith
E. Smith

Posted on

Receipt Box: keeping freelancers' receipts private with Gemma, built for Hacktoberfest

This is a submission for the MLH x DEV Writing Challenge

What I Built

Receipt Box is a receipt and invoice sorter for freelancers that runs entirely on your own laptop.

The idea came from the end-of-quarter ritual every freelancer knows: a folder of crumpled photos, PDF invoices in several currencies, and an accountant asking "which of these have VAT?" Those documents are some of the most sensitive "boring" data you have: who you work for, where you travel, what you pay for. I did not want to ask anyone to upload them to a cloud service, so the whole thing runs locally.

Drop in photos or PDFs and a vision model reads each one: vendor, date, total, VAT, currency and a category (Software, Travel, Meals...). You get:

  • a dashboard with total spend, VAT to reclaim, and spend by category and month;
  • a VAT-by-quarter table, the number a freelancer actually hands to the accountant;
  • an editable table, where changing a vendor's category once teaches Receipt Box to sort that vendor the same way from then on;
  • duplicate detection, multi-currency totals, and CSV / Excel export.

The biggest thing I learned: a small model is allowed to be wrong, as long as fixing it is cheap. A 4B model misreads the odd crumpled receipt, so the correction table and the learned vendor rules are what make the tool usable, more than the model itself.

Demo

Live app: https://receipt-box-69v1.onrender.com (click Load demo data to explore the dashboard)

Receipt Box dashboard

Receipt Box receipts table

The repo includes three fictional sample documents in samples/ (a PDF invoice and two receipt images in different currencies). Drop them in and the dashboard fills in as each one is read.

GitHub logo banana0000 / receipt-box

Private receipt & invoice sorter for freelancers: Gemma 3 reads your receipts locally via Ollama. Editable table, learned categories, VAT by quarter, multi-currency, CSV/Excel export.

Receipt Box

A receipt and invoice sorter for freelancers that runs entirely on your laptop Photos and PDFs go to an open-weight vision model (Gemma 3 via Ollama), and the result is a categorised expense dashboard plus a CSV or Excel file for your accountant Nothing is uploaded anywhere.

Features

  • Reads receipt photos (JPG / PNG) and PDF invoices (text layer or scanned) with Gemma 3.
  • Dashboard: total spend, VAT to reclaim, spend by category and by month, VAT by quarter.
  • Editable table: fix any cell, delete rows. Changing a category teaches the app: that vendor is sorted the same way from now on (saved in rules.json).
  • Possible duplicates are highlighted.
  • Several currencies: pick one, or "All currencies" to see them side by side. Amounts are never converted.
  • Export to CSV or Excel (receipts, spend per category, VAT per quarter).
  • Optional line-item extraction (slower).
  • Files are read one at…

Partner Technologies

Gemma 3 (Google DeepMind), through Ollama. The entire product is built on Gemma 3 4B with vision, running on the user's machine. The only network call the app makes goes to localhost.

  • Each image is sent to Gemma with a JSON schema (vendor, date, total, vat, currency, category), and the category is constrained to a fixed list. The reply always parses, so there is no regex and no retry loop.
  • PDFs take two paths: if there is a text layer, the text goes straight to the model, which is faster; scanned PDFs are rendered to an image with PyMuPDF and go through the vision path.
  • On a CPU a receipt takes roughly 15-20 seconds, so files are processed in a queue and the page shows "Reading 2 of 5: name.png" instead of freezing.
  • The prompt tells the model to use only what is printed and never guess. A bigger Gemma or a GPU is a one-line change (RECEIPT_MODEL).

Render. The app also deploys from a single Blueprint (render.yaml): a private Ollama service with Gemma 3 baked into its Docker image, and the web app talking to it over Render's private network, so the model is never exposed to the internet. Gemma 3 4B needs about 4-5 GB of RAM, so the Ollama service needs a large instance, which was the main thing I had to plan around.

The rest is a Dash app with Plotly charts, pandas for the numbers, openpyxl for the Excel export, and pytest tests for the data layer (duplicates, quarters, rules, exports).

Hackathon Experience

I built Receipt Box for the Hacktoberfest Open-Source AI Challenge, Week 2: Side Hustle (October 12 to 18, 2026), the online challenge run by DEV together with MLH. The prompt was to build something with open-weight models that someone would actually pay for, and an invoice and receipt sorter that runs locally was one of the ideas in it, which pushed me to take the privacy question seriously instead of treating it as a side note.

Having a one-week window with a clear theme kept the scope honest: I cut features that did not help the "hand this to my accountant" moment, and spent the time on the correction table, quarterly VAT and the progress indicator.

Top comments (0)