DEV Community

Segeco
Segeco

Posted on

Letter Helper: a private, offline AI that explains scary letters to my dad

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend

What I Built

Letter Helper is a tiny app that explains confusing letters in plain English. You paste in the text of a letter, or just take a photo of it, and it tells you:

  • What this is: who it's from and what it's about
  • Do I need to do anything?: a clear yes or no, then numbered steps
  • Deadlines: as real calendar dates, with how many days are left
  • Money: what's owed, what you'll get, and what it becomes if you do nothing
  • What happens if I ignore it: the consequences, in order
  • Anything to watch out for: scam warning signs, with advice to phone the organisation on a number you already trust

I built it for my dad. He struggles to read and creating this will benefit him as things are broken down for him,

The usual fix is that he rings me and reads it out. That works, but it means waiting until I'm free, and reading out account numbers and balances over the phone.

Demo

The demo uses a made-up letter with no real personal details:

  1. A council tax reminder. Miss one instalment and, a week later, the whole year's balance becomes due, then a court order with extra costs. Letter Helper spells out that chain and works out the actual deadline date.

Code

GitHub logo Segeco / letter-helper

Explains confusing letters in plain English using Gemma 3 running locally with Ollama. Private, offline, free.

It's one Python file using only the standard library, plus Ollama. No pip installs, no accounts, no API keys.

How I Built It

The model: Google's open-weight Gemma 3 (4B), running locally through Ollama. It's small enough to run on an ordinary PC, and it can read images, so a photo of a letter works as well as pasted text.

The app: a small Python web server (standard library http.server) serving one page with a big text box, a photo button and a big "Explain this letter" button. Large fonts and high contrast, because the person using it isn't a developer. The server sends the letter (and photo, if there is one) to Ollama's local /api/chat endpoint with a system prompt, and shows the reply.

The prompt does most of the work. It tells the model who it's talking to (an older person, plain British English, short sentences, explain any jargon) and forces a fixed set of headings, so the answer always looks the same and he knows where to look for "do I need to do anything?".

What I fixed after testing:

  • On the council letter, my first version said he owed £142.50 and missed the bit that matters: if you don't pay, you lose your instalments and the full £1,282.50 becomes due. I changed the prompt to ask for every amount, including what it becomes if you do nothing, and added a "What happens if I ignore it" section.
  • The letter said "within 7 days of the date of this notice", and the model just repeated "7 days". That's useless if the letter has sat on the side for a week. Now the app passes today's date into the prompt, so the model gives the real date and how many days are left.
  • The small model loved markdown and kept adding **bold** asterisks, which looked like gibberish on the page. I told it to write plain text, and the app strips stray asterisks as a backstop.

With a 4B model, being very explicit about the output format made a big difference.

Why Does Open Innovation Matter?

For this project, it's the whole point.

Privacy. These letters contain names, addresses, account numbers, balances, debts and sometimes medical information. A hosted AI API would mean uploading all of that to a server he doesn't control. With Gemma running locally, the letter never leaves the computer. The server only listens on 127.0.0.1, and nothing is logged or saved. I can honestly tell her "nobody else sees this."

It costs nothing to run. No subscription, no API key, no surprise bill if he uses it every day.

It works offline. Once the model is downloaded, it doesn't need the internet.

I can swap the model. It's one line. On a stronger PC, gemma3:12b reads photos more accurately, and if something better comes out I can switch without rewriting anything or being tied to one company's API.

The trade-off: a big hosted model would probably be slightly better at date maths and blurry photos. But for an older person's private letters, "pretty good and completely private" beats "slightly better and uploaded somewhere". And it's designed to help her understand a letter, not replace common sense: for anything serious, it still tells her to ring the organisation on a number he trusts.

Prize Categories

  • Best Use of Gemma

Top comments (0)