Home / use case

Explaining Swiss administrative letters in plain Italian with a 1B Gemma on CPU

At a glance
Models & engines
A 1B-parameter Gemma model running on CPU through Ollama
Key gotcha
A 1B model can paraphrase reliably but can't be trusted to report a deadline faithfully, so exact values must come from code.

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

  1. 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.
  2. 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.
  3. 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.
  4. 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

  1. Install Ollama and pull a small Gemma model that runs on your CPU.
  2. Write a text-extraction and cleaning step for your letters: fix encoding, rejoin hyphenated words and split numbers, and drop repeated headers.
  3. Extract the critical fields (deadline, amount, reference, sender) with plain code such as regular expressions, not the model.
  4. 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.
  5. Show the code-extracted fields next to the explanation so the important values never depend on the model.
Source: Damiano (DEV Community) · Published 2026-10-19 · Added 2026-10-22. This write-up summarizes the original source; see it for full details.

Similar setups

Séance: local Whisper and Gemma 4 turn a grandmother's Malayalam voice notes into a searchable family archive

Clivin John built Séance, which transcribes and translates his grandmother's voice notes on his laptop, has Gemma 4 write memory cards, and answers questions only with her exact, verified words.

Clivin John (DEV Community) · 2026-10-31

Ofrenda Keeper: local Gemma 3 makes a Día de los Muertos card from only what you said

hongpengtan0-max built Ofrenda Keeper, a local app where Gemma 3 4B in Ollama turns what you tell it about someone you miss into an altar card, and plain code removes any detail you didn't actually say.

hongpengtan0-max (DEV Community) · 2026-10-28

Paper to Portfolio: local Gemma 4 reads an old share certificate, Python does the maths

Rahul Kumar built Paper to Portfolio, which uses gemma4:e4b in Ollama on a CPU-only laptop to read an old Indian share certificate and pick out bonuses, splits and mergers from pasted filings, while plain Python checks every quote and does all the arithmetic.

Rahul Kumar (DEV Community) · 2026-10-27

Gist: an offline exam-prep partner that mines past papers with Ollama

A student built Gist so a friend could study from lecture PDFs and three-plus years of past exam papers without uploading copyrighted course material anywhere; parsing, embeddings, search and the LLM all run on the laptop with Wi-Fi off.

DEV Community (Hacktoberfest Build for a Friend) · 2026-10-20