We run our company on AI agents and pipelines. They research, build lead lists, draft pitches, write code and send reports. For the first few weeks, every one of those jobs went to the largest model available, because it was the default and it always worked.
Then we looked at what the work was. A large share of it was simple. Fetch a page. Append rows to a sheet. Sort and de-duplicate a list. Write a three-line summary of findings that were already complete. We were paying the highest rate for tasks that needed no deep reasoning at all.
So we built a router. This post explains how it works, where it can go wrong, and how the same idea applies to any company with an AI bill.
The idea in one paragraph
AI providers sell models in sizes. The small one is fast and cheap. The large one is slower, costs several times more, and is better at open-ended reasoning. For a hard problem the large model is worth every cent. For an easy one, the small model gives the same answer. Routing means deciding, task by task, which size is needed, and making that decision cheaply enough that it does not eat the saving.
Step one: split the task
Real requests are rarely one kind of work. Take a typical one of ours: find the search volume for a set of keywords, work out which are worth targeting, and write up a recommendation. Getting the numbers is a lookup. Choosing between them is analysis. Writing the report from finished findings is formatting. If the whole thing goes to one model, it has to be the model that can handle the hardest part, and the easy parts ride along at the top rate.
The router's first job is to break a request into two or three subtasks, with five as a ceiling. Each subtask has to pass three tests:
- It can be done by an agent that has not seen the original conversation.
- It names its inputs and says exactly what should come back.
- It is one kind of work. Fetching data and deciding strategy do not go in the same subtask.
The third test is the one that makes routing pay. Mixed subtasks have to be routed by their hardest part, which puts you back where you started.
Step two: score the difficulty
Each subtask is then described to a small judgement model. This is a compact model whose only job is to answer questions with a score. It is far cheaper to call than even the small general-purpose model, which matters, because a router that costs as much as it saves is pointless.
The judgement model returns three numbers for each subtask. The first is difficulty, on a scale from 0 to 3. The second is how confident it is in that score. The third is risk: how much it matters if the answer is wrong, with outward-facing work scoring highest.
The difficulty score maps to a model size. The scale was written from the kinds of task we do every day:
- Low scores go to the small model. Tool and API calls, lookups, sorting, small edits, short summaries or emails written from finished findings.
- Middle scores go to the mid-size model. Interpreting data, naming and copywriting, long articles, designed pages, focused research, code changes across several files.
- High scores go to the large model. Open-ended research across many sources, strategy, ranking options with market arithmetic, designing systems, hard debugging, complete builds.
Two overrides sit on top of the score. If confidence is low, the subtask moves up one size, because a cheap wrong answer costs more than an expensive right one. And if the risk score is high, meaning the result will be seen by someone outside the company, the subtask never goes to the smallest model.
Step three: check the cheap answers
Routing on its own is a bet. Sometimes a task that looked easy is not. So every answer from the small or mid-size model that feeds the final result goes through a quality check. The judgement model is shown the subtask and the answer and asked one question: does this do what was asked?
If the check fails, the subtask is rerun once on the next model up, with a note saying what was missing. If it fails again, the coordinator, which is the large model that split the task in the first place, finishes it. There is exactly one escalation. We do not loop, because loops are where costs hide.
Some outputs skip the check. A plain data fetch, where you can see that the rows came back, does not need a second opinion. Very long documents are checked a section at a time, since a small judge scores long inputs less reliably than short ones.
What went wrong while tuning it
The first version of the scale was too abstract. It described difficulty in general terms, and the judgement model scored almost everything in the middle. The fix was to rewrite each level using concrete examples of our own past tasks. Scores spread out once the levels sounded like real work.
The quality check had its own problem. It marked good answers as failures when they contained sample data or template variables, because those looked like unfinished placeholders. We reworded the check so that labelled samples and deliberate variables do not count against an answer.
We tune against two sets of past tasks, each labelled with the model that should have handled it. One set is used to adjust the wording. The other is held back and only used to confirm the change worked on tasks the tuning never saw. When the router gets one wrong, we fix it by rewording the level that should have caught it. We do not shift a threshold to fit a single example, because that breaks three other cases you are not looking at.
The errors that remain lean in the safe direction. The router sometimes sends a small task to the mid-size model. That costs a little. Sending a hard task to the small model would cost a wrong answer, so we would rather err this way.
Where routing does not help
Routing is not free of trade-offs. Splitting a task has overhead: each subtask needs a complete brief, because the agent that picks it up starts cold. For a small job, writing the brief can cost more than doing the work directly. The router has a rule for this. If a subtask is small enough that the brief costs more than the task, the coordinator does it itself.
Work that depends on a long conversation also routes badly. If the context cannot be written down in a brief, the task stays with the model that has the context. And a workload made up entirely of hard reasoning has nothing to route. The saving comes from the mix.
What this means if you pay an AI bill
Most business AI workloads are mixed. A support assistant handles a hundred simple questions for every hard one. A document pipeline spends most of its calls on extraction and only a few on judgement. If all of that goes to one large model, a share of the bill is buying capability nobody is using.
You can check this without building anything. Export a week of your AI usage and sort the requests into three piles: lookups and formatting, interpretation and writing, and open-ended reasoning. If the first pile is large and it is running on your most expensive model, there is a saving to be had.
The practical version for a company usually has three parts. A scoring step in front of your AI calls. Two or three model sizes behind it. A quality check on the cheap answers with one escalation. We set this up as part of our AI integration in operations service, starting with an audit of where your spend goes, and the full description of our own tool is on the Model Router page.
The lesson we would pass on is that the largest model is rarely the wrong choice for quality, and it is often the wrong choice for cost. Deciding per task takes a little engineering. After that, it runs on every request you make.
Written by the Bronxo Tech team.