Guide

Model Routing LLM Cost Playbook

A practical playbook for routing prompts across models to control cost and latency while keeping accepted output quality stable.

Updated 2026-05-19model-routing / cost-governance / ai-spend
Desk note

Routing works when it is measurable and explainable. If you cannot explain why the router picked a model, you will not be able to debug spend spikes or quality regressions.

What model routing is

Model routing is choosing which model to call for each step of a workflow instead of sending everything to the same default. The goal is to match model capability to task risk: cheap models handle low-risk steps, and expensive models are reserved for hard or high-stakes steps.

  • Routing input: task type, risk level, budget, and past failure modes.
  • Routing output: chosen model, fallback plan, and a traceable reason.

On this siteModel routing topic hubWhat proven workhorses costRouting and caching tools

Where routing saves money

Routing saves money when many steps do not require premium reasoning: classification, extraction, summarization, rewriting, formatting, and simple lookups. The savings get bigger when agents are involved, because agents produce many small calls that compound.

  • High leverage: agent tool loops and multi-step workflows.
  • Lower leverage: one-shot tasks where model choice is already obvious.

Policy patterns that work

Start with policies you can explain. Then add complexity only when you can measure the improvement.

  • Tiered routing: cheap default, expensive on failure or uncertainty.
  • Budget routing: cap spend per task; degrade gracefully when budget is hit.
  • Risk routing: reserve strong models for customer-visible or high-stakes steps.
  • Context routing: if context is huge, prefer models that can handle it or compress first.

Fallback and stop conditions

Most routing failures are not model failures. They are control failures: retries without caps, tools without guards, and fallback chains that keep escalating cost. Treat stop conditions as part of the routing policy.

  • Cap retries per step and per task.
  • Stop when acceptance cannot be reached without human input.
  • Prevent recursive summarization and repeated context reloads.

Evaluation and acceptance signals

Routing needs an objective signal. Use acceptance state and lightweight evals so you can tell whether savings are real or whether they shifted cost into human review.

  • Track accepted vs. edited vs. rejected outcomes by route.
  • Add a small evaluation set for each workflow before changing policies.

Observability: what to log

To debug tokenmaxxing and routing decisions, you need the trace, not the invoice. Log the route and the reason alongside the spend.

  • Workflow + owner + prompt version + route + model + tokens + cost + retries + latency.
  • Decision reason: policy rule hit, uncertainty score, or failure mode that triggered escalation.

Frequently asked questions

What is the simplest routing policy?

A two-tier policy: default to a cheaper model, then escalate to a stronger model only when the output fails a check (format, factuality guardrail, test failure, or reviewer rejection).

How do you know routing is working?

Cost per accepted outcome goes down while acceptance rate and review burden stay stable. If savings come with more edits, more retries, or more escalations, you have shifted cost rather than reduced it.

Do you need a router product to do routing?

Not at first. Many teams start with application-level rules (task category -> model) and add a router or gateway once they need centralized policy management, observability, and provider abstraction.

Weekly briefing

The term is moving faster than the definition.

Tokenmaxxing keeps shifting as new receipts land. The weekly briefing tracks who's burning what, and why it matters.

Written by the desk's AI, human-reviewed before send, real numbers only.

Source trail

Current feed records connected to this guide

CNX Software - Embedded Systems News source artwork
newsCS
news

Token Monitor - An ESP32-S3 desktop display that tracks AI coding assistant usage (Crowdfunding) - CNX Software

Fractal Manifold is crowdfunding Token Monitor, a EUR 99 ESP32-S3 desk display with a 4-inch touchscreen that shows quota use, session limits, reset timers and estimated token costs for Claude Code, Codex CLI and Antigravity CLI.

tokenmaxxingcoding-agentsagents
Read note
theclimatebrink.com source artwork
newsT
news

The real energy use of agentic AI

Climate scientist Zeke Hausfather metered his own Claude Code habit: 1,138 typed prompts fanned out to more than 14,000 model calls and 3.2 billion tokens in eight weeks, drawing roughly 170 kWh of data-center electricity.

tokenmaxxingcoding-agentsagents
Read note
TechNode source artwork
newsT
news

DeepSeek V4 Flash tops OpenRouter weekly ranking with 7.22 trillion tokens · TechNode

DeepSeek V4 Flash led OpenRouter's July 27 to Aug. 2 usage ranking with 7.22 trillion tokens. Chinese models held all four leading slots, and V4 Flash 0731 plus V4 Pro landed inside the top six.

tokenmaxxingmodel-routerpricing
Read note
Project layer

Tools that make the guide operational

#4In spirit
Agents

LangGraph

langchain-ai/langgraph

A framework for building resilient stateful agents with explicit graphs, persistence, human-in-the-loop flows, and controllable execution.

39.1K6.6KMIT
agentsstateworkflows
#1Direct
Routing

LiteLLM

BerriAI/litellm

An OpenAI-compatible gateway and SDK for calling many model providers with budgets, logging, load balancing, guardrails, and cost tracking.

55.8K10.4KSource-available
gatewaycost-trackingrouting
#2Direct
Observability

Langfuse

langfuse/langfuse

Open-source LLM engineering platform for observability, traces, metrics, evals, prompt management, datasets, and playground workflows.

32.7K3.5KSource-available
tracesevalscosts
Briefing

Fresh source notes each week.

New tokenmaxxing links, model-router signals, agent usage research, and AI cost notes.