Generative AI
Model Selection, Routing, and Economics
Compare models and system designs using quality, latency, throughput, context, safety, privacy, reliability, and total cost across real traffic.
By the end you can
- Define a workload portfolio and its quality, latency, risk, and cost requirements
- Compare model candidates using representative end-to-end evaluations rather than public leaderboards alone
- Design routing and fallback policies for heterogeneous requests
- Estimate total system cost including retrieval, tools, retries, review, monitoring, and change management
The best model is conditional on the request
A small model may extract a known schema faster and more reliably than a general reasoning model. A larger model may be justified for ambiguous planning. Arithmetic and policy invariants should go to deterministic software.
Model selection is therefore a portfolio decision. It matches request classes to the least complex system that meets the release contract. That decision has been measured in public, on named benchmarks, with published prices and published savings. The rest of this lesson is built on those measurements, not on the intuition that bigger is safer.
Choose the smallest defensible workflow for each request class, not one prestigious model for the entire product.
Visual
A model candidate sits inside a multidimensional operating envelope
A leaderboard score covers only part of the decision. It is worth being precise about which part.
Take the best-known leaderboard. Chatbot Arena shows a person two anonymous answers side by side and records which one they prefer. When Chiang and colleagues wrote it up in 2024, the count was already large: “The platform has been operational for several months, amassing over 240K votes.” Over 240,000 crowdsourced pairwise votes, from about 90,000 users, is a real measurement — of which of two answers a person preferred.
That is one axis of the envelope below, and only one. Aggregate pairwise preference carries no latency, no cost and no groundedness. A ranking built from it cannot tell you the time to first token under load. It cannot tell you the price of the traffic it would generate, whether the preferred answer was supported by the retrieved document, or what a version change would cost you to re-certify. Those are separate measurements. Each has to be made against your own traffic.
Task quality is correctness, groundedness, format adherence, tool use and abstention. Operating performance is time to first token, output rate, concurrency and tail latency. Resource cost is input, output, cache, retrieval, tool, accelerator and review costs. Risk and control is safety behavior, data handling, deployment boundary and audit evidence. Lifecycle fit is version stability, migration effort, evaluation burden and provider or platform constraints. That is five dimensions. A leaderboard reports a projection of the first one.
Task quality
Correctness, groundedness, format adherence, tool use, and abstention.
Operating performance
Time to first token, output rate, concurrency, and tail latency.
Resource cost
Input, output, cache, retrieval, tool, accelerator, and review costs.
Risk and control
Safety behavior, data handling, deployment boundary, and audit evidence.
Lifecycle fit
Version stability, migration effort, evaluation burden, and provider or platform constraints.
Predict first
How much can a cascade save at the same quality?
A cascade sends each query first to a cheap model and escalates to a more expensive one only when a learned scorer judges the cheap answer unreliable. Advertised prices for the models it can choose from differ by up to a hundredfold. A 2023 study tuned such a cascade to match the accuracy of the best single model, GPT-4, and measured what it spent.
Make a prediction before reading on. At GPT-4's accuracy, what was the largest saving the study reported, on its most favourable test: a few percent of GPT-4's cost, about half, or almost all of it?
Settle on an answer, then read on — the next section is the reveal
Comparison
Several system choices can solve the same product task
Evaluate complete workflows under matched requirements and budgets. Three designs recur. A single general model takes most traffic. A router with specialists classifies requests and sends them to models or workflows with different strengths. A deterministic hybrid uses rules, search, calculators, templates and models together.
The spread these designs are chosen against is unusually wide. FrugalGPT, published in 2023, found advertised API prices differing by up to two orders of magnitude: a prompt cost for 10M tokens of $30 for OpenAI's GPT-4 against $0.20 for GPT-J on Textsynth. Its answer was an LLM cascade. Its abstract also supplies the magnitude that a phrase like “improves the cost-quality frontier” leaves unstated: “Our experiments show that FrugalGPT can match the performance of the best individual LLM (e.g. GPT-4) with up to 98% cost reduction or improve the accuracy over GPT-4 by 4% with the same cost.”
Read the two halves of that sentence as two different products. "Up to" marks the best case the paper reports, not the saving to expect on your own traffic. Equal quality at up to 98% lower cost is a margin decision. Four accuracy points above GPT-4 at the same spend is a quality decision. One cascade offers both. Which one you take is set by the release contract, not by the architecture.
The single general model stays simple to integrate and monitor, and it is useful during early discovery. It also costs more, runs slower, and is often unnecessary for easy cases. The router adds routing errors, observability needs, and a fallback and override policy; it earns its place with heterogeneous traffic. The deterministic hybrid gives high reliability for structured steps and reduces the generative burden, at the price of more engineering boundaries. It is the right answer when parts of the task are exact.
Single general model
Use one capable model for most traffic.
- Simple integration and monitoring
- Potentially high cost and latency
- May be unnecessary for easy cases
- Useful during early discovery
Router and specialists
Classify requests and send them to models or workflows with different strengths.
- Improves cost-quality frontier
- Adds routing errors and observability needs
- Requires fallback and override policy
- Useful with heterogeneous traffic
Deterministic hybrid
Use rules, search, calculators, templates, and models together.
- High reliability for structured steps
- More engineering boundaries
- Reduces generative burden
- Useful when parts of the task are exact
Example
Token price is only one line in total cost
A business case should include the resources required to produce and maintain acceptable outcomes. Even the first line has internal structure that a single price-per-million figure hides.
Cached input tokens are a separate price line, not a discount on the same line. Anthropic's prompt-caching documentation says so in its pricing note: “5-minute cache write tokens are 1.25 times the base input tokens price”. 1-hour cache writes are priced at 2x, and cache reads at 0.1x. AWS documents the same shape for OpenAI's GPT-5.6 models — Sol, Terra and Luna — on Amazon Bedrock: writes at 1.25x the uncached input rate, reads at a 90% discount.
The arithmetic follows, and it is worth doing rather than assuming. The 0.25x write surcharge has to be earned back by later reads that each save 0.9x. A cached prefix therefore pays for itself on its first hit. The cache only costs more than no cache once a prefix is written more than about 3.6 times for every time it is read. A long system preamble reused across a session is free money. A prefix rewritten on every request and rarely re-read is a surcharge with no return.
- Inference: Input, output, cached tokens — priced on their own line at 1.25x for a 5-minute write, 2x for a 1-hour write and 0.1x for a read — image or audio processing, and model-hosting capacity.
- Context: Retrieval indexing, embedding, reranking, document parsing, and storage.
- Tools: Search, databases, sandboxes, third-party APIs, and transaction fees.
- Reliability: Retries, fallbacks, guardrails, verification, and human review.
- Operations: Evals, monitoring, incident response, migrations, and support.
- Failure: Rework, delay, fraud, unsafe action, customer harm, and regulatory exposure.
Key idea
A router creates a new model-selection problem
Routing can reduce average cost by sending simple cases to cheaper workflows and escalating difficult ones. It can also misclassify a consequential request as easy, or produce inconsistent behavior across users. Evaluate route accuracy, downstream quality, fallback frequency, cost and fairness together, and include a safe default for when the router is uncertain or unavailable.
The prize is measurable, and it has been measured. RouteLLM trained routers on human preference data to choose between a stronger and a weaker model at inference time. On MT Bench they reached 95% of GPT-4's score — 8.8 against GPT-4's 9.3 — at a cost-saving ratio of 3.66x. “The results show that our routers achieve cost savings of up to 3.66x, demonstrating that routing can significantly reduce cost while maintaining response quality”, says the paper's cost analysis.
What makes the engineering worth doing is in the paper's own costing. GPT-4 at $24.7 per million tokens against $0.24 per million tokens for Mixtral 8x7B is a hundred-fold gap. A router is an instrument for spending the expensive side only where it changes the answer.
The same paper is also the argument against quoting the headline. The 3.66x came on MT Bench. The same routers hit 92% of GPT-4 quality on MMLU at 1.41x saving, and 87% on GSM8K at 1.49x. The saving is a property of the traffic, not of the router. Three benchmarks moved it by more than a factor of two, and your production mix is a fourth distribution nobody has measured yet.
Routing is valuable only when routing errors cost less than the resources it saves.
Steps
Run a model and workflow bake-off
Compare candidates on the complete system contract. Segment traffic into request classes, risk tiers, languages, lengths and tool needs. Establish candidate workflows, including smaller models, deterministic methods, retrieval, tools and larger models. Evaluate quality and safety on representative cases, critical slices and trace-level metrics. Measure performance and cost. Design the routing policy. Then canary and monitor route distribution, drift, regressions and total outcome cost.
The fourth step has a published form to copy rather than invent. MLPerf Inference, run by MLCommons, scores LLM systems only under explicit tail-latency constraints. Its rules document names them: “For LLM benchmarks, 2 latency metrics are collected - time to first token (TTFT) which measures the latency of the first token, and time per output token (TPOT) which measures the average interval between all the tokens generated”. In the Server scenario, Llama2-70B must hold time-to-first-token at 2,000 ms and time-per-output-token at 200 ms in the conversational category. The interactive category tightens those to 450 ms and 40 ms. Both are measured at the 99th percentile. That is what a latency requirement looks like written down: a named model, a named scenario, two numbers, a percentile, and a second, stricter tier for interactive use. The v5.0 round, published on 2 April 2025, carried 17,457 performance results from 23 submitting organisations. That is the scale at which such contracts become comparable across vendors.
The fifth step has a worked form too. Hybrid LLM, published in 2024, routed each query to a small or a large model by predicting how hard it was and comparing that prediction against a quality threshold. The threshold can be tuned at test time. “In experiments our approach allows us to make up to 40% fewer calls to the large model, with no drop in response quality”, says the abstract. The tunable threshold is the design lesson. The policy exposes a quality level as a dial instead of freezing one operating point at training time. The same router then serves a strict tier and a permissive tier without being rebuilt.
1. Segment traffic
Define request classes, risk tiers, languages, lengths, and tool needs.
2. Establish candidate workflows
Include smaller models, deterministic methods, retrieval, tools, and larger models.
3. Evaluate quality and safety
Use representative cases, critical slices, and trace-level metrics.
4. Measure performance and cost
Record tail latency, concurrency, retries, tool use, and review burden.
5. Design routing policy
Set confidence, risk, fallback, and override conditions.
6. Canary and monitor
Observe route distribution, drift, regressions, and total outcome cost.
Example
A bake-off priced for 100,000 requests a day
A support product's daily traffic is the case for the six steps. The cache price lines (writes at 1.25x, reads at 0.1x) and the tunable routing threshold come from the lesson above. The traffic, the scores and the per-million-token prices below are invented, cache writes and the FAQs that fall back to the large model are left out for simplicity, and every cost is computed.
- Segment traffic: of 100,000 requests a day, 60,000 are FAQ questions, 38,000 are account lookups (balances, order status) and 2,000 are billing disputes. Every request carries a 2,000-token system preamble, about 500 tokens of its own, and a 300-token answer.
- Establish candidate workflows: a small model with retrieval for FAQs, a deterministic lookup with a template for account questions, and a large model with human review for disputes, against the simplest baseline of the large model for everything.
- Evaluate quality and safety: on 500 FAQ cases the small model scores 94% and the large one 96%; on 300 dispute cases the small model scores 71% and the large one 88%. Account lookups are exact by construction.
- Measure performance and cost: at invented prices of $3 and $15 per million input and output tokens for the large model and $0.20 and $0.80 for the small one, the large model on everything costs $1,200 a day uncached and $660 with the preamble cached. The routed design costs $22.80 for FAQs plus $13.20 for disputes, $36 a day in tokens. Reviewing 2,000 disputes a day at 4 minutes each is 133.3 hours, about $5,333 at $40 an hour: the review line, not the tokens, is now the cost to manage.
- Design routing policy: a classifier routes each request; FAQs where the small model's verified confidence falls below a threshold go to the large model; every dispute goes to the large model and its review queue; a timeout on the small model falls back to the large one.
- Canary and monitor: 5% of traffic runs the routed design for a week. The share of requests the classifier calls FAQs, the fallback rate and the dispute queue length are watched daily, because a drift in the route mix moves the cost line before anyone looks at the bill.
Economics should reward reliability, not merely cheap tokens
A cheaper model can become expensive when it triggers retries, escalations or rework. A powerful model can waste resources too, when deterministic components would solve the task more reliably.
There is a second reason not to anchor the decision to today's token price. That price is the fastest-moving number in the stack. Stanford's AI Index Report 2025, working with Epoch AI, tracked the price of a fixed capability rather than the price of a named model: “For instance, the inference cost for an AI model scoring the equivalent of GPT-3.5 (64.8) on MMLU, a popular benchmark for assessing language model performance, dropped from $20 per million tokens in November 2022 to just $0.07 per million tokens by October 2024 (Gemini-1.5-Flash-8B)—a more than 280-fold reduction in approximately 1.5 years.” Same score on the same benchmark. $20.00 down to $0.07, between November 2022 and October 2024: just under two years, although the report gives the span as approximately 1.5.
The report also notes that the rate of decline varies from 9x to 900x per year depending on the task, and that is the part that matters for planning. A selection made on price alone is made on a quantity that may fall a hundredfold before your next migration. It may fall a hundredfold for one of your request classes and barely move for another. The lines that do not collapse on that schedule are the ones in the rest of the cost stack: retrieval, tools, retries, review, monitoring, migration, and the consequences of failure.
The next lesson examines serving mechanics. Prefill, decode, KV cache, batching and memory allocation explain why identical models can produce very different latency and throughput in production.
Key takeaways
- Model choice depends on request class, risk, latency, context, control and lifecycle requirements. Chatbot Arena's over 240,000 pairwise votes settle one of those dimensions and are silent on latency, cost and groundedness.
- Public benchmarks are inputs to investigation, not substitutes for representative end-to-end evaluation against a written contract. MLPerf Inference states its own as 2,000 ms time-to-first-token and 200 ms time-per-output-token at the 99th percentile, tightened to 450 ms and 40 ms for interactive use.
- Routing can improve the cost-quality frontier — 3.66x saving at 95% of GPT-4's MT Bench score in RouteLLM, up to 40% fewer large-model calls in Hybrid LLM — while introducing route error, inconsistency and monitoring obligations.
- Deterministic methods should own exact invariants, calculations and authorization where possible, leaving the model the ambiguous work.
- Total cost includes context, tools, retries, review, monitoring, migration and failure consequences. Even the token line has structure: cache writes at 1.25x against cache reads at 0.1x.
- Select the least complex workflow that meets the declared product contract under realistic traffic. With the price of a fixed capability falling more than 280-fold in just under two years, the non-token lines are the ones that endure.