Layered Model Routing: How to Choose and Deploy Mid-Tier LLMs
As large language model portfolios evolve beyond a single flagship model, mid-tier models are becoming essential for balancing capability, latency, and cost. This article explains the engineering logic behind tiered model selection, including latency budgeting, multimodal knowledge work, agentic coding workflows, weighted cost modeling, routing strategies, evaluation, and observability.
Over the past several months, cloud AI providers have been adding more “mid-tier” models to their model portfolios, often using naming conventions inspired by chemical elements. Beyond the branding, the more important shift is structural: LLM products are moving away from a “single strongest model for everything” approach toward tiered portfolios organized around capability, latency, and cost.
This article abstracts away from specific products and examines the general engineering logic behind mid-tier models, along with practical approaches to model selection, routing, cost modeling, and evaluation.
1. Why Model Portfolios Need Multiple Tiers
Using a single flagship model for all traffic is difficult to justify from an engineering perspective for three main reasons:
- Costs are nonlinear. Flagship models typically cost several times more than lightweight models, while only a small portion of production requests genuinely require long-chain reasoning. Using a flagship model for every request means applying the most expensive resource to the least demanding tasks.
- Latency cannot be compressed indefinitely. Complex reasoning can introduce end-to-end latency measured in seconds or even tens of seconds. By contrast, tasks such as completion, rewriting, and classification are highly sensitive to time to first token. Combining both workloads in one model allows the slowest requests to degrade the overall user experience.
- Capability gains diminish on routine tasks. For many common workloads, the performance gap between a mid-tier model and a flagship model is much smaller than the price difference. A better engineering strategy is to reserve the largest budget for the small number of genuinely difficult requests.
This naturally leads to a three-tier structure:
- Lightweight models handle high-volume, short-output tasks with strict latency requirements.
- Mid-tier models cover complex programming, knowledge work, and research assistance across the majority of use cases.
- Flagship models are reserved for the hardest requests that require extended reasoning.
The main purpose of the mid-tier is to absorb the large group of requests that would otherwise be sent to a flagship model by default.
2. Analyze Speed Metrics Separately: Throughput Is Not Latency
“Fast” is one of the most common selling points for a new model. However, tokens generated per second represent throughput, while users experience end-to-end latency. These metrics should not be conflated.
End-to-end latency can be approximated as:
T_total = T_queue + T_prefill + T_decode + T_network
T_queue: Queueing and rate-limit delays, which depend on quotas and concurrency.T_prefill: The prefill phase, which is approximately linear with input length and can dominate workloads involving long documents.T_decode: Decoding time, roughly equal to output length divided by output throughput.T_network: Network and gateway overhead.
This leads to two practical conclusions.
First, doubling output throughput only produces close to a twofold improvement for tasks with long outputs and short inputs. For repository-level analysis involving tens of thousands of input tokens, the bottleneck is prefill, so the overall speedup may be limited.
Second, time to first token is determined mainly by queueing and prefill, not by decoding throughput. Interactive applications should therefore define a separate TTFT budget instead of relying solely on tokens-per-second metrics.
A practical latency budget might look like this:
LATENCY_BUDGET = {"chat": {"ttft_ms": 800, "total_ms": 6000},"codegen": {"ttft_ms": 2000, "total_ms": 30000},"repo_task": {"ttft_ms": 5000, "total_ms": 180000},}
3. Multimodal Knowledge Work: From “Can Read” to “Can Deliver”
A typical mid-tier model capability profile includes support for documents, spreadsheets, images, and audio or video, while also producing structured deliverables such as research briefs. Three engineering practices are especially important.
- Preprocess each modality before sending it to the model. Convert tables into structured text and audio or video into timestamped transcripts. This is often more reliable and more token-efficient than passing raw files directly to the model.
- Constrain the output format. Requiring the model to return a validated schema makes the result easier for downstream pipelines to consume than free-form text.
- Preserve traceability. Each conclusion should reference its source passage. Provenance is a prerequisite for acceptable results in knowledge-work scenarios.
SCHEMA = {"type": "object","required": ["summary", "findings", "sources"],"properties": {"summary": {"type": "string"},"findings": {"type": "array", "items": {"type": "string"}},"sources": {"type": "array", "items": {"type": "string"}},},}
4. Separating Planning and Execution in AI Coding Tools
Repository-level changes, debugging, and refactoring are among the most valuable applications for mid-tier models. The main challenge is not isolated code generation, but long-range consistency across file dependencies, build constraints, and regression risks.
A common industry pattern is to separate the roles:
- A model with stronger reasoning capabilities handles planning and task decomposition.
- A model with higher throughput handles file-by-file implementation and verification.
def repo_task(plan_model, exec_model, goal, repo_index):plan = plan_model.generate(f"Goal: {goal}\nRepository summary: {repo_index}\n""Output: an ordered list of steps, with files involved and acceptance criteria for each step")for step in parse_steps(plan):patch = exec_model.generate(f"Step: {step}\nOutput only a unified diff")if not run_checks(step, patch): # Build, unit tests, and static checksplan = plan_model.replan(goal, step, patch)return collect(patches)
The key design principle is to keep verification outside the model. Compilation, unit tests, and static analysis act as hard gates. The model generates candidates, while deterministic tools decide whether they pass.
This limits risk and allows the “expensive planning model, cheaper execution model” division of labor to produce real savings.
5. Cost Modeling: Calculating Costs Across Three Pricing Tiers
These models are commonly priced across three dimensions: input tokens, output tokens, and cached input tokens. Mid-tier pricing generally falls between lightweight and flagship models.
For capacity planning, do not compare unit prices alone. Calculate the weighted cost:
def cost_per_1k(reqs, p_in, p_out, p_cache, cache_ratio=0.0):c = 0.0for r in reqs:cached = r.in_tok * cache_ratioc += (r.in_tok - cached) * p_in + cached * p_cache + r.out_tok * p_outreturn c / len(reqs) * 1000
Three details are easy to overlook:
- Cache hit rates for repeated prefixes in long inputs are often underestimated.
- Output pricing is usually significantly higher than input pricing, so reducing output length can be more valuable than shortening the prompt.
- When promotional and standard prices coexist, capacity planning should be stress-tested against standard pricing. Otherwise, production costs can exceed the budget as soon as promotional terms end.
6. Deployment Recommendations and Common Mistakes
- Build tiered routing. Use rules or a lightweight classifier to estimate task difficulty and send each request to the appropriate model tier. Keep an upgrade path to the flagship model for fallback handling.
- Create an internal evaluation set. Public benchmarks can eliminate obviously unsuitable candidates, but final decisions should be based on offline evaluations that reflect the real workload distribution, followed by small-scale traffic experiments.
- Instrument the full request path. Monitor queueing time, time to first token, decoding throughput, cache hit rate, and per-request cost separately. This is necessary to identify where the actual bottleneck lies.
- Mistake 1: Treating throughput as a proxy for user experience.
- Mistake 2: Assuming a mid-tier model can fully replace a flagship model.
- Mistake 3: Comparing unit prices without calculating weighted cost.
No matter how memorable a model’s name may be, the name is ultimately a layer of marketing. For developers, the real benefit comes from explicitly balancing capability, latency, and cost in the same planning model.
A tiered model portfolio provides the options needed for that trade-off. Routing, external verification, and end-to-end observability are what turn those options into reliable production delivery.
