# Small language models vs LLMs: how routing cuts inference costs

> The frontier gets the headlines, but the models doing most production work keep getting smaller. Here is the cost math, a routing pattern you can ship this week, and when a small model is the wrong call.

- URL: https://geeklyplug.com/blogs/small-language-models/
- Author: Marcus E., Editor
- Topic: AI
- Published: 2026-08-28
- Updated: 2026-11-28

## Short answer

Small language models handle most routine production requests, such as classification, extraction and short answers with the context supplied, at a fraction of the cost of a frontier LLM. Routing those requests to a small model and sending only hard or high-stakes ones to a large model can cut inference spend by more than half while keeping quality steady.

Ask an engineering team what they run in production and you will rarely hear the name of the model that topped last month's leaderboard. You hear about a smaller model, pinned to a version, wrapped in caching, doing one narrow job well. The gap between what gets written about and what gets deployed has never been wider.

That gap exists because the two are judged on different scoreboards. Frontier models are judged on capability ceilings. Production models are judged on cost per resolved request, and those numbers pull in opposite directions once you serve anything at volume.

## What is a small language model?

A small language model is a language model built to be cheap and fast enough to run on modest hardware: a single GPU, a laptop or even a phone. There is no official size cutoff. The open models below range from about 1 billion to 12 billion parameters, and in a hosted model family "small" usually just means the fastest, cheapest tier, such as Claude Haiku.

Fewer parameters mean less memory, lower latency and a lower price per token. An open model that fits on your own hardware also runs with no per-token API bill and without sending data to anyone else. The price is a lower ceiling on open-ended reasoning and broad knowledge, and most of this guide is about managing that trade.

### Small language model examples

