Part 2 · The Four Rights

Token Engineering · ~7 min

Right Model — Cost-Aware Routing

Stop paying top-tier prices for file searches. Route each task to the cheapest model that clears the bar, and let a cheap validator decide when to escalate.

Why this, for you: the easiest five-figure mistake in agent design is defaulting every call to the biggest model "to be safe." Most of an agent's turns are read-only exploration that a fast model nails. This lesson gives you the discipline to spend tier where it changes the answer — and a gate that catches the cheap-tier misses.

Model cost scales with tier and token volume. Top-tier models on every task waste compute; cheap models on complex tasks produce rework. The fix is not a single model — it's a route: match capability to complexity, and escalate only when a deterministic check says the cheap pass failed.

1 Route by complexity, not by habit

The default move — "use the most capable model so I never get burned" — is the anti-pattern. It is safe but wasteful at scale. Cost-aware design matches the model tier to what the task actually demands:

Task typeCharacteristicsModel tier
File search, explorationHigh volume, low reasoningFast (e.g. Haiku)
Code implementationBalanced capability and speedBalanced (e.g. Sonnet)
Architecture, complex refactorDeep reasoning requiredPowerful (e.g. Opus)
Using a balanced-tier model for work a budget-tier model handles just as well spends multiples of the budget for no quality gain. In GitHub Copilot's premium-request economics, that is a 1x model doing a 0.33x model's job — three times the cost for the same output.

This is the big.LITTLE idea borrowed from CPU architecture: powerful cores for demanding work, efficient cores for background tasks. A community analysis of mixed coding workloads reports a 2–2.5x cost reduction at 85–95% quality when a fast model handles read-only exploration while the main model reasons.

2 Escalate on failure — the cascade

Routing by static task-type is a start, but the real lever is cascade routing: query the cheaper model first, and escalate to a capable model only when the cheap pass fails a check. FrugalGPT showed this can cut cost up to 98%, or improve accuracy 4% at equivalent cost.

No coding tool implements cascade natively. Approximate it with a two-pass pattern: fast model first → deterministic gate (tests, linter, type checker) → escalate to the capable model on failure.

The whole pattern hinges on the word deterministic. Escalation is only trustworthy when a cheap, mechanical check decides it — a passing test suite, a clean linter, a green type-checker. That gate is what stops a cheap-tier miss from shipping silently.

The gate has a feasibility threshold

Cascade only saves money when the light-tier pass rate exceeds the inter-tier cost ratio (the Triage condition). Below that line, cheap-tier failures generate rework that costs more than the savings. Measure pass rates by tier on a representative sample before committing to a router. And if the gate itself is slow or absent, the cascade adds latency without saving anything.

3 Don't reach for tier first — retrieval can beat it

Before you escalate to a bigger model, check whether better context closes the gap. A cheaper model with good retrieval can beat a bigger model used alone: on a large-codebase evaluation, a balanced model paired with a code-search MCP beat a top-tier model alone on 6 of 9 tasks at roughly half the cost per quality point (Sourcegraph).

Two more levers sit on the same trade-off. Role routing assigns models by capability, not just complexity — an Action model for tool-based execution, a Thinking model for extended reasoning, a Compact model for summarization during compaction — each with a fallback chain for graceful degradation. And agent weight matters: lightweight agents (<3k init tokens) get composed often; heavy agents (25k+) become bottlenecks. Prefer splitting into light agents over one heavy specialist.

# Per-agent model selection — route, don't default to the top tier explorer → haiku "Use PROACTIVELY for read-only exploration: search, read, trace call paths. Findings only." implementer → sonnet "Write/edit/refactor once exploration is done." architect → opus "Architecture, refactors spanning >5 files. Invoke sparingly." # Use display names (haiku/sonnet/opus), not pinned IDs — # a retired model ID fails the call instead of routing to a successor.

↪ Your win: spend tier where it changes the answer

Retrieval practice — recall, don't peek

Question 1Cost-aware routing says each task should go to the…

Question 2In a cascade, escalation to a bigger model should be triggered by…

Question 3Tier routing only saves money when the light-tier pass rate…

Question 4Before escalating to a bigger model, a cheaper move worth trying is…

Question 5 · spaced recall from an earlier lessonAcross the four rights, the one thing you must never trade away to cut tokens is…

Ask me anything. Want help measuring your light-tier pass rate, or wiring a two-pass cascade behind a test gate? Next in Part 2: Right Token — Lean Context, Lean Output — cutting tokens at the source with terse schemas and diff-style edits.
✎ Feedback