Sub topic 1
Small and large models: what differs
Routing starts from one observation: language models in the same product line trade capability against cost and speed, and the trade is uneven. This chapter describes what actually differs between a small and a large model, so that later chapters can build routers on solid ground. It does not cover routing mechanics. Those come next.
Prerequisites
This chapter assumes you have:
- Basic Python, enough to read short functions and dictionaries.
- Experience calling a hosted language model through an API.
- A rough idea of tokens, the chunks of text a model reads and writes, and of per-token pricing.
- Awareness that models differ in cost, speed, and capability.
You do not need to know how a transformer works internally.
What "small" and "large" mean in practice
"Small" and "large" are shorthand for a tier, not a precise measurement. Providers usually sell several models in one family. The smaller ones have fewer parameters, which are the learned numbers inside the model. They are cheaper to run, so they are cheaper to call and respond faster.
Three cautions apply to the labels:
- Names vary. One vendor says "mini" or "flash". Another says "haiku" or "lite". Treat names as hints and read the pricing page.
- Size is not always disclosed. Many providers never publish parameter counts. You compare tiers by price, speed, and measured quality on your own tasks.
- Tiers are relative. A model that is "large" in last year's lineup may be cheaper and better than this year's "small" one. Your router should be defined in terms of two models you chose, not the words "small" and "large".
In this tutorial, the small tier is the cheap, fast model you would prefer to use. The large tier is the expensive, slower, more capable model you use when you must.
The main differences
The following table summarizes the differences you will see in most model families. The direction is reliable. The magnitudes are not, so measure them for your own models.
| Dimension | Small tier | Large tier |
|---|---|---|
| Price per token | Low, often one or two orders of magnitude below the large tier | High |
| Time to first token | Short | Longer |
| Output speed (tokens per second) | Higher | Lower |
| Easy tasks (classification, extraction, short rewrites) | Usually close to the large tier | Slightly better or equal |
| Hard tasks (multi-step reasoning, long code changes, subtle instructions) | Noticeably weaker, more variable | Stronger, more consistent |
| Following long or complicated prompts | More likely to drop a constraint | More likely to honor all of them |
| Rate limits | Typically more generous | Typically tighter |
The key row is the pair about easy and hard tasks. If the large model were better by a constant amount everywhere, routing would be pointless: you would pick a point on the price curve and stay there. Routing pays off because the quality gap is small on many requests and large on a few. The router's job is to find the few.
Cost: input tokens, output tokens, and the multiplier
Hosted models bill by the token, and input and output tokens are priced separately. Output tokens usually cost several times more than input tokens. A request's cost is:
cost = inputtokens × inputprice + outputtokens × outputprice
The sketch below puts illustrative numbers into code. The prices are made up for teaching and are not any provider's real rates. Replace them with the figures for your models.
# Illustrative prices in USD per 1 million tokens: (input, output).
PRICES = {"small": (0.15, 0.60), "large": (3.00, 15.00)}
# Illustrative speeds: (seconds to first token, output tokens per second).
SPEED = {"small": (0.3, 150), "large": (0.8, 50)}
def request_cost(tier: str, input_tokens: int, output_tokens: int) -> float:
price_in, price_out = PRICES[tier]
return (input_tokens * price_in + output_tokens * price_out) / 1_000_000
def latency_seconds(tier: str, output_tokens: int) -> float:
first_token, tokens_per_second = SPEED[tier]
return first_token + output_tokens / tokens_per_second
for tier in ("small", "large"):
cost = request_cost(tier, input_tokens=1500, output_tokens=400)
seconds = latency_seconds(tier, output_tokens=400)
print(f"{tier}: ${cost:.6f} per request, {seconds:.2f} s")With these numbers the script prints:
small: $0.000465 per request, 2.97 s
large: $0.010500 per request, 8.80 sThe large model costs about 23 times as much and takes about three times as long for the same request. At one million requests a month, that is roughly $465 against $10,500. If even half of those requests could be answered well by the small model, the saving is large.
Output length is part of the price
Models in different tiers do not write the same number of tokens for the same prompt. Larger models often give longer, more thorough answers unless you constrain them. If the large model writes 600 tokens where the small one writes 400, the large model's cost on that request rises from $0.0105 to $0.0135 with the prices above. The gap is wider than the price table alone suggests.
When you estimate savings, use measured token counts from real traffic for each tier. Do not assume that both tiers write the same amount.
Tokenizers differ
Different model families split text into tokens differently, so the same prompt can be 1,200 tokens for one family and 1,350 for another. Within a family the tokenizer is usually shared across tiers. If your two tiers come from different vendors, compare costs using each provider's own token counts, which are returned in the API response's usage field.
Latency: two numbers, not one
Users feel latency in two parts:
- Time to first token (TTFT) is the delay before any output appears. It includes queueing, reading the input, and starting generation.
- Output speed is how many tokens per second arrive after that.
Total time is approximately TTFT plus output tokens divided by output speed, which is what latency_seconds computes. This explains two behaviors that matter for routing:
- For short answers, such as a label or a yes/no, TTFT dominates. The small model's advantage may be a fraction of a second.
- For long answers, output speed dominates. The gap grows with every token, so a long answer from a large model can take many seconds longer.
A third effect applies to cascades, covered later: if you call the small model first and then escalate, the user waits for both calls. Escalated requests are therefore the slowest of all.
Quality: where the gap is wide and where it is not
Quality differences are task-dependent. These patterns hold often enough to guide your first guesses.
Small models usually do well on:
- Classification into a fixed label set, such as sentiment, topic, or intent.
- Extraction of fields from short text, especially into a given JSON schema.
- Short rewrites, summaries of short documents, and formatting changes.
- Retrieval-grounded answers where the needed fact is already in the prompt.
Small models more often fail on:
- Problems that need several dependent reasoning steps, such as math word problems or proofs.
- Large code edits that must stay consistent across many files.
- Prompts with many simultaneous constraints, where one is silently dropped.
- Questions that need broad world knowledge or rare facts. Small models tend to guess confidently.
- Long inputs where the answer depends on details buried in the middle.
The last point deserves care. A small model that is wrong often sounds as fluent as one that is right. Fluency is not evidence of correctness, which is why the later chapter on confidence estimation exists.
Edge cases that change the comparison
Several things blur the simple picture of small versus large.
- Prompt sensitivity. A prompt tuned for the large model may work worse on the small one. Small models tend to be more sensitive to wording, format, and example choice. Test the small tier with a prompt written for it, or you will underestimate it.
- Reasoning modes. Some models can spend extra hidden "thinking" tokens before answering. This raises both cost and latency, often by a lot, and it can close part of the quality gap. A small model with reasoning enabled can cost more than a large one without it. Compare configurations, not just model names.
- Context window limits. Tiers can have different maximum input lengths. A request that does not fit in the small model's window cannot go there at all, however easy it is.
- Feature support. Tool calling, image input, structured output modes, and system-prompt handling can differ by tier. A request that needs a feature the small tier lacks must go to the large one.
- Version drift. Providers update and retire models. A tier's behavior can change on a date you do not control, so a measurement taken in March may not hold in June.
- Variance. Even at equal average accuracy, the small model's quality varies more from request to request. Averages hide the bad tail, and users remember the bad tail.
- Rate limits and capacity. The cheaper tier often has higher limits. In an outage or traffic spike, that can be a reason to use it regardless of quality.
What this means for routing
Put the facts together and the design problem takes shape:
- The large tier costs far more per request, and often takes several times longer.
- For many requests, the small tier's answer is as good.
- For some requests, it is clearly worse, and the small tier does not reliably know which ones those are.
- Hard constraints such as context length and required features can force a request onto one tier.
A routing policy exploits point 2 without paying for point 3. Every later chapter is a different way of estimating which requests are safe to send to the small tier: surface signals and rules, the small model's own confidence, or a trained classifier. Each estimate is imperfect, and each mistake has a price. Sending a hard request to the small tier risks a wrong answer. Sending an easy one to the large tier wastes money.
You cannot reason about those mistakes without numbers for your two tiers. Before building any router, record, for each model: price per input and output token, TTFT, output speed, context limit, supported features, and its accuracy on a sample of your own tasks.
Exercise
Using the illustrative prices in this chapter (small: $0.15 input and $0.60 output per million tokens; large: $3.00 input and $15.00 output per million tokens), what does one request with 1,000 input tokens and 200 output tokens cost on each tier, and roughly how many times more does the large tier cost?
Show answer
Small: (1,000 × 0.15 + 200 × 0.60) / 1,000,000 = (150 + 120) / 1,000,000 = $0.00027. Large: (1,000 × 3.00 + 200 × 15.00) / 1,000,000 = (3,000 + 3,000) / 1,000,000 = $0.006. The large tier costs about 22 times as much (0.006 / 0.00027 ≈ 22.2).
Exercise
A teammate says, "The large model is 20 times pricier, so routing 95% of traffic to the small model will cut costs by 95%." Name two reasons this estimate could be wrong, based on this chapter.
Show answer
Any two of these: the large model may write more output tokens per request, so the real price ratio differs from the per-token ratio; the two tiers may tokenize the same prompt differently; the small model may need a prompt rewritten for it or may use extra reasoning tokens, which raises its cost; requests that need a feature or context length only the large tier supports cannot be routed to the small one; and if the policy is a cascade, escalated requests pay for both models. The saving is therefore smaller than the share of traffic moved.