Your most expensive AI model shouldn’t touch most of your task. That sounds reckless, and in a workshop it would be the same as sending your master craftsman to sand the workbench while an apprentice waits to help on the joinery nobody else can do. Yet two controlled experiments just made the same argument with numbers: when a routing engine assigns the right capability to each stage of a long task, whole-task costs fell by more than 90% with quality intact.
The case study connected GPT-6 Astra and Qwen-3.8 Flash through one HiRoute routing plan and put them to work on an engineering assignment spanning technical research and architecture review. In two runs meeting the same whole-delivery acceptance standard, the mixed setup cost 92.01% and 91.39% less than all-Astra execution.
A separate coding task, lasting about 32 minutes, showed the other side of the bargain. When the economy model kept researching without moving into implementation, HiRoute automatically upgraded the model at a context handoff. Development continued, and the result passed 343 independent checks. Nobody added a prompt or manually switched models during the task.
Both cases illustrate the same idea: a long-running task benefits from the right capability at each stage.
The Foreman Between Your Agent and Its Models
HiRoute is an open-source routing engine that runs locally between your existing agent and model services, designed for long-running tasks. You keep asking coding agents such as Codex, Claude Code, Qoder, DeepSeek Harness, and Pi to do the work. The agent still reads files, writes code, and runs tests. HiRoute, like a workshop foreman, decides which model handles each stretch of work.
It also provides smart task routing: the main agent can choose a suitable execution agent through a published routing plan, delegate independent research, implementation, or testing work, and use the returned result to continue the overall task. Task routing assigns the executor; model routing chooses the model for each stage. They work independently or together the two case studies below focus on model routing.
In practice, you connect your models, create a routing plan, and point the agent at it. The agent uses one stable model alias while the models behind that alias change with the task. The Sessions page shows which model actually ran, token usage, and assessments of earlier stages.
This fits the rhythm of real software work: research, design, implementation, testing, and deeper investigation when something breaks. Organizing documented facts and deriving a new system guarantee demand different capabilities. Once the hard problem is solved, every remaining step may not need the most expensive model and the foreman knows it.
Reserve Astra for Critical Decisions and Cut Whole-Task Cost by 90%
The first case used a messaging-system design review to represent a familiar workflow: research six candidate technologies, verify the official documentation, organize the comparison, and deliver a memo on a critical design decision.
That final decision asks a practical question: if the system fails midway and retries, how do you avoid processing the same business event twice or missing it entirely? Finding “supports transactions” in the documentation isn’t enough. The model must determine whether the pieces together meet the business requirement.
The structure is widely familiar: a substantial amount of research supports a small number of critical judgments. Technology selection starts with feature comparisons and ends with a choice under real constraints. Migrations start with an inventory of differences and lead to decisions about risk and rollback. Every step needs care, but not every step needs the master craftsman.
Three modes got the same task, source material, and delivery requirements:
| Mode | Actual division of work |
|---|---|
| All Astra | Astra handles research and the decision memo |
| HiRoute mixed | Qwen handles six research deliverables; Astra handles the critical decision memo |
| All Qwen | Qwen handles research and the decision memo |
Lower Cost, With the Critical Judgment Intact
Across the two runs where both modes passed the original whole-delivery gate, average research-check accuracy was 99.03% for HiRoute mixed and 99.72% for all Astra. Both passed the critical decision review. Whole-task cost fell by 91.39%–92.01% roughly one twelfth the cost of all-Astra at the same acceptance standard.
The three critical decision reviews show where the real capability gap lives:
| Mode | Critical decisions without major errors |
|---|---|
| HiRoute mixed | 3/3 |
| All Astra | 3/3 |
| All Qwen | 1/3 |
Qwen’s research work was quite accurate. The gap appeared in the final judgment: two recommendations treated a guarantee within one component as a guarantee for the whole design. Those recommendations sound complete, but they can lead to the wrong architecture decision. The mixed setup spent Astra’s reasoning exactly there on the judgment without making Astra do all the research. Savings came from allocating the work; quality came from matching the critical judgment to sufficient capability.
The cost comparison uses the two of three primary runs where both modes met the original delivery standard, and includes all subject attempts and routing evaluation at API-equivalent prices. The experiment record retains every outcome and the acceptance criteria. “Same quality” means meeting the same delivery standard.
The mixed-model plan itself is a three-step setup: connect your model services on the Models page, manage each connection once and reuse it across plans; create a Smart Saving plan with Qwen in the Economy group and Astra in the Primary group, using xhigh and medium reasoning settings in this case; and enable the plan in your existing workflow. For Codex, open Model routing on the Agent page, select the plan, and copy the launch command. The Sessions page then lets you inspect actual models and usage request by request.
Three Automatic Handoffs Complete a Task Without Intervention
The second case focused on sustained delivery: adding synchronous and asynchronous JSON stream iteration to HTTPX, supporting several JSON stream formats, handling encoding and consumption state, and yielding parsed values before the rest of the data arrived. Native Codex got one task instruction and was left alone.
Reassess at Context Handoffs
A lower model price doesn’t automatically mean a cheaper completed task. If the economy model repeatedly heads in the wrong direction, the stronger model may have to reconstruct context, investigate mistakes, and redo the implementation rework that eats the savings. So HiRoute weighs two questions: “How demanding is the next stage?” and, when routing is reconsidered, “How well did the previous stage go?” Task complexity identifies opportunities to save; stage competence helps determine whether continuing to save is still sensible.
This matters especially in long tasks. As an agent accumulates context, it compresses history and continues from a summary. HiRoute detects continuity between requests and can reconsider the model at these context handoffs. Ordinary tool continuations retain the current route, keeping a stretch of execution stable. “Let a stronger model take over” becomes part of the execution process no person required, watching for the moment to intervene.
Three Handoffs, Then 343 Passing Independent Checks
HiRoute started with the economy model and used a stage-competence floor of 0.5. The actual sequence was Qwen → Astra → Qwen → Astra, with three automatic model changes:
- First upgrade prepare the context handoff. After Qwen read source and tests, the preceding stage scored 0.41, below the floor. HiRoute selected Astra to handle the pending context-summary request and prepare the handoff.
- Return to Qwen allocate work using stage feedback. The summary stage scored above the floor, so under the economy-first policy Qwen got another opportunity. A subsequent reassessment also retained Qwen.
- Upgrade again turn investigation into implementation. At the second context handoff the stage scored 0.485, again below the floor. Astra wrote the JSON streaming implementation, ran tests, and repaired asynchronous iterator closure, encoding and type-checking issues to complete the delivery.
| This long-running task | Result |
|---|---|
| Start to finish | 31 minutes 36 seconds |
| Automatic model changes | 3: two upgrades and one return to the economy model |
| Intermediate human prompts / human code patches | 0 / 0 |
| Astra tool calls after the key upgrade | 13 |
| Independent checks after execution | 108 feature + 229 regression + 6 incrementality checks, all passing |
Start economically, reassess at handoffs, upgrade when progress is insufficient, then let the stronger model finish implementation and validation. The user could simply focus on the deliverable.
Inspection is built in. A session’s Model performance view shows the actual model, reasoning setting, stage competence and execution turns, with execution evidence and assessment details openable per stage. A routing plan’s Model performance tab offers the broader view model configurations per execution group, average stage competence, and counts of scored and unrated stages across a selected plan version and time range, so you can judge which combination fits your tasks.
Enterprise Gateway Experience, Lightweight Local Execution
HiRoute brings enterprise AI gateway capabilities developed through Higress AI Gateway to the developer’s machine, with a lightweight local gateway core built in Rust. Desktop and CLI share the same local service for model connections, routing, failover and session observation. The engine, configuration management and observation records run locally; agent model requests enter the local Gateway, which routes them to connected cloud or local model services that perform the inference. No additional HiRoute cloud relay to deploy. The project code is fully open source under Apache 2.0, and the visual Desktop app and headless CLI share the same core interactive use and automated workflows both covered.
Start With Your Own Agent
The tasks, evaluation results, and reproduction instructions for both cases are open source in the HiRoute repository. Want to try it with your agent? Download HiRoute from the official website the macOS installer is under 100 MB. Install it, connect your existing model services, choose a routing plan, and get back to work in the agent you already use.
The skeptic’s objection here is a good one: routing overhead and a badly tuned competence floor could downgrade a model that was quietly doing fine, and the rework could erase the savings. The second case is the direct answer. A stage scoring below the floor triggered an upgrade; a stage scoring above it earned a second chance under the economy-first policy; and the whole sequence passed 343 independent checks with zero human prompts and zero code patches. The governance isn’t a luxury bolted onto the savings it’s what makes the savings real.
A master craftsman isn’t paid to sand the workbench. Neither is your best model.
Cost efficiency in AI isn’t about choosing the cheaper model it’s about knowing which moments deserve the expensive one.
