Explaining Swiss administrative letters in plain Italian with a 1B Gemma on CPU
What they built
Damiano built a small tool that explains Swiss administrative letters in plain Italian, entirely on his own machine. A payment order from the debt-collection office arrives as paper or a PDF that behaves like paper, with stamps, reference numbers in odd places and amounts three table cells away from their labels.
The tool is about 306 lines of standard-library Python 3.10 talking to a 1B-parameter Gemma running on CPU through Ollama. His main lesson was that the work that makes the output trustworthy happens before the model runs.
Setup
- A 1B-parameter Gemma model running on CPU through Ollama
- About 306 lines of Python 3.10, standard library only
How it works
- A plumbing step extracts the letter's text, normalizes the encoding and collapses layout artifacts: stitching hyphenated words, removing repeated headers and rejoining numbers split across lines.
- Deterministic code finds the fields where a mistake costs money or a missed deadline: the deadline, the amount, the reference number and the sending office.
- The model gets only the cleaned text and those extracted fields, with no conversation history or extra context, and its one job is to explain in calm everyday Italian what the letter is and what the sender wants.
- If the letter is unclear, the intended output is that this part is unclear, not a confident guess.
Results & numbers
- One measured run on his CPU took about 40 seconds per letter end to end, most of it the model; the text plumbing takes milliseconds.
Gotchas
- A 1B model can paraphrase reliably but can't be trusted to report a deadline faithfully, so exact values must come from code.
- Extracted PDF text is messy, and a small model does poorly until it has been cleaned back into sentences.
- The 40-second figure is a single measurement on a single machine.
“The quality of a small local model is mostly determined before it runs”— Damiano
Do it yourself
- Install Ollama and pull a small Gemma model that runs on your CPU.
- Write a text-extraction and cleaning step for your letters: fix encoding, rejoin hyphenated words and split numbers, and drop repeated headers.
- Extract the critical fields (deadline, amount, reference, sender) with plain code such as regular expressions, not the model.
- Send the model only the cleaned text plus those fields, and ask it to explain the letter in your language and to say when something is unclear.
- Show the code-extracted fields next to the explanation so the important values never depend on the model.
Related
Connecting a self-hosted Ollama server to WordPress, and why localhost fails
John Rotherham, who works on a WordPress SEO plugin, walks through pointing WordPress AI features at your own Ollama server instead of a cloud API key, including where Ollama must run, how to lock down its unauthenticated port, and how to test from PHP.
Siesta: a local overnight agent that reads fridge photos and receipts, then sleeps
Md Faijal Eaqbal built Siesta, a folder-watching agent on 3B open-weight models in Ollama that turns fridge photos, receipts and chat exports into one morning page, and spends zero tokens when nothing has changed.
ShelfReady: a private Amazon KDP listing studio running Gemma 3 4B on a CPU
A designer and colouring-book publisher built ShelfReady to draft Amazon KDP titles, keywords and descriptions with Gemma 3 4B in Ollama, then check every field against KDP's rules in code, on an ordinary 8-core CPU with no GPU.
LazyDesk AI: a local file organizer that renames and sorts your Downloads with Qwen3
LazyDesk AI scans a folder you allow, reads PDFs, DOCX, Markdown and CSVs locally, and has a local Ollama model propose clean filenames and categories, then moves files only after you approve, with hash-checked one-click undo.