Stop Sending Every Agent Task to the Same Model
Using one model for every agent task is convenient.
It is also usually wrong.
Agent workflows contain different kinds of work. Classification is not deep reasoning. Retrieval cleanup is not policy review. A final customer answer is not the same thing as a tool plan.
If you route all of that to one model, you pay too much for easy tasks and under-spec the hard ones.
Route by job#
A real workflow should name the task before picking the model.
Good routes:
- Intent classification
- Tool selection
- Evidence synthesis
- Code reasoning
- Policy review
- Final answer writing
- Eval judging
- Summarization
Each route should have a preferred model, fallback model, reason, and cost expectation.
Cheap model where it belongs#
Use fast cheap models for:
- Is this billing or product?
- Which tool should run first?
- Which specialist agent should take over?
- Extract the customer ID from this thread.
- Summarize these five events.
These tasks need consistency more than genius.
Strong model where it matters#
Use stronger reasoning models for:
- Multi-source incident analysis.
- Code review.
- Architecture risk.
- Complex customer edge cases.
- Planning a risky action.
- Resolving conflicting evidence.
This is where model quality changes the result.
Policy route gets its own lane#
Policy decisions should not be buried inside the same call that writes the answer.
Create a separate route for:
- Does this require approval?
- Is this user allowed to access this data?
- Is this tool call high risk?
- Does this response expose private data?
- Is this action reversible?
That route can use a model and prompt tuned for structured judgment.
BYOK makes routing visible#
If users bring their own OpenAI, Anthropic, Gemini, or OpenRouter keys, the workflow should make provider choices visible.
The user should be able to see:
- This route uses this provider.
- This model handles this task.
- This fallback runs if the first model fails.
- This key is required.
Hidden model routing is fine for a toy. For production, it should be inspectable.
What to log#
Every route should log:
- Task
- Provider
- Model
- Token usage
- Latency
- Error
- Fallback used
- Output validation result
This is how you debug cost and quality later.
Build it in Codelit#
Try this:
Build an agent workflow with model routing for classification, tool planning, evidence synthesis, policy review, final response, and eval judging. Include OpenAI, Anthropic, Gemini, and OpenRouter BYOK support with fallbacks.
Design model routing in Codelit
Good routing is not over-engineering. It is how agents stop being expensive blobs.
Try these templates
Continue learning
Go deeper on AI agents and LLM systems
As an Amazon Associate I earn from qualifying purchases. Codelit may receive a commission at no extra cost to you.
AI Engineering
Chip Huyen · 2025
Book-length treatment of evals, prompts and deployment tradeoffs for foundation-model apps.
AI Agents in Action, Second Edition
Micheal Lanham · 2026
Working code for agent memory, tools, MCP and A2A, in the July 2026 second edition.
4.8 (29)Kindle editionModel Context Protocol for LLMs
Naveen Krishnan · 2026
436 pages on MCP servers, gateways and auth patterns, past what the spec docs explain.
4.4 (12)TCP/IP Illustrated, Volume 1: The Protocols
Kevin R. Fall, W. Richard Stevens · 2011
Packet traces beside the prose, so you can read a tcpdump instead of guessing at it.
4.6 (317)