Most engineering teams treating frontier models as their default compute layer for agentic workloads are not making a deliberate architectural choice. They are making an implicit one, and the cost implications compound quickly at scale. As agentic pipelines mature from proof-of-concept to production, the decision of which model handles which task at which point in a session becomes as consequential as any other infrastructure decision. This article makes the case that intelligent model routing is now a core engineering competency, examines how leading teams are structuring it in practice, and offers a framework for evaluating routing architectures against the metrics that actually matter in production.
Why Frontier-by-Default Is an Architectural Mistake
The instinct to route every agentic task through the most capable model available is understandable. It reduces decision complexity, simplifies prompt engineering, and provides a ceiling of output quality that teams can reason about. The problem is that it treats model selection as a fixed input rather than a variable one.
Agentic workloads are not homogeneous. A single coding session might involve repository indexing, test generation, docstring writing, multi-file refactoring, and security review. These tasks have meaningfully different capability requirements. Running all of them through a frontier model because one or two of them genuinely need it is the inference equivalent of routing every database query through your most expensive read replica.
At low task volumes, this inefficiency is tolerable. At scale, across tens of thousands of agentic sessions per month, the cost structure becomes a strategic liability rather than a technical inconvenience.
The Dual-Agent Architecture: Cognition's Approach as a Reference Model
Cognition's publicly described architecture for their Devin agent offers a concrete example of how production teams are beginning to address this problem. Rather than routing all tasks through a single frontier model, Cognition introduced a sidekick model that runs in parallel with the primary agent. The sidekick handles lower-complexity tasks such as context tracking, state summarisation, and routine code generation, while the primary frontier model is reserved for tasks that require deeper reasoning.
This dual-agent structure does more than reduce cost. It changes the latency profile of the system. When a cheaper, faster model handles the high-frequency, lower-stakes work, the primary model's compute budget is concentrated on the decisions where quality actually differentiates outcomes.
The architectural implication for engineering teams is that the routing layer itself becomes a first-class system component. It requires its own design, its own evaluation criteria, and its own maintenance burden. Teams that treat it as a configuration detail rather than an engineering surface tend to find that it degrades silently as task distributions shift over time.
Building a Routing Layer That Holds in Production
Task Classification as the Routing Signal
Effective routing depends on classifying tasks accurately before dispatching them. The classification signal can be derived from several sources: the structural complexity of the prompt, the presence of multi-file or multi-step dependencies, the output format required, and the error tolerance of the downstream consumer. A docstring generation task and a cross-service refactoring task are not the same class of problem, and a routing layer that cannot distinguish between them will either over-spend on simple tasks or under-resource complex ones.
Classification models for routing do not need to be sophisticated. A lightweight classifier trained on historical task logs, labelled by output quality and model tier, can achieve sufficient accuracy to produce meaningful cost reductions. The key is that the classifier is evaluated on routing precision, not on the quality of the downstream output in isolation.
Dynamic Mid-Session Routing
Static routing, where a task type is always assigned to a fixed model tier, handles predictable workloads reasonably well. Agentic sessions are rarely predictable. A task that begins as a simple bug fix may expand mid-session into a broader architectural investigation as the agent gathers context. A routing layer that cannot escalate mid-session will either cap quality at the wrong moment or require a full session restart.
Dynamic routing addresses this by monitoring session state and re-evaluating model assignment as the task scope evolves. This requires the routing harness to maintain a representation of task complexity that updates continuously, not just at session initialisation. The engineering overhead is real, but the alternative is a system that either wastes compute on simple tasks or fails to escalate when complexity demands it.
Evaluating Routing Quality Against Real-World Benchmarks
The most common mistake in routing evaluation is using synthetic leaderboard scores as a proxy for routing quality. Benchmark performance measures model capability in isolation. Routing quality measures whether the right model is being selected for the right task in the context of a live pipeline.
A more reliable evaluation approach is to instrument the routing layer against production task logs and measure output quality degradation as a function of model downgrade decisions. If routing a class of tasks from a frontier model to a cost-effective alternative produces no measurable quality drop on your specific workload, that is a routing decision you can make with confidence. If it produces a detectable degradation, the routing threshold needs adjustment.
The evaluation cadence matters as much as the methodology. Task distributions shift as codebases evolve and agent capabilities change. A routing configuration that was well-calibrated at deployment can drift out of alignment within weeks if it is not re-evaluated against current production data.
What Engineering Leaders Should Prioritise
The sequencing of routing investment matters. Teams early in their agentic deployment should focus first on building the instrumentation layer that makes routing decisions observable. Without visibility into which tasks are consuming which model tier and what the output quality looks like by task class, there is no empirical basis for routing decisions.
Once instrumentation is in place, the next priority is defining the task taxonomy that will drive classification. This is a product and engineering decision jointly, because the boundaries between task classes need to reflect both technical capability differences and business quality thresholds. A routing boundary that engineering defines without input from the teams consuming agent output will optimise for cost in ways that create quality problems downstream.
The final layer is the feedback loop. Routing systems that do not incorporate outcome signals from downstream consumers will optimise against a static proxy. Building a lightweight mechanism for quality signals to flow back into the routing classifier is what separates a routing layer that improves over time from one that simply holds its initial configuration.
Companion piece to our broader work on production multi-agent design. See From Event Triage to Autonomous Remediation: What Telecom's Agentic Architecture Reveals About Production Multi-Agent Design for a detailed examination of how specialised agent pipelines handle task decomposition and guardrail enforcement in high-stakes operational environments.
FAQs
Start with your production task logs rather than intuition. Tasks that are structurally simple, have well-defined output formats, and are tolerant of minor quality variation are the natural starting point. Docstring generation, test scaffolding, and context summarisation are common examples. The reliable method is to run a shadow evaluation where a cost-effective model processes the same tasks as your frontier model, then measure output divergence against your quality threshold. Where divergence is below threshold, you have a routing candidate.
A minimal routing layer at early stage does not need to be a sophisticated classifier. A rules-based dispatcher that routes tasks by prompt structure, token length, and task type label is sufficient to generate initial cost savings and, more importantly, to produce the labelled data you will need to train a more precise classifier later. The priority at this stage is instrumentation: every routing decision should be logged with the task features, the model assigned, and the downstream quality signal. That dataset is the foundation for everything that follows.
A lightweight routing classifier adds single-digit millisecond latency in most implementations. That cost is negligible relative to the inference latency of the models being routed. The more relevant latency consideration is whether your routing layer enables faster task completion by directing high-frequency, low-complexity tasks to models with lower time-to-first-token. In practice, well-designed routing tends to reduce end-to-end session latency rather than increase it, because it concentrates frontier model capacity on the tasks where it is genuinely needed.
The two most common production failure modes are classification drift and silent quality degradation. Classification drift occurs when the distribution of incoming tasks shifts away from the distribution the classifier was trained on, causing systematic misrouting. Silent quality degradation occurs when a routing decision that was acceptable at one point in the pipeline produces compounding errors downstream that are not immediately visible in per-task quality metrics. Both failure modes require active monitoring: the first through classifier performance tracking, the second through end-to-end pipeline quality measurement rather than task-level spot checks.
The evaluation should centre on three questions. First, does the harness support dynamic mid-session escalation, or does it only route at task initialisation? Second, can it be evaluated against your specific task distribution and quality thresholds, rather than only against the vendor's benchmark suite? Third, does it expose the routing decision logic in a way that your team can audit and adjust as your workload evolves? A harness that performs well on synthetic benchmarks but cannot be calibrated to your production data will optimise for the wrong objective. Build in-house when your task taxonomy is highly specific and the routing signal is proprietary to your domain.
The crossover point depends on the cost differential between your frontier and cost-effective model tiers and the proportion of your tasks that are genuinely reroutable without quality loss. As a rough framework, if more than 40 percent of your agentic tasks are structurally simple and your frontier-to-alternative cost ratio is greater than five to one, the investment in a routing layer will typically recover its engineering cost within a quarter at production volumes above a few thousand sessions per month. Below that volume, a rules-based dispatcher is sufficient and the full classifier investment can be deferred until task volume justifies it.

