Researchers published the Agent-as-a-Router framework and its concrete implementation, ACRouter, on July 13, 2026. This open-source AI model routing system replaces static prompt classification with a learning loop that builds execution history and dynamically assigns the cheapest capable model to each task. In benchmarks, ACRouter achieved a cost of $13.21 on the full test set compared to $34.02 for an always-use-Opus strategy — a 2.6x savings without quality loss.
Key takeaways
- ACRouter cost $13.21 on the full test set vs. $34.02 for Opus-only — 2.6x savings
- C-A-F (Context-Action-Feedback) loop replaces static classifiers — the router learns from every execution outcome
- Orchestrator is based on Qwen 3.5 (0.8B parameters) — lightweight and self-hostable
- Tested on ~10,000 tasks across 8 models (Claude Opus 4.6, GPT-5.4, Qwen3-Max, GLM-5 and others)
- Code and router weights available on GitHub and Hugging Face under Apache 2.0 license
The AI model routing problem
In production AI environments, no single model dominates every task category. Engineers have long tried to map tasks to cheaper open models where possible, reserving expensive frontier models for complex reasoning. In practice, two approaches are used: heuristic rules (if the prompt contains certain keywords, route to model X) and static classifiers trained on historical data.
Both share a common flaw: they are static. When task distribution shifts or a new model enters the pool, the classifier does not know the old routing has become suboptimal. The researchers call this an information deficit — the router evaluates only the input prompt, never seeing whether the model actually succeeded.
Agent-as-a-Router: the C-A-F loop
The Agent-as-a-Router framework addresses the information deficit through the C-A-F loop. When a new prompt arrives, the router checks its vector memory for similar past tasks and selects a model based on those results. After execution, the system observes the outcome (SQL compiled or not, code passed tests or not) and writes that feedback back to memory. The next similar prompt will be routed to the model that succeeded on analogous tasks in the past.
ACRouter, the concrete implementation, has three components: an Orchestrator (model selection based on memory context), a Verifier (outcome evaluation — success or failure), and Memory (a vector store). A tool layer connects the Verifier to a real execution environment — a Python interpreter, database engine, or agentic sandbox — so the feedback signal comes from actual execution, not from LLM self-assessment.
The Orchestrator itself is a lightweight Qwen 3.5 model with 0.8 billion parameters, fine-tuned with a LoRA?LoRA: Low-Rank Adaptation — a cheap fine-tuning method that trains small added matrices instead of all the model's weights. adapter. It can run locally without sending prompts to a cloud API. This is a deliberate design choice: a heavy model as the router would undermine the economics of the entire system.
Benchmarks: no single model dominates
The researchers built CodeRouterBench — a set of ~10,000 tasks with verified scores across 8 frontier models. Baseline results show the scale of the problem: Claude Opus 4.6 achieves the highest average performance, but loses to GLM-5 in algorithm design (86% relative improvement for GLM-5) and to Qwen3-Max in test generation (111% improvement). Opus costs roughly 12 times more than cheaper models like Kimi-K2.5.
| Model | Strength |
|---|---|
| Claude Opus 4.6 | highest average performance |
| GLM-5 | algorithm design (+86% vs Opus) |
| Qwen3-Max | test generation (+111% vs Opus) |
| Kimi-K2.5 | lowest cost (~12× cheaper than Opus) |
ACRouter consistently achieved lower cumulative regret?Cumulative regret: A measure of total loss versus always picking the best option — the lower it is, the more often the router chose the optimal model. than static routers and the Opus-only strategy — on both in-distribution tasks and harder agentic out-of-distribution tasks requiring multi-step planning and iterative debugging. On the in-distribution set, ACRouter cost $13.21 vs. $34.02 for Opus-only. On OOD tasks, the advantage was comparable while achieving better accuracy than static routers.
When ACRouter does not make sense
The researchers explicitly outline their system's limitations. The framework excels at verifiable tasks — code, SQL, database queries — where the Verifier receives an unambiguous signal. For subjective tasks like creative writing or style evaluation, feedback signals cannot be standardized. ACRouter is also engineering overkill for simple applications with low query volumes where cost differences are negligible.
Why this matters
Model routing is becoming a critical layer in the enterprise AI stack. When companies simultaneously operate across multiple models — open-source, closed, specialized — the decision of which model handles a given query directly impacts margins and latency.
Until now, routers were blind to outcomes: they picked a model at input time, never learning from output. ACRouter introduces a mechanism analogous to reinforcement learning at the router level — but without the cost of training a policy from scratch. Every production session simultaneously generates training data.
For AI practitioners, this is a qualitative shift: model infrastructure stops being a static configuration and becomes a self-improving system. The router weights are publicly available, enabling adaptation to custom environments without paying for a third-party routing API.
What's next
- Code and Orchestrator model weights are available on GitHub (https://github.com/LanceZPF/agent-as-a-router) and Hugging Face under Apache 2.0 — adaptable to custom model pools
- CodeRouterBench covers ~10,000 tasks across 8 models — researchers plan to expand with new agentic task categories
- Integration with Claude Code, Codex, and OpenCode is already supported by the tool layer





