⚡
Stage 5 · Lesson 2 of 5

Model Routing

Not every agent needs the same model. Haiku for scanning, Sonnet for synthesis. Save 50-80% on costs.

~20 min read8 walkthrough steps

Model routing is one of the most impactful optimizations you can make, and most people never do it because they set one model globally and forget about it. In a multi-agent system, different agents do fundamentally different work. Using the same model for all of them is like paying a senior engineer to do data entry.

The concept is simple: assign each subagent the cheapest model that can do its job well. A research agent that scans web pages and extracts specific data points? That's pattern matching — a lightweight model handles it perfectly. A writing agent that needs to synthesize complex information into nuanced prose? That needs a more capable (and expensive) model. An orchestrator that just delegates tasks and compiles results? Lightweight model, no question.

Here's a practical tier framework. Tier 1 (Haiku/GPT-4o-mini): scanning, data extraction, formatting, simple classification, template filling. These tasks are well-defined with clear inputs and outputs. Tier 2 (Sonnet/GPT-4o): writing, analysis, code generation, complex reasoning with clear constraints. Tier 3 (Opus/o1): strategic synthesis, ambiguous problems, creative work, tasks where quality absolutely cannot be compromised.

The cost savings are dramatic. In a typical content pipeline with a researcher, writer, editor, and formatter: using Opus for everything might cost $2-4 per run. With model routing — Haiku for research and formatting, Sonnet for writing, Opus only for final editorial review — the same pipeline costs $0.40-0.80 per run. That's a 70-80% reduction with negligible quality impact, because each model is doing work matched to its capability level.

Configuration is per-subagent. In each subagent's markdown file, add a Model section: "Use claude-haiku for this agent." The orchestrator routes to the subagent, which runs on its specified model. Different models, same workflow, optimized costs.

Walkthrough

  1. 1
    List all your subagents and their primary task type (scanning, writing, analysis, etc.)
  2. 2
    Assign each subagent to a model tier: Tier 1 (lightweight), Tier 2 (capable), or Tier 3 (premium)
  3. 3
    Update each subagent's markdown file with a Model section specifying the appropriate model
  4. 4
    Calculate estimated cost per workflow run with the current (single model) setup
  5. 5
    Calculate estimated cost per workflow run with model routing applied
  6. 6
    Run the workflow with model routing and compare output quality to the single-model version
  7. 7
    Identify any subagents where you downgraded too aggressively (quality dropped noticeably)
  8. 8
    Fine-tune: adjust model assignments based on the quality comparison

Checkpoint

Each subagent has an assigned model tier based on its task complexity. You've calculated the cost savings and verified that output quality is maintained with the routing configuration.