Tiered Model Orchestration: Model Selection and Cost Control for Coding Agents
When coding agents can call models at several capability tiers, treating selection as a one-time preference wastes money and ignores quality. This article explains how to route work by task complexity, treat reasoning effort as a separate control, keep sessions stable for cache reuse, and measure whether the strategy actually works.
1. The real problem: from “pick a model” to “design task assignment”
When a coding agent can use models at several capability tiers, the usual mistake is to treat selection as a one-time preference: pick the “strongest” model and send every task to it. That is convenient early on. As context grows and tasks multiply, two problems show up together. Per-task cost is pulled up by the high-capability tier, while simple tasks show no perceptible quality gain.
A better view is that a model tier is not an identity label. It is a resource pool. The engineering question shifts from “which model should I use?” to “how should I split the task flow and route it to the right pool?” Once that shift is made, cost, latency, and quality become adjustable variables instead of outcomes you simply accept.
2. Layer by task complexity, not by model
One judgment in the source material matters: projects have layers; models do not. In engineering terms, the hierarchy should live in the tasks and the codebase, not in an assumption that a given model naturally belongs to a given layer.
Useful dimensions for judging complexity:
- Change radius. A local edit in one file, a refactor across files, and an architectural change across modules differ sharply in risk and in the depth of reasoning they need.
- Constraint density. Does the change have to satisfy several constraints at once, such as interface compatibility, unchanged historical behavior, and a specific style?
- Uncertainty. Is the requirement clear? Do several options need to be weighed? Does the work depend on reverse-understanding an existing implementation?
- Verifiability. Are tests or a build available as a feedback loop? Stronger feedback makes it safer to hand execution to a lower tier and converge through iteration.
That yields a three-tier assignment. The high-capability tier handles requirement clarification, design, and risk identification. The middle tier handles cross-file implementation and routine refactors. The low tier handles highly deterministic mechanical work: formatting, boilerplate, comment completion, and test skeletons.
3. Treat reasoning effort as its own knob
A fact that is easy to miss: model tier and reasoning budget are orthogonal. At the same tier, a low budget fits retrieval-style, patterned tasks; a high budget fits tasks that need long chains of reasoning and self-checks. Mixing the two produces hidden waste: high budget spent on simple work.
In practice, fix the tier first, then adjust the budget. Use a low tier plus a low budget for simple tasks. For work that demands completeness and correctness, raise the budget instead of blindly changing tiers. That leaves more room to tune, and it makes the source of a problem easier to locate.
4. Session stability and cache reuse
A typical pain point with long context is that output quality decays as the conversation grows, while the repeatedly billed portion expands quickly. Many implementations reuse a cache for a stable prefix, and that cache is usually keyed by session context.
The engineering conclusion follows: keep the model tier unchanged within a session so the prefix cache keeps hitting. Switching tiers often means rebuilding context. The cost of a cache miss can far exceed the price gap between tiers. Switches should happen at session boundaries, not in the middle of a session.
A sketch of session and routing policy:
session = open_session(model=T3, effort=low)plan = session.run("map module boundaries and the change list") # high tier + higher budgetfor task in split(plan):if task.uncertainty == high:session.run(task, effort=high) # same tier, higher budgetelse:dispatch_to(T1, task) # sink mechanical work
5. Orchestration: let the high-capability tier plan
A more mature pattern puts the high-capability tier on decomposition and acceptance, and sinks execution. It understands codebase structure, splits work into subtasks that can be verified on their own, and defines acceptance criteria for each. Middle and low tiers run those subtasks in parallel or in sequence. The planner then reviews the integration.
This works only if three conditions hold: subtask boundaries are clear, acceptance can be judged automatically or semi-automatically, and the integration stage has regression checks. Miss any one of them and sunk execution amplifies rework. Start with a low-risk module and raise the share of sunk work gradually.
6. Permissions, observability, and metrics
Loosening permissions cuts interaction interruptions, but it has to be paired with rollback: a clean version-controlled workspace, a disposable branch, automated tests, and static checks. Opening permissions without a way to roll back widens the risk exposure.
Track at least four metrics: cost per task, first-pass success rate, rework rounds, and human interventions. Cost alone sacrifices quality. Pass rate alone hides waste. Read together, the four show whether the tiering strategy is actually working.
7. Common mistakes
- Parking every task on the high-capability tier and buying peace of mind with budget.
- Switching tiers often inside a session and ignoring the hidden cost of cache misses.
- Sinking execution without acceptance criteria, so rework piles up at integration.
- Using model tier as a substitute for task layering, and assuming some model “naturally belongs at the bottom.”
8. Summary
The right use of multi-tier models is not “always pick the strongest.” It is a routing and budget policy: layer tasks by change radius, constraint density, uncertainty, and verifiability; set the tier before tuning the budget; stay stable inside a session so caches can be reused; let the high-capability tier decompose and accept work, and sink deterministic execution. In practice, that policy can live in a few dozen lines of routing code plus the four metrics above, and it can be retuned as the project evolves.
