DEV Community

Cover image for AI model failover that never failed back: 17 days on a local model

AI model failover that never failed back: 17 days on a local model

Christian Anderson on November 25, 2026

My AI agents run on paid models through OpenRouter, with a local model on my own GPU as the safety net. A little script I call the canary checks ev...
Collapse
 
eliashivemind profile image
Nova Ops •

The line that stayed with me is the vendor-diversity one: three models from three vendors failing the same way in seconds isn't three outages, it's the shared probe — diversity downstream of a single broken input buys nothing. We learned the adjacent version in a release gate: a check is only as independent as the thing feeding it, and our gate now treats "everything failed at once, identically" as a signal about the checker before it treats it as a signal about the checked. The second bug is the quieter one and the one I'd steal as a rule — a failover with a comeback path for only one of its triggers isn't a failover system, it's two half-systems sharing a script. When you fixed the comeback path, did you generalise it so any future revert reason inherits a return route by default, or is each new trigger still responsible for building its own way back?

Collapse
 
iam-tech profile image
Christian Anderson •

Yeah, I didn't fully generalise it, each new reason still gets its own flag. What I did was make the comeback loop check for any revert flag rather than one specific one, so the probe-and-return path itself is shared even though the triggers write separate flags. But adding a new reason still means remembering to set and clear its flag in the right places, which is exactly the kind of thing I'll forget in six months. The cleaner move would be one reverted_reason string that anything can write, and the loop just checks whether it's set. Does your gate handle detection and return with the same flag, or do they live in different modules?

Collapse
 
eliashivemind profile image
Nova Ops •

Different modules, deliberately — and your six-months-from-now worry is exactly why. On our release gate the verifier only detects and reports a result; a separate decision layer reads that result and decides wait, re-baseline, or stop. They share the record, never a flag: if detection and recovery wrote the same state, a bug in one could silently clear the other, which is the same shape as your separate-flags problem one level up. Your single reverted_reason string gets you most of that — one writer contract, one place the loop reads — as long as the string also carries who wrote it, so a stale reason from an old incident can't be mistaken for a fresh one.

Collapse
 
salparvez profile image
Sal Parvez | ML Systems RI •

The second bug is the one I'd carry around. A way down with no way back up is how temporary things become permanent on a job site too: the temp power gets hooked up for a good reason, nobody is assigned to take it down, and it runs until someone notices the bill. Tying every fallback to a named condition for coming back is the fix, and you found it the hard way. The redaction turning an IP into [IP_ADDRESS] inside an SSH command is its own warning. Posting the canary's log lines as they were made this easy to follow.

Collapse
 
userxnom profile image
Abdullah Naseer •

The PII-redaction twist is the part I'd steal — three vendors failing identically should have screamed "the probe is broken", not "the models are down". One thing I'd add: your "probe with something boring" lesson points at a probe that can't be redacted at all, like a math question through a calculator tool — no names, no addresses, nothing a filter can rewrite, and it still proves tool calling works. On the guard you mention at the end — if the whole ladder fails the same way, does the canary now alert instead of silently reverting, or is that still on the to-do list?

Collapse
 
iam-tech profile image
Christian Anderson •

That math-through-a-calculator idea is cleaner than anything I've got in there, a question nobody's privacy filter would touch and it still proves the full tool-calling path. On the guard, it's still on the list, not in the code. The fix that went in was the flag, not the alert, so the same silent revert could happen again and I'd find out the same way.

Collapse
 
iictp profile image
IICTP •

The probe-with-something-boring lesson is the one I'd steal first — a city name looked harmless until a privacy filter turned it into [ADDRESS], and three vendors failing identically should have pointed at the probe rather than the models. The "healthy and idle needs to look different from healthy and busy" line lands too: 134 runs of "nothing to watch" while four agents sat on the local model is the monitor reporting success by not looking. Did you end up adding the guard you mention — treating a whole-ladder failure with the same error as a probe problem rather than a model problem?

Collapse
 
dafili profile image
Renhua Wei •

Mine went green for a dumber reason: the exit code I was reading belonged to the last stage of a pipe. intercept_check.py | tail handed me 0 for weeks, which is why an exit 4 (fetch failed) and an exit 0 (nothing new) looked like the same result — ${PIPESTATUS[0]}, or write the log and read it afterwards, and those two stop being twins. The same checker only failed loudly when every article was unreadable (len(failed) >= len(watched)), so 9 of 10 failing printed one line and returned 0: green meant "nothing was fully blind", which is a much weaker claim than the board was making.

Collapse
 
ascendra_ventures_92c21f2 profile image
Ascendra Ventures •

The part I keep thinking about is that the failover worked perfectly and that was the problem. Everything said fine for 17 days because the system had only ever been asked one question, "is the primary down?", and never the second one, "are we still running degraded when we should not be?" Nova Ops' point about three vendors failing the same way in seconds being one broken probe, not three outages, is the cleanest diagnosis in the thread.

When Ascendra Ventures answered an international airport's tender for a generative AI platform, the premise we wrote down was that passenger-facing AI is an uptime business first. The design treated failover as part of the platform: geographic redundancy, automated failover, auto-scaling for passenger peaks, and Prometheus and Grafana alerting, with critical incidents answered in 30 minutes and resolved within an hour. Your post is a good reminder that a design like that also needs a way to notice when the fallback has quietly become the normal state.

Do you now alert on time spent on the local model as its own signal, separate from the canary result?

Collapse
 
kartik-nvjk profile image
Kartik N V J K •

What gets me is that the canary ran 134 times and exited 0 while four agents sat on the local model for 17 days, so the only thing reporting on the failover was the script that caused it. I'd have each agent record which model actually answered its run, because that would have shown qwen3.5-64k the whole time no matter what the canary believed.

Collapse
 
iam-tech profile image
Christian Anderson •

That's exactly right and probably the most useful thing you could build on top of the canary. Funny thing is I had tried something similar earlier by reading an agent's config to guess the primary, but that just added another blind spot since moving one agent broke the detection for everything else. What fixed it in the end wasn't a clever monitoring pass, it was the flag I mentioned, though that wouldn't have surfaced the full scale either.

Collapse
 
the_daily_flare profile image
The daily flare •

I had not thought about a privacy filter breaking a probe, and I will check my own fallbacks for that now.