What the Heck Is a Model Ladder? And Why Do I Need to Use One?

June 11, 2026 · Andrew Schwabe

Originally published on HackerNoon

What the Heck Is a Model Ladder? And Why Do I Need to Use One?
A pattern for building intelligent systems on top of open-source models that sometimes aren't there.

Last week one of my agents 404'd on one of our team members.

Not a bug in the code. Not a bad prompt. The endpoint was there, the API key was good, the request was well-formed. The model just, wasn't pulled on that node. Somebody had recycled the box, the Ollama cache got nuked, and qwen2.5:14b was no longer at home when my app came knocking. The whole call chain failed because one link assumed a model that had quietly walked off.

Here's the uncomfortable truth about building on open-source local models: they are fantastic and they are fragile. You're not paying for them, which means you're not paying anyone to keep them warm. Disk fills up. A teammate runs ollama rm to make space for the new hotness. The node gets re-imaged. The model name changes between point releases. You inherit a kind of soft, ambient unreliability that you never had when you were paying OpenAI $0.03 a thousand tokens to make somebody else's problem go away.

That's not a model problem. That's an availability problem.

And the fix for availability problems is older than AI itself. We just have to remember to apply it.

Why Local First, Anyway

Quick refresher on why I'm not just routing everything to a frontier model and calling it done.

I run my inference through LLMesh, a distributed inference broker that turns whatever machines I happen to have into one logical endpoint. The app points at one URL; LLMesh figures out which node has which model and routes the request. Privacy by architecture: prompts and outputs never leave my perimeter, zero third-party API calls, no token bills. SOHO-friendly, perimeter-managed, exactly the posture I want.

For roughly 80% of the small agentic tasks I run, classification, summarization, “is this commit message sensible,” routine ledger Q&A, an 8B or 14B local model is more than enough. Cheaper, faster, private, mine.

The problem isn't the small model. The problem is what happens when the small model isn't there.

Enter: The Model Ladder

A model ladder is exactly what it sounds like. An ordered list of models, from “the one I'd prefer to use” down to “the one I'm willing to fall back to.” When the call fails, model missing, endpoint dead, timeout, garbage response, you walk one rung down and try again. You stop when something works, or you run out of ladder.

Here's the shape of it:

  • Preferred: try qwen2.5:14b (local)
  • On failure, try llama3.1:8b (cheaper local)
  • On failure, try mistral-small (neighbor/peer node)
  • On failure, try claude-haiku (paid, last resort)
  • On failure, raise an error

That's it. That's the whole pattern.

The interesting part isn't the ladder. The interesting part is the decisions the ladder forces you to make.

The Four Decisions

  • Which calls deserve a ladder. Not all of them. A background reindex job that runs nightly can just retry on the next cron tick, that's a schedule, not a ladder. The ladder is for the interactive path. The user typed a question. The agent is mid-plan. Somebody is waiting. Those are the calls that can't fail silently and can't wait twelve hours.
  • What “fail” means. Network 5xx is obvious. Timeout is obvious. But a model that returns something, confidently, fluently, structurally wrong, is the hardest failure to detect. Schema validation, JSON parse, “did the response contain the field I needed”, those are your real failure signals. The HTTP 200 lies.
  • Where the rungs come from. Hardcoded list in code is the wrong answer. Config is the right answer. You want operators to add and reorder rungs without redeploying. Different ladders for different jobs, @chat-fast, @chat-premium, @code-review. The code references the ladder by name; the ladder's contents are operational concern, not source-code concern.
  • When you stop. Falling back forever to “whatever works” hides real problems. Falling back to a frontier model on every call burns money and quietly leaks the privacy story you started with. So the bottom rung deserves a different log level than the top one. When you land on rung four, somebody should know.

The Simplest Possible Implementation