- **Microsoft Phi-4-mini**: a 3.8B-parameter text model with a 128K-token context window, released in February 2025 under the MIT license, according to its [model card](https://huggingface.co/microsoft/Phi-4-mini-instruct). The Phi-4 family also includes reasoning and multimodal variants.
- **Google Gemma 4 E2B, E4B and 12B**: the [Gemma 4 model card](https://ai.google.dev/gemma/docs/core/model_card_4) lists E2B (2.3B effective parameters, 5.1B with embeddings) and E4B (4.5B effective, 8B with embeddings) with a 128K context window, plus an 11.95B model with 256K. All three accept text, images and audio, under Apache 2.0.
- **Meta Llama 3.2 1B and 3B**: text-only models of 1.23B and 3.21B parameters with a 128K context window, released in September 2024. They use the Llama 3.2 Community License, a custom license under which companies whose products had more than 700 million monthly active users must request a license from Meta, per the [model card](https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct).
- **Qwen3-4B**: a 4.0B-parameter model from the Qwen team with a native 32,768-token context window, extendable to 131,072 tokens, under Apache 2.0, per its [model card](https://huggingface.co/Qwen/Qwen3-4B).

Those details are as of November 2026 and come from each developer's model card. Check the license as carefully as the size: MIT and Apache 2.0 are permissive, while a custom license like Llama's adds conditions you should read before you ship. If you want to run one of these on your own machine, our guide to the [best local LLM](https://geeklyplug.com/blogs/best-local-llm/) matches models to 8 GB through 80 GB setups and shows how to install them with Ollama.

## Small language models vs LLMs: what actually differs

Whether the small model is an open one you host or the cheapest tier of an API, the trade against a large model looks the same.

*Small language models vs large language models in production*

|  | Small language model | Large (frontier) model |
| --- | --- | --- |
| Cost per token | Lowest tier, often 4x to 10x cheaper | Highest tier |
| Latency | Fast, good for real-time UX | Slower, especially with long reasoning |
| Strong at | Classification, extraction, formatting, short answers with context | Ambiguous requests, multi-step reasoning, novel problems |
| Weak at | Open-ended reasoning, thin or missing context | Nothing in particular, except cost at volume |
| Best use | The routine majority of requests | The hard or high-stakes minority |

## What LLM inference actually costs

Price differences between tiers are large enough to change architecture decisions. Here are Anthropic's list API prices as a reference point; other providers show a similar spread between their small and large tiers.

*Claude API list prices per million tokens (MTok) at last update*

| Model tier | Input per MTok | Output per MTok | Relative input cost |
| --- | --- | --- | --- |
| Claude Haiku 4.5 (small) | $1 | $5 | 1x |
| Claude Sonnet 5 (mid) | $2 | $10 | 2x |
| Claude Opus 5.5 (large) | $4 | $20 | 4x |
| Claude Fable 5.1 (frontier) | $10 | $50 | 10x |

Prices are from Anthropic's [pricing page](https://platform.claude.com/docs/en/about-claude/pricing) and change often, so check before you budget. Batch processing halves both input and output prices for work that does not need an instant answer, and prompt caching makes repeated context, such as a long system prompt, far cheaper on every call after the first.

## A worked monthly cost example

Take a support assistant handling 400,000 conversations a month. Each conversation averages six turns, each turn sends about 2,000 tokens of context and gets about 150 tokens back. That is 4.8 billion input tokens and 360 million output tokens a month, before any business logic.

*Monthly cost for 4.8B input and 360M output tokens at list prices*

| Setup | Input cost | Output cost | Monthly total |
| --- | --- | --- | --- |
| Everything on the large model (Opus 5.5) | $19,200 | $7,200 | $26,400 |
| Everything on the mid model (Sonnet 5) | $9,600 | $3,600 | $13,200 |
| Everything on the small model (Haiku 4.5) | $4,800 | $1,800 | $6,600 |
| Routed: 85% small, 15% large | $6,960 | $2,610 | $9,570 |

The routed setup costs about 64 percent less than sending everything to the large model, and it keeps the large model on the conversations most likely to need it. Running everything on the small model is cheaper still, but that is usually where quality drops and the savings get eaten by retries, escalations and refunds.

> **Measure the right denominator**
>
> Cost per token is the wrong metric. Cost per successfully resolved request is the right one. A cheaper model that triggers a retry, a human handoff or a refund is not cheaper.

### Real test results: when does a cheaper model stop saving money?

Routing tables like the one above assume the small model's answers are good. In practice some fail, and with a fallback you pay for both attempts. We wrote a short model of one conversation from the example above (12,000 input and 900 output tokens) and ran it to find the break-even point, then added the cost of a human handoff when a bad answer slips through. The $4 handoff cost is our assumption; use your own support cost.

```python
# Cost per resolved conversation when the small model sometimes fails
# and the request is retried on the large model (fallback).
# Prices: USD per million tokens (input, output), from the table above.
SMALL = (1, 5)      # Haiku 4.5
LARGE = (4, 20)     # Opus 5.5
IN_TOK, OUT_TOK = 12_000, 900   # one conversation: 6 turns x 2,000 in, 150 out

def cost(price):
    return (IN_TOK * price[0] + OUT_TOK * price[1]) / 1_000_000

small, large = cost(SMALL), cost(LARGE)
print(f"Large only: ${large:.4f} per conversation")
print(f"Small only: ${small:.4f} per conversation\n")
print("Small-model fail rate -> cost with fallback to large, saving vs large only")
for fail in (0.0, 0.05, 0.10, 0.20, 0.40, 0.60, 0.75, 0.80):
    c = small + fail * large          # every failure pays for both attempts
    print(f"  {fail:4.0%}  ${c:.4f}   {1 - c/large:6.1%}")
print(f"\nBreak-even fail rate: {1 - small/large:.0%}")

# Now add the cost of a human handoff when a bad answer slips through.
HANDOFF = 4.00   # USD per escalated conversation (assumed agent cost)
print("\nExtra escalations caused by the small model -> added cost per conversation")
for esc in (0.005, 0.01, 0.02):
    print(f"  {esc:.1%} more handoffs adds ${esc*HANDOFF:.4f}, vs ${large - small:.4f} saved on tokens")
```

*breakeven.py: cost per conversation with fallback and human handoffs (tested with Python 3.13)*

```text
Large only: $0.0660 per conversation
Small only: $0.0165 per conversation

Small-model fail rate -> cost with fallback to large, saving vs large only
    0%  $0.0165    75.0%
    5%  $0.0198    70.0%
   10%  $0.0231    65.0%
   20%  $0.0297    55.0%
   40%  $0.0429    35.0%
   60%  $0.0561    15.0%
   75%  $0.0660     0.0%
   80%  $0.0693    -5.0%

Break-even fail rate: 75%

Extra escalations caused by the small model -> added cost per conversation
  0.5% more handoffs adds $0.0200, vs $0.0495 saved on tokens
  1.0% more handoffs adds $0.0400, vs $0.0495 saved on tokens
  2.0% more handoffs adds $0.0800, vs $0.0495 saved on tokens
```

*Output*

Two results are worth knowing before you pick a model. First, on token cost alone the small model keeps saving money until three in four of its answers fail, so retries are rarely what sinks a routing plan. Second, quality failures that reach people are far more expensive than tokens: in this example, just over 1.2 percent extra handoffs wipes out the entire token saving. That is why the next section is about measuring quality, not price.

## How LLM routing works

![Flow diagram: requests enter a router that checks context, length, reasoning needs and error cost, then sends about 85 percent to a small model and about 15 percent to a large model, with a fallback path from small to large](https://geeklyplug.com/images/blog/llm-routing-diagram.svg)

*A rules-based router in front of two model tiers, with a fallback when the small model is not confident.*

Most request volume in a real product is routine: classification, extraction, reformatting, short answers with a retrieved document already in context. A small model handles those well. The interesting minority is where you spend: ambiguous intent, multi-step reasoning, anything where being wrong is expensive.

```typescript
type Tier = "small" | "large";

type Task = {
  hasRetrievedContext: boolean;
  expectedTokens: number;
  requiresMultiStepReasoning: boolean;
  errorCostUsd: number;
};

function route(task: Task): Tier {
  if (task.requiresMultiStepReasoning) return "large";
  if (task.errorCostUsd > 50) return "large";
  // Long answers with no supplied context lean on broad knowledge.
  if (!task.hasRetrievedContext && task.expectedTokens > 800) return "large";
  return "small";
}
```

*A rules-based router is usually enough to start*

The router does not need to be clever. A handful of deterministic rules over metadata you already capture gets most of the benefit. Add a fallback so that when the small model's answer fails a validation check, or it signals low confidence, the request is retried on the large model. That single fallback protects quality while the rules do the saving.

Published research backs the approach. The [RouteLLM](https://www.lmsys.org/blog/2024-07-01-routellm/) project from LMSYS reported cost reductions of over 85 percent on MT Bench, 45 percent on MMLU and 35 percent on GSM8K compared with sending everything to GPT-4, while still achieving 95 percent of its performance. Earlier, the [FrugalGPT](https://arxiv.org/abs/2305.05176) paper from Stanford showed that cascading cheaper models before an expensive one could match the best single model with up to 98 percent lower cost on its test tasks.

## How to prove a small model is good enough

The risk in moving traffic to a small model is not that it fails loudly. It is that it fails quietly, with answers that look fine and are slightly worse. The only protection is measuring quality on your own requests before and after the switch.

1. **Build a test set from real traffic.** Pull 100 to 200 recent requests for one task type, including awkward ones, and keep the large model's answers as a baseline.
2. **Define pass and fail in writing.** For extraction, that might be exact field matches. For support answers, it might be a short rubric: correct, complete, on policy, right tone.
3. **Run the small model on the same inputs.** Score both sets the same way. A large model can do first-pass grading against your rubric, but have a person check a sample of its judgments.
4. **Look at the failures, not just the score.** If the small model fails on one pattern, route that pattern to the large model instead of abandoning the switch.
5. **Ship behind a percentage.** Move 10 percent of live traffic, compare resolution, retry and escalation rates for a week, then widen.

This is also where most of the savings come from in practice. Teams rarely move a whole product to a small model. They move the three or four task types that pass cleanly, and those are usually the highest-volume ones.

### Real test results: four models on 50 maths problems

To show what step 3 looks like, we ran four open models, from a 4.6 GB download to an 8 GB one, on the same 50 randomly chosen grade-school maths problems from the public GSM8K test set, at temperature 0. We ran this test on 28 November 2026 in Google Colab on a free NVIDIA Tesla T4 GPU (16 GB of video memory), using Ollama 0.40.19 to serve the models. The screenshots are cropped from that notebook; the code is exactly what ran.

![Screenshot of a Colab table: gemma4:e2b 46 of 50 correct (92 percent) at 3.1 seconds per question, phi4-mini 45 (90 percent) at 4.6 seconds, gemma4:e4b 46 (92 percent) at 4.5 seconds, gemma4:12b 48 (96 percent) at 8.7 seconds](https://geeklyplug.com/images/blog/tests/gsm8k.webp)

*50 GSM8K problems per model on one T4 GPU.*

The smallest model, Gemma 4 E2B, solved 46 of 50, only two fewer than Gemma 4 12B, and answered in about a third of the time (3.1 seconds per question against 8.7). For a routine, well-defined task, that is exactly the trade this article describes: a small accuracy gap for a large speed and cost saving. Two cautions apply. GSM8K is public and widely used, so models may have seen similar problems in training, which flatters everyone; your own requests are the only test that counts. And a 4-point gap still means two extra wrong answers per 50, so check what those failures would cost you before you switch.

```python
# small vs larger models on 50 grade-school maths problems (GSM8K)
import re, time, random, requests, pandas as pd, subprocess
from datasets import load_dataset
API = "http://localhost:11434/api"
MODELS = ["gemma4:e2b", "phi4-mini", "gemma4:e4b", "gemma4:12b"]
qs = load_dataset("openai/gsm8k", "main", split="test")
random.seed(42)
sample = [qs[i] for i in random.sample(range(len(qs)), 50)]

def gold(a): return float(a.split("####")[-1].strip().replace(",", ""))
def last_number(t):
    nums = re.findall(r"-?\d[\d,]*\.?\d*", t.replace("$", ""))
    return float(nums[-1].replace(",", "").rstrip(".")) if nums else None

rows, examples = [], {}
for m in MODELS:
    subprocess.run(["ollama", "pull", m], capture_output=True)
    correct, secs, toks = 0, 0.0, 0
    for q in sample:
        t0 = time.time()
        r = requests.post(f"{API}/chat", json={
            "model": m, "stream": False, "think": False, "keep_alive": "10m",
            "options": {"temperature": 0, "num_predict": 600},
            "messages": [{"role": "user", "content":
                q["question"] + "\nSolve step by step. End with: Answer: <number>"}]}).json()
        secs += time.time() - t0
        text = r["message"]["content"]; toks += r.get("eval_count", 0)
        ok = last_number(text) == gold(q["answer"])
        correct += ok
        examples.setdefault(m, []).append((q["question"][:80], gold(q["answer"]), last_number(text), ok))
    rows.append({"model": m, "correct_of_50": correct, "accuracy": f"{correct/50:.0%}",
                 "avg_seconds_per_question": round(secs / 50, 1),
                 "avg_output_tokens": round(toks / 50)})
    print(rows[-1])
    requests.post(f"{API}/generate", json={"model": m, "keep_alive": 0})

acc = pd.DataFrame(rows); acc.to_csv("/content/accuracy.csv", index=False)
print(acc.to_string(index=False))
```

*accuracy.py: the exact test we ran in Colab*

## Caching and batching: the two cheaper levers

Routing is not the only way to cut inference cost, and it combines well with two others that need no change in model at all.

- **[Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching)**: if every request repeats the same long system prompt, instructions or reference document, caching that prefix means later calls read it at a fraction of the normal input price. On Anthropic's current price list, cache reads on Haiku 4.5 and Sonnet 5 are billed at one tenth of the base input rate. For context-heavy workloads like the support example above, that can matter as much as routing.
- **[Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing)**: work that does not need an answer in seconds, such as nightly classification, content tagging or evaluation runs, can go through a batch API at half price on both input and output.
- **Shorter context**: sending only the retrieved passages a request needs, instead of whole documents, lowers cost on every tier and often improves accuracy too.

## Why small models got good enough

- **Distillation**: smaller models trained on the outputs of larger ones, a technique formalized in [Hinton, Vinyals and Dean's 2015 paper](https://arxiv.org/abs/1503.02531), now come close to their teachers on narrow tasks.
- **Quantization**: running weights at 4-bit or 8-bit precision cuts memory enough to change which hardware you need. The [QLoRA](https://arxiv.org/abs/2305.14314) paper showed 4-bit fine-tuning can preserve full 16-bit task performance.
- **Better retrieval**: a small model given the right document often beats a large model answering from memory.
- **Better prompts and skills**: precise instructions close much of the gap. A clear prompt, like the ones in our [Claude prompt engineering guide](https://geeklyplug.com/blogs/claude-prompt-engineering/), does more for a small model than for a large one.

## When not to use a small model

- The request is ambiguous and the model has to work out what the user means.
- The answer needs several dependent reasoning steps, such as planning or debugging.
- A wrong answer is costly: legal, financial or medical content, or anything that triggers a refund.
- There is no retrieved context and the task depends on broad knowledge.
- You have not measured quality yet. Start on the large model, collect examples, then move traffic down once you can prove parity.

## How to start cutting LLM costs this month

1. Log every request with its task type, input length and outcome, so you know your real traffic mix.
2. Pick the one or two highest-volume, lowest-risk task types and test them on a small model against a sample of 100 real requests.
3. Add a rules-based router and a fallback to the large model, then track cost per resolved request next to latency and error rate.
4. Turn on prompt caching for shared context and batch processing for anything that can wait.
5. Package repeatable instructions as reusable [Claude Skills](https://geeklyplug.com/blogs/what-are-claude-skills/) so every tier gets the same precise procedure.

The likely end state is not that small models win. It is that the question stops being interesting, the way nobody asks which database you use before asking what you store. Model choice becomes a per-endpoint decision, tracked on a dashboard next to latency and error rate. Teams that build the routing layer early do that calmly; teams that build it late do it under budget pressure. For more on the models and tools behind this, see our [AI guides](https://geeklyplug.com/blogs/ai/).

## Frequently asked questions

### What is a small language model?

There is no fixed cutoff, but the term usually means a model from the cheapest, fastest tier of a family, or an open model small enough to run on a single GPU, laptop or phone, such as Phi-4-mini, Gemma 4 E4B or Llama 3.2 3B. What matters in practice is the price and latency tier, not the parameter count.

### Are small language models good enough for production?

For narrow, well-defined tasks with the relevant context supplied, often yes. They struggle more with ambiguous intent, long chains of reasoning and tasks where a wrong answer is expensive, which is exactly the traffic worth routing to a larger model.

### How much can model routing save?

It depends on how much of your traffic is routine. Research such as RouteLLM reported cost reductions of over 85 percent on one benchmark while keeping 95 percent of GPT-4 quality. Our worked example below lands at about 64 percent with a simple rules-based router.

### Should I build a learned router or use rules?

Start with rules over metadata you already capture, such as task type, input length and the cost of an error. Measure cost per resolved request, then consider a learned router only if the rules leave clear savings on the table.

## Sources

- [GSM8K dataset](https://huggingface.co/datasets/openai/gsm8k), OpenAI, via Hugging Face
- [Ollama model library](https://ollama.com/library), Ollama
- [Pricing](https://platform.claude.com/docs/en/about-claude/pricing), Claude Platform Docs
- [RouteLLM: An Open-Source Framework for Cost-Effective LLM Routing](https://www.lmsys.org/blog/2024-07-01-routellm/), LMSYS Org
- [FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performance](https://arxiv.org/abs/2305.05176), arXiv (Chen, Zaharia, Zou)
- [QLoRA: Efficient Finetuning of Quantized LLMs](https://arxiv.org/abs/2305.14314), arXiv (Dettmers et al.)
- [Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching), Claude Platform Docs
- [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing), Claude Platform Docs
- [Distilling the Knowledge in a Neural Network](https://arxiv.org/abs/1503.02531), arXiv (Hinton, Vinyals, Dean)
- [Phi-4-mini-instruct model card](https://huggingface.co/microsoft/Phi-4-mini-instruct), Microsoft, via Hugging Face
- [Gemma 4 model card](https://ai.google.dev/gemma/docs/core/model_card_4), Google AI for Developers
- [Llama-3.2-1B-Instruct model card](https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct), Meta, via Hugging Face
- [Qwen3-4B model card](https://huggingface.co/Qwen/Qwen3-4B), Qwen, via Hugging Face

## Changelog

- 2026-11-28: Added a tested example: four open models on 50 GSM8K maths problems on a T4 GPU in Google Colab, with a screenshot and code.
- 2026-11-28: Added a tested break-even model showing when a small model stops saving money once retries and human handoffs are counted.
- 2026-09-27: Expanded with a pricing table, a worked cost example, routing research and a when-not-to-use section. Removed an unattributed quote and unsourced savings figures.
- 2026-11-20: Moved the post to /blogs/small-language-models/ with a redirect from the old URL, and added a section defining small language models with verified examples from Microsoft, Google, Meta and Qwen.

---

Source: [Small language models vs LLMs: how routing cuts inference costs](https://geeklyplug.com/blogs/small-language-models/) on GeeklyPlug.
