Two-Tier Model Selection: Default Agent Routing and Cost Optimization
A two-tier model strategy lets AI agents handle routine requests with a cost-efficient default model while escalating difficult or high-risk tasks to a flagship model. This article explains task allocation, routing and escalation rules, evaluation gates, engineering requirements, and cost governance, with a focus on task quality and cost per successful task.
1. Choose a Capability Mix, Not Just the Strongest Model
As AI agents and generative applications move into production, model selection can fall into a common trap: sending every request to the most capable model. This may maximize quality for an individual task, but real workloads are usually highly skewed. Many requests involve classification, summarization, information extraction, routine code completion, log analysis, or simple tool calls. Only a smaller share requires extended reasoning, cross-system analysis, complex code refactoring, or decisions under high uncertainty.
Without a tiered approach, systems face three types of cost:
- Direct inference costs: Long contexts, complex prompts, and multiple rounds of tool calls substantially increase token consumption.
- Latency and concurrency costs: Flagship models typically require larger inference budgets. Higher tail latency can reduce agent throughput and degrade the user experience.
- Governance costs: Routing everything to the highest-capability tier makes budgets, quotas, audits, and exception handling less granular, making waste harder to identify.
A more practical approach is a two-tier model strategy: use a default model for most routine tasks and a frontier flagship model for difficult or high-risk tasks, or when the default model fails.
The flagship tier raises the system’s capability ceiling. The default tier makes sufficiently strong capabilities affordable for frequent use. Overall performance depends less on any single model’s benchmark score than on whether default routing, escalation, quality gates, and cost governance form a closed feedback loop.
2. Define Responsibilities for Each Tier
A two-tier strategy is not simply two model endpoints exposed to application code. Tasks should be assigned according to their value, the consequences of failure, and how reliably results can be verified.
| Dimension | Default tier | Flagship tier |
|---|---|---|
| Primary objective | High throughput, low latency, predictable costs | Handle difficult tasks, raise the capability ceiling, reduce critical failures |
| Typical tasks | Routine Q&A, summarization and extraction, code completion, single-step tool calls, log summarization | Extended reasoning, cross-system refactoring, complex simulation interpretation, difficult troubleshooting, high-value decision support |
| Routing policy | Default entry point | Escalation based on rules, confidence signals, or failures |
| Quality requirements | Reliable structured output and an acceptable first-pass success rate | High success rates on critical tasks, with auditable and reviewable results |
| Risk controls | Restricted tool permissions and strict output validation | Sandboxing, human approval, allowlists for sensitive operations |
| Cost priorities | Cost per successful task and concurrent throughput | Escalation rate, retry costs, human review costs |
Three principles should guide the design:
- The default tier must cover most traffic. If it handles only a small portion of requests, the design becomes “escalate everything” and loses its cost advantage. Evaluate coverage using samples of actual tasks, not just general-purpose benchmarks.
- Escalation needs objective signals. Do not rely entirely on a model’s own assessment of task difficulty. Use structured validation, unit tests, citation checks, tool return statuses, historical failure rates, and risk levels.
- High-risk tasks require controls beyond model capability. For irreversible actions, financial operations, and production changes, a flagship model can improve analysis but cannot replace permission controls, sandboxing, or human approval.
3. Design the Default Workflow and Dynamic Escalation
A practical default agent workflow typically includes five steps:
- Classify the request: Identify the task type, risk level, context length, tool requirements, and whether the output can be validated structurally.
- Run the default model: Apply limits on output tokens, tool-call rounds, and execution time.
- Validate the result: Run format checks, test cases, citation checks, rule-based validation, or a lightweight verifier.
- Escalate when needed: Use the flagship tier when formatting or tests fail, confidence is insufficient, evidence conflicts, or the user explicitly requests high precision.
- Log and feed back: Record routing and escalation reasons, cost, latency, and final quality to support subsequent tuning.
The following pseudocode illustrates the routing logic:
route_request(task):if task.risk == "high" or task.irreversible:result = flagship.run(task)return human_review_if_needed(result)result = daily.run(task, max_tokens=budget, max_tool_calls=limit)if not validate_schema(result):result = flagship.run(task, reason="schema_failed")if task.has_tests and not run_tests(result):result = flagship.run(task, reason="tests_failed")if verifier_score(result) < threshold:result = flagship.run(task, reason="low_confidence")return result
Thresholds, maximum execution rounds, and budget limits must come from workload-specific evaluation rather than being copied from another system.
Escalation also needs a circuit breaker. Limit each task to one or two escalation attempts to prevent runaway costs. If a task continues to fail, hand it to a human or ask the user for more information instead of retrying indefinitely.
4. Evaluate Cost per Successful Task, Not Just Model Scores
A common mistake is treating a single model score as a substitute for application-level evaluation. General benchmarks can help shortlist models, but they do not establish whether the default tier can reliably complete a particular business task.
Build a task-stratified evaluation set covering at least:
- Code generation and repair: Unit-test pass rates and whether changes introduce regressions.
- Document understanding: Accuracy of key information extraction and traceability of citations.
- Multi-step tool use: Parameter accuracy and recovery from failures.
- Long-context processing: Integration of evidence across passages.
- Security and compliance: Unauthorized actions, sensitive information leakage, and prompt-injection defenses.
- Business Q&A: Answer accuracy, appropriate refusals, and structured-output validity.
Recommended metrics include:
- Task success rate and first-pass success rate.
- Escalation rate and success rate after escalation.
- Invalid tool-call rate.
- Structured-output validation pass rate.
- P95 latency and timeout rate.
- User correction rate and human review rate.
- Cost per successful task.
Calculate cost per successful task as:
Cost per successful task =(Default-tier call costs + Escalation call costs + Retry costs + Human review costs)÷ Number of successful tasks
A cheaper model is not necessarily cheaper overall if it causes frequent retries and manual rework. Conversely, a more expensive model may deliver greater net value if it substantially reduces failures on critical tasks.
Complete offline evaluation before deployment, then use small-scale A/B testing to verify changes in escalation rate, user satisfaction, and cost. Changes to model versions, prompts, or routing rules should pass regression tests, staged rollout checks, and automated rollback gates.
5. Engineering Requirements
5.1 Unified Model Gateway
Application code should not be tightly coupled to a specific model. A model gateway should centralize request protocols, authentication, quotas, timeouts, retries, caching, logging, and routing policies.
The gateway should maintain a model registry, prompt versions, and task-type mappings. This makes it easier to replace models, adjust rollout proportions, and roll back changes.
5.2 Caching and Context Compression
Semantic or result caching can reduce repeated work for recurring questions, summaries of the same document, and analysis of stable code snippets.
For long-context tasks, use retrieval, deduplication, summarization, and tool-result compression to remove unnecessary tokens. Caches must enforce access permissions and expiration policies to prevent results from leaking between users.
5.3 Observability
For each request, record at least:
- Request identifier and task type.
- Selected model tier and routing reason.
- Escalation reason.
- Input and output token counts.
- Latency and tool-call trace.
- Validation results.
- Cost and final status.
Redact sensitive information in logs. Continuous optimization requires visibility into why a request was escalated and how much value the escalation delivered.
5.4 Output Validation and Security Controls
Validate structured output against a schema and run tests for coding tasks. For external tool use, enforce parameter allowlists, timeouts, and idempotency keys.
High-risk operations must require human confirmation. Model output must not directly trigger irreversible actions. Both tiers need prompt-injection defenses, permission controls, and auditability.
6. Common Deployment Scenarios
Software Development Assistance
Use the default tier for code completion, comment generation, simple defect analysis, and unit-test suggestions. Escalate when tests fail or a task involves cross-module refactoring or architecture review.
The goal is not to let a model merge code directly. Escalated results should enter the testing pipeline and human review process.
Operations Agents
Use the default tier for alert clustering, log summaries, and routine troubleshooting recommendations. Reserve the flagship tier for cross-system incident diagnosis and complex root-cause analysis.
Production changes, restarts, and scaling actions must still pass approval and automated validation. Escalation must never bypass permission boundaries.
Document and Business Analysis
Use the default tier for classification, extraction, summarization, and standard Q&A. Escalate conflicting information across documents, complex contract-clause comparisons, and high-value decision-support tasks.
Preserve supporting citations for all conclusions and flag low-confidence results for human review.
Complex Engineering and Simulation Analysis
Use the default tier for data preprocessing, parameter organization, and result summaries. Use the flagship tier to interpret multiple constraints, compare models, and analyze anomalies.
Final conclusions should incorporate review by domain experts rather than treating model output as the sole source of authority.
7. Cost Governance and Cross-Functional Coordination
A two-tier strategy requires coordination across product, engineering, AI, security, and finance teams.
Set budget quotas by team, application, and task type, and define daily and monthly escalation limits. Apply different policies across environments. For example, testing environments may allow higher escalation rates, while production applies stricter controls to high-risk escalation.
Cost dashboards should show token costs, escalation rates, retry rates, human review costs, and task success rates together. Looking only at the total bill obscures the relationship between spending and outcomes.
A monthly review can focus on three questions:
- Which escalations could have been avoided?
- Which non-escalated tasks caused quality incidents?
- Which tasks can move from the flagship tier to the default tier through better prompts or improved tooling?
Continuous sampling and regression evaluation help teams develop routing rules suited to their own workloads.
8. Recommended Implementation Roadmap
- Select three high-frequency task categories and two difficult, high-value categories, then establish baseline data.
- Build a unified model gateway and request logging. Establish observability before introducing automatic routing.
- Create application-specific evaluation sets and measure cost per successful task.
- Make the default tier the standard entry point, with objective escalation rules and budget caps.
- Start with a limited rollout and monitor escalation rate, success rate, latency, and cost.
- Establish version regression testing, automated rollback, and human review processes.
- Expand by use case, but avoid introducing too many tiers or overly complex policies too early.
- Regularly eliminate low-value escalations, redundant retries, and ineffective caching.
9. Conclusion
The purpose of a two-tier model strategy is not to present a stronger model as a universal solution. It is to combine capability, default-path throughput, failure recovery, and cost governance into an operable production system.
The default tier should handle most requests. The flagship tier should intervene under clear, measurable, and auditable escalation conditions. The essential foundations are a model gateway, evaluation gates, structured validation, observability, and security boundaries.
A two-tier strategy becomes production-ready only when decisions account for both cost per successful task and quality on critical tasks.