Here's the smallest thing that does the job. No framework, no decorator magic, just a function and a list.

  • class ModelLadderError(RuntimeError):
  • """Raised when every rung in the ladder has failed."""
  • def call_with_ladder(rungs, do_call, validate):
  • """
  • Walk the ladder. Return the first successful, validated response.
  • Raise ModelLadderError if we run out of rungs.
  • do_call is the thing that actually talks to the model.
  • validate is the thing that decides "did we actually get a real answer."
  • """
  • last_error = None
  • for i, rung in enumerate(rungs):
  • try:
  • response = do_call(rung)
  • if not validate(response):
  • log.warning(
  • "ladder rung %d (%s) returned an invalid response, falling through",
  • i, rung.model,
  • )
  • continue
  • if i > 0:
  • # We fell through. Operators want to know.
  • log.warning(
  • "ladder fell through to rung %d (%s, tier=%s)",
  • i, rung.model, rung.tier,
  • )
  • return response
  • except Exception as e: # network, timeout, 5xx, missing model, all caught
  • log.info("ladder rung %d (%s) failed: %s", i, rung.model, e)
  • last_error = e
  • continue
  • raise ModelLadderError(
  • f"every rung exhausted; last error was: {last_error!r}"
  • )

And a ladder configured the way you'd actually configure one:

  • ladders = {
  • "@chat-fast": [
  • Rung("qwen2.5:14b", "http://llmesh.local:8000/v1", tier="local"),
  • Rung("llama3.1:8b", "http://llmesh.local:8000/v1", tier="local"),
  • Rung("mistral-small", "http://peer.llmesh.local:8000/v1", tier="peer"),
  • Rung("claude-haiku-4-5", "https://api.anthropic.com/v1", tier="paid"),
  • ],
  • }
  • def is_valid(response) -> bool:
  • # Whatever "valid" means for *this* call. Has content?
  • # Parses as JSON? Matches an expected schema? Don't accept HTTP 200 as proof of life.
  • return bool(response.get("content"))
  • answer = call_with_ladder(
  • rungs=ladders["@chat-fast"],
  • do_call=my_openai_compat_call,
  • validate=is_valid,
  • )

A hundred lines including the breathing room. That's it.

What This Is Not

This isn't a load balancer. A load balancer assumes all the backends are interchangeable; a ladder assumes they're ranked. You're not spreading load, you're preserving preference.

It's also not retry logic. Retry assumes the same thing will work if you ask again. The ladder assumes the same thing won't work and you need a different thing.

And it isn't a router. Routers pick the right model up front. Ladders pick the next one down when the first one didn't show up.

That's the part that matters. The ladder is what makes “I prefer local” survive contact with “local just disappeared.”

The Part Nobody Tells You

Once you have ladders, you'll discover something slightly uncomfortable: a lot of your “AI features” were quietly running on rung two or three for weeks and you didn't notice. The frontier rung was silently catching every failure. Your local inference story was aspirational. Your cost graph was lying to you about why it was flat.

That's the part that should make your stomach drop a little.

The fix isn't to remove the bottom rung. The fix is to watch the ladder. Log every fall-through. Alert when fall-through rate crosses a threshold. Treat “we landed on rung three” as an operational signal, not just a graceful degradation. The whole point of the ladder is that it makes the drift visible. Use it.

Why I'm Writing This Down

We just shipped model ladders into QCoda. It's the kind of feature that looks small in the changelog and turns out to be load-bearing the first time an agent has to handle a real production wobble. I built it because I watched my own agents 404 on a model that wasn't there and I got tired of writing one-off try/except blocks every time I wanted resilience.

But the reason I'm putting it on HackerNoon instead of just merging it and moving on: we're trying to figure out, in public, what AI engineering governance actually looks like in practice. Not the press-release version. The “here's the pattern, here's the code, here's the part we got wrong” version. Ladders are one of those patterns. There will be more.

If you're building on local models, and I think more of us should be, write your ladders. Validate the responses, not just the HTTP codes. Log the fall-throughs. Look at the logs.

Go check yours. You might be on rung three already.

Andrew Schwabe is a serial entrepreneur, AI researcher, musician, father, and tinkerer. He founded ForMotiv and Saigon A.I. and has been featured in Forbes.