Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 5 min read Opinion easyNovice

Model Routing Is Simple. Until It Isn’t.

LLM model routing in agentic systems is a systems optimization problem, not a classification one. On 417 AppWorld tasks with a CodeAct agent, Claude Sonnet 4.6 cost $0.19/task versus GPT-4.1's $0.37 despite higher list prices and about 3x more steps, because cheap cache reads dominate agent workloads. Task difficulty is often invisible at routing time and competes with latency, compliance and reliability constraints, and latency depends on serving conditions and routing granularity. IBM's optimization-based router traces a cost-accuracy frontier: one configuration reached 84% accuracy with 21% lower cost and 9% lower latency than Opus alone, at about 6 ms and 2 kB overhead per task.

Related posts

  • How to Build a Model Router in the Harness

    LangChain mediumAdept

    Routing each coding-agent thread to one of three model tiers (fast, balanced, performance) cut median cost per thread by 64% versus always using a top frontier model, with no measurable change in merged-PR rate (29.2% vs 27.3%, p=0.49) across 973 threads in Open SWE. The router runs as harness middleware, classifying the first user message against per-tier criteria. Those criteria come from trace-based task analysis and provider guidance, which is why it belongs in the harness rather than a generic gateway. Most threads went to the balanced (56%) or fast (34%) tiers. A fast-only control degraded quality so quickly it was stopped within a day. Future work includes subagent routing and mid-thread re-routing, which carries a prompt-cache cost.

  • How Cursor Router chooses the right model for the task · Cursor

    Cursor mediumAdept

    Cursor Router picks a model per agent turn in two stages: Compass, a complexity predictor trained on implicit user-satisfaction signals (moving on vs. correcting the agent), decides whether a turn stays on a cheap model (Grok) or gets upgraded. Upgraded turns are classified by a learned taxonomy of domains, tasks and modifiers and sent to the frontier model with the best observed performance there. A candidate must clear a one-sided 75% confidence uplift over the cheap model, and an optimizer picks the traffic-weighted model mix that maximizes expected gain within each mode's per-turn cost budget. Policies were tuned with cross-validation, checked on a held-out set, then validated on live traffic. Auto Intelligence now beats Fable-level satisfaction at 68% lower cost, and Auto Balance beats Opus 4.8 at 41% lower cost.

  • 2,000 robots walk into a shop...

    Shopify Engineering hardMaster

    SimGym runs simulated A/B tests on Shopify storefronts by sending up to 2,000 concurrent LLM-driven shopper agents through Browserbase cloud browsers. Because browsers bill per minute, inference latency directly drives cost: a ~20% latency cut lowered cost per merchant run by ~10%. The team self-hosted gpt-oss-120b on 48 B200 GPUs with vLLM and FlashInfer, using MXFP4 experts, an FP8 KV-cache, custom long-context speculative decoding kernels (EAGLE-3) and combined async/guided/speculative decoding. MIG partitioning cut latency ~20% and prefix-cache-friendly prompts added ~12% throughput, while lowering reasoning effort was rejected because error rates rose to as much as 10.9%.

  • Open Models have crossed a threshold

    LangChain mediumAdept

    Open-weight models GLM-5 and MiniMax M2.7 now score close to closed frontier models on core agent tasks in LangChain's Deep Agents eval suite. GLM-5 reached 0.64 correctness, MiniMax M2.7 0.57, and Claude Opus 4.6 0.68, across 138 tests covering file ops, tool use, retrieval, memory and summarization. The open models are far cheaper and faster: about $12/day versus $250/day for 10M output tokens, and 0.65s versus 2.56s latency. The eval metrics are defined (correctness, solve rate, step and tool-call ratios), and switching Deep Agents to an open model is a one-line change, with the harness adapting context management and model identity to each model.

  • Comparing token economics across 42 AI models

    Neon mediumAdept

    A synthetic workload of 100 support tickets (20 scenarios × 5 tone variants) was run through 42 models via Neon AI Gateway, with responses graded on seven checks including JSON validity, correct classification and escalation, and policy compliance. GPT-5 Nano had the lowest cost per usable response and finished in about 3 minutes. GPT-5.5 Pro cost about $8.34 and took 57 minutes, GPT-5.3 Codex had the highest pass rate at 82%, and Llama 3.1 8B was fastest but passed only 34%. Catalog price alone misleads, because token volume and failure rate drive the real cost per unit of work. A projection of one 1M-token agent task per engineer per day shows roughly an 86× spend gap between moderately cheap and moderately expensive models. The harness uses one Neon branch per model, created with --no-compute, plus a Python runner, Postgres result tables, a Next.js report and a scheduled GitHub Actions workflow.

The quest for software engineering knowledge.

Look:
Layout: