This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle
What I Built
Scribe turns photos of paperwork into clean formatted JSON. You drop in receipts, invoices or business cards, and it reads them, pulls out the fields you care about, and files everything into tidy folders. And the best part - It all runs on your own computer using Gemma 4.
It is built for people who are drowning in paper: freelancers and small shop owners at tax time, bookkeepers retyping receipts, anyone with a pile of business cards from the last conference. Cloud OCR tools charge per page and need you to upload sensitive documents. Scribe doesn’t.
Demo
Code
marinn-3011
/
scribe-image-to-json
Scribe: A tool to convert Photos of Receipts and Invoices into Sorted JSON with Gemma 4
Scribe
Turn photos of receipts, invoices and business cards into clean, sorted JSON. Runs locally with Gemma 4 through Ollama, so your documents never leave your machine.
Built for the Hacktoberfest 2026 Open-Source AI Challenge (Side Hustle).
Features
- Batch scanning: drop in many images and get one combined JSON file.
-
Custom schemas: use a preset (receipt, invoice, business card), write your own
name: typefields, or paste a full JSON Schema. -
Auto-sort: Scribe detects each document's type and files it into folders, with the original image next to its JSON. Download everything as a
.zip. - Auto mode: no schema needed, the model chooses the fields.
- Exports: copy the result, or save it as JSON or CSV.
-
No guessing: fields the model can't see come back as
null.
Requirements
- Python 3.10+
- Ollama
- Enough memory for your chosen model (roughly 12 GB free for
gemma4:e4b)
Setup
# 1.…How I Built It
The model is Gemma 4, served locally through Ollama. I default to the small gemma4:e4b for speed, and the UI lets you switch to the 26B or 31B models when a document is tricky. Gemma 4 reads images directly, so there’s no separate OCR step. It also natively supports over 140 languages (with out-of-the-box fluency in 35+), enabling it to seamlessly process, understand, and translate documents featuring multiple languages simultaneously.
For each document, Scribe does three things: it asks Gemma 4 what kind of document it is, extracts the fields using the matching schema, then saves the original and the JSON into a folder for that type.
The part that made this work was Ollama’s structured outputs. You pass a JSON Schema in the request, and the model’s answer follows it:
payload = {
"model": "gemma4:e4b",
"format": schema, # your JSON Schema
"options": {"temperature": 0},
"messages": [{"role": "user", "content": "Extract the data.", "images": [image_b64]}],
}
Why Does Open Innovation Matter?
Scribe handles receipts, invoices and contact details, so privacy is the whole point. Gemma 4’s weights are published under Apache 2.0, which means the model runs on the customer’s machine and their documents never leave it. Data Security and Privacy is hard to promise when it comes to closed APIs.
It also makes the economics work for a side hustle. There are no per-page fees and no rate limits, so scanning a thousand receipts costs a bit of electricity. As it processes files locally, It even works offline.
Prize Categories
Best Use of Gemma
Top comments (0)