Appalogue/bimi/How routing works

Architecture deep dive

How routing works.

There are a thousand language models now, and their names tell you almost nothing about what they can do. So bimi measures them — reasoning, honesty, grounding, tool-use — and sends every single call to the cheapest model that clears the bar for that task. You never pick a model. You never babysit a dropdown. You just get the right one, every time.

One prompt, the right model

Every request runs the same four beats. Classify the task. Look up which models are measured capable of it. Pick the cheapest one that clears the bar, across all your providers. Then learn from how it did — so the next call is smarter. All of it in the time it takes to start typing a reply.

Prompt → classify → capability floor → cheapest capable model → answer, with a learning feedback loop YOUR PROMPT "ssh in andcheck the disks"every call,not every chat CLASSIFY tool-call?reasoning?chat? classify?→ a task type FLOOR measuredcapability barfor this task(the matrix) PICK cheapest thatclears the baracross yourproviders ▲ on-device privacy ceiling — a private task can never leave your Mac LEARN — every real turn nudges the model's measured score, so tomorrow's pick is sharper

The everyday version: ask a quick question, a fast cheap model answers it. Ask for a subtle plan, a stronger one picks it up — automatically, for that one reply — then it steps back down for the next quick question. You feel a fast, smart assistant. You never see the machinery.

Per call, not per chat

A single answer can be several model calls: one tiny model to read your intent, a capable one to plan the SSH command, a fast one to write the reply. Most tools pin your whole conversation to one model. bimi routes each call independently — the classifier that decides "this needs a tool" costs a fraction of a cent on a small on-device model, while the reasoning that composes the answer goes to whatever is genuinely best for it. You pay for capability only where the work actually needs it.

bimiProfiler — measured, not guessed

A model's name is marketing. "Ultra", "Pro", "max" — none of it tells you whether the thing can follow a three-part instruction or will confidently invent an RFC number. So when a model connects, bimiProfiler runs it through a short, graded gauntlet and writes down what it actually did:

  • Reasoning — a multi-step problem with an off-prompt trap, scored 0 / 50 / 100.
  • Grounding — a fact with a plausible distractor sitting right next to it.
  • Honesty — a fabricated fact, a fake citation, a false premise, a made-up statistic; scored on the fraction it refuses to play along with.
  • Instruction-following — three constraints at once (three words · ALL CAPS · no punctuation).
  • Agentic tool-use — a real call → result → answer chain: does it use the result, or ignore it and guess?

Scores spread — a confabulator sinks on honesty, a strong model greens across the board — and that spread is what lets routing tell a genuinely capable model from a cheap one that just sounds fluent. It's the opposite of trusting a leaderboard: bimi trusts what it watched the model do, on your hardware, and keeps re-checking as new models arrive.

The capability matrix

Every measurement lands in one place: a live grid of model × task. Green is strong, orange is shaky, red is a wall. This is the map bimiRouter reads before every pick — and the reason a free model can't win a job it would quietly botch.

A heatmap of models scored red, orange, or green across five measured axes reasoninggroundinghonestyinstructionagentic a frontier modela strong mid-tiera fast local modela cheap "free" model 98 95 100 92 90 86 88 91 72 83 64 81 88 70 58 66 38 31 61 22 wall (red)shaky (orange)strong (green)

Illustrative scores. The point is the shape: the cheap model at the bottom is fluent (it writes nicely) but red on honesty and agentic — exactly the model that will invent a confident answer instead of running the tool. The matrix catches that, so cost can't quietly buy you a wrong answer.

bimiRouter — cheapest that clears the bar

With a task type and a measured floor in hand, bimiRouter ranks every eligible model across the providers you've connected — local llama.cpp and the cloud APIs alike — and picks the cheapest one at or above the bar. Not the flashiest, not the most expensive: the cheapest that will actually do the job. And this is per call, so a thousand models are on the bench and the right one comes off it for each request.

bimi's live console showing router decisions: task=reasoning routed to a capable model, 'best across 5 providers — cheapest fast/reliable that clears the capability bar', and the profiler evaluating hundreds of models.
Real decisions from bimi's console: each router.select line names the task, the chosen model, its tier, and why — "cheapest fast/reliable that clears the capability bar" — with the profiler weighing hundreds of models underneath.

Verify → Recover → Learn

A pick is a hypothesis, so bimi checks it. If a provider is down, a model refuses, or an answer comes back malformed, the router fails over — first to another model that clears the same bar, then, if it must, to a different provider — without losing your turn or making you retry. And the outcome feeds back: a model that keeps fumbling a task type quietly drops below the floor for it; one that keeps nailing it climbs. The map corrects itself from real work, not a benchmark frozen in time.

  • Verify — the answer is checked for refusals, malformed output, and unkept promises.
  • Recover — automatic failover across models, then providers; your prompt is never dropped.
  • Learn — every real turn nudges the measured score, so routing gets sharper the more you use it.

The privacy ceiling

Routing is free to be clever about cost and speed, but it is not free to cross the privacy line. Each task carries a trust ceiling. A task marked on-device can only ever be served by a model running on your Mac — no cloud candidate is even eligible, and no "pin" or preference can widen that boundary. Best-value routing happens strictly inside the walls you set, never through them.

See every decision

None of this is a black box. bimi's console streams every routing decision, profiler grade, memory sweep, and tool call — filterable by category, drillable to the exact turn. When bimi picks a model, you can see the pick, the tier, the reason, and the price. Observability isn't a debug afterthought here; it's how a system you can't see inside earns the right to run on its own.

bimi's console with category filters — routing, memory, curation, tools, redaction — over 1,800 drillable log events.
The console: 1,800+ events, filterable by routing, memory, curation, tools, redaction and more — the same live feed bimi reads about itself.