RemiWriting · 07

Plan for your model to fail

24 February 2026 · 6 min read · ai · sentinel · architecture

Everything in your stack fails sometimes, and you've internalized that — retries, timeouts, circuit breakers. LLM APIs fail differently: they fail by degrees, and your architecture probably isn't shaped for that.

A database is up or down. A model API has a third state that dominates real operations: up, but not the way you wanted. Rate-limited at the worst hour. Slow enough to blow your interaction budget. Returning something that parses but scores garbage. In Sentinel — where a pipeline run means an investigator is waiting on triage of potentially urgent ads — I've had to treat "the model call" as a routing problem rather than a function call.

The routing table

Sentinel's calls go through one function, route(), which knows three things about every task: its quality floor, its latency budget, and its fallback chain. In practice:

  • Translation and first-pass triage → Gemini Flash. Fast, cheap, and the quality floor is genuinely low — a rough translation that arrives now beats a beautiful one after the investigator has gone home.
  • Risk scoring and dossier synthesis → Gemini 2.5 Pro, because these outputs carry evidentiary weight. Fallback: retry Pro once with backoff, then Flash with a flag, never silently.
  • Anything structural (JSON extraction, dedup keys) → Flash with strict schema validation, because the failure mode that matters there isn't intelligence, it's shape.

The part I'd underline twice: a fallback that doesn't change the UI is a lie. When a risk score comes from Flash because Pro was unavailable, the score renders with a "provisional" badge and gets re-queued for Pro when the pressure clears. The investigator sees the same number either way — the difference is whether she can trust it in a case file today. Degrading quality silently in a domain like this isn't graceful degradation; it's evidence tampering with extra steps.

Users don't need your system to never degrade. They need to know which answers came from the degraded path.

Failure you can rehearse

The habit that's paid off most is borrowed from the demo world: rehearse the failure. Sentinel has a chaos flag — ?degrade=pro — that makes the router pretend Pro is down. I run the full pipeline under it weekly. It costs nothing and it has caught, so far: a fallback prompt that had drifted out of sync with the primary, a "provisional" badge that a refactor had unhooked, and my favourite, a retry loop that dutifully retried a model that was returning successfully with empty candidates. None of these are exotic. All of them are invisible until the bad day, unless you schedule the bad day yourself.

The bigger point

There's a temptation to treat model choice as an identity — "we're a Gemini shop" — the way teams once treated databases. Resist it. Models are the most rapidly-improving, most price-volatile component in your stack; the vendor tables get reshuffled quarterly. The architecture that survives this decade is the one where swapping a model is a config change and every consumer downstream already expects variance in what comes back. Write your code as if the model is a talented contractor with unpredictable availability — because that is, functionally, exactly what it is.