I'm building Samevia from Stepanavan, a small town in northern Armenia. It teaches whole fields of knowledge, from mathematics to psychology, as short lessons in your own language, on the web and on Android. It is free to start and works offline.

Today it has 460 lessons across 16 fields. 429 are published in English and 269 in Armenian. Every one of them was drafted and translated by LLMs. This post is about the part that made that possible without shipping garbage: a small, boring, deterministic gate.

The problem: output that looks fine to everyone except a reader

Armenian has its own alphabet. When we started translating lessons with smaller models, many outputs looked like translations to anyone who doesn't read Armenian, and were unusable to anyone who does:

  • Armenian words transliterated into Latin letters
  • Cyrillic letters mixed into Armenian words
  • English sentences left untranslated in the middle of a paragraph
  • empty or truncated leaves that still "passed"

An LLM judge did not catch these reliably. A regex did.

The gate

Every translated leaf (a heading, a paragraph, a quiz option) goes through the same checks before it is accepted:

  1. Not empty, and not suspiciously short or long compared with the source (a length-ratio window).
  2. Script purity: in an Armenian target, no Latin or Cyrillic letters leaking into Armenian text.
  3. Untranslated detection: a leaf that is still the English source is rejected.

If a check fails, the leaf is not "fixed up". It is sent to the next provider in the chain. Free-tier models go first; a paid model is only a backstop at the end. That ordering is why the product can be free.

The bugs the gate had to learn

A strict gate is only useful if it rejects the right things. Two real cases from this month:

  • Units. 5 ppm or 120 mm/yr were flagged as untranslated English. They are units, not prose, so a number followed by a unit is now allowed.
  • Code in lessons. A lesson about testing in Python contains pytest, assert and fixture. The gate rejected the Armenian translation five times as "foreign script" and the pipeline kept paying for retries on the same leaf. The fix: an identifier that appears literally in the source (in code or a diagram) is a name, not a translation failure. Each fix shipped with a negative test, so the old wrong rejection is pinned as a failing case.

What we measure

We log every translation attempt with its outcome (ok, still_invalid, script_leak, error) and the model that produced it, and alert when the hourly success rate drops below 80%. That alert is how we noticed, yesterday, that two models in the chain had started producing mostly invalid Armenian, while others were fine. Without per-model outcomes it would have looked like "translation is flaky".

Takeaways

  • For low-resource languages, a cheap deterministic check beats an expensive LLM judge for the failures that matter most.
  • Never repair a bad output in place. Reject it and let the next provider try.
  • Every false rejection is a bug with a test, not an exception in a config file.
  • Log outcomes per model, or you will blame the wrong thing.

If you read Armenian, or another language that LLMs tend to mangle, I'd value your feedback on the lessons: https://samevia.com