ai newsDo., 15. Okt.
EilmeldungMeta and Apple team up to make Muse AI models run better on Macs

Let the model explain, let the code count: a local LLM helper for Swiss administrative letters

In Switzerland, a letter from a public office can start a clock. A Zahlungsbefehl (payment order) gives you 10 days to object. An Einsprache period is often 30. Miss the date and you lose a right. Many people read these letters in a language that isn't their first. I built a small local tool, "Spor

dev.toDonnerstag 03:26 · 15.10.2 Min. Lesezeit
Bild: dev.to

Posted on Oct 15 • Originally published at damianobianda.hashnode.dev

In Switzerland, a letter from a public office can start a clock. A Zahlungsbefehl (payment order) gives you 10 days to object. An Einsprache period is often 30. Miss the date and you lose a right. Many people read these letters in a language that isn't their first.

I built a small local tool, "Sportello chiaro", to explain such a letter in plain Italian and point out the deadline. It's an MVP. I want to describe the one design decision that I think matters, and be clear about what is and isn't tested.

A language model is good at explaining. It is not reliable at date arithmetic or at quoting the right number of days. So the deadline does not come from the model. It comes from code:

SERVED_RE = re. compile ( r " (?:zugestellt am|zustellung am|zugestellt:|notifié le|notifiée le|reçu le) " r " \s*(\d{1,2})[.\/](\d{1,2})[.\/](\d{4}) ", re. I ) Enter fullscreen mode Exit fullscreen mode The tool finds the notification date with this pattern, picks the number of days from the document type (10 for a Zahlungsbefehl or Strafbefehl, 30 for an Einsprache), and computes end = served + timedelta(days=days).

The model then gets the letter and a system prompt that says, in short: use only information present in the letter, and do not invent dates, amounts or law articles. Its job is the readable explanation, in four fixed sections.

The call to the local model is plain urllib, and it returns the text of the first choice. If the model call fails, the analysis falls back to the rule-based output and records the error. The user still sees the deadline and a response template, just without the prose.

These letters contain names, addresses and debts. Keeping the model on the user's machine means the text never leaves it. A small model is slower and less fluent, which is why the rules carry the parts that must be right.

When a task mixes language and facts, split it. Let code produce what must be exact and let the model do the explaining. Then say plainly which parts you have tested.

Quelle: dev.to (dev.to). Original öffnen