๐Ÿ“š More on this topic: Model Routing with Local AI ยท Cost to Run LLMs Locally ยท llama.cpp vs Ollama vs vLLM ยท Planning Tool

Rewritten December 2026.

If you send every task to the most capable model, you pay top-tier prices to check JSON syntax and reformat tables. Most work doesn’t need that. A tiered strategy sends each task to the cheapest model that can do it well, and keeps the expensive model for the decisions where being wrong costs more than the API call.

The idea hasn’t changed since we first wrote this in February. The numbers have. Anthropic’s current lineup is cheaper across the board, the gap between tiers has narrowed at the top and widened at the bottom, and once we measured what our own GPU spends on electricity, “local is free” turned out not to be true. This rewrite redoes the math with prices checked on 1 December 2026, and the routing code at the end is code we ran against the real API.


The tiers, with December 2026 prices

TierModelInput / output per million tokensGood for
1. LocalQwen 3.5 9B, Qwen 3.6-35B-A3B, Gemma 4 26B-A4B (via Ollama or llama.cpp)Electricity only (see below)Formatting, syntax checks, extraction, anything private
2. Fast and cheapClaude Haiku 5.5 (claude-haiku-5-5)$0.10 / $0.50Classification, short summaries, simple Q&A, data extraction
3. CapableClaude Sonnet 5.5 (claude-sonnet-5-5)$2 / $10Most coding, analysis and writing
4. TopClaude Opus 5.5 (claude-opus-5-5)$4 / $20Security review, architecture, high-stakes reasoning
Above the topClaude Fable 5.2 (claude-fable-5-2)$8 / $40The hardest long-running agentic and reasoning work

Prices are from Anthropic’s pricing page on 1 December 2026. Haiku 5.5’s price is for prompts up to 100,000 tokens; longer prompts cost $0.50 / $2.50, five times as much, so watch the prompt size if you route long documents to it.

Three things stand out compared with a year ago:

  • The bottom tier got very cheap. Opus 5.5 costs 40 times as much as Haiku 5.5 per token, on both input and output.
  • The top tier got closer to the middle. Opus 5.5 is exactly twice the price of Sonnet 5.5. Escalating from Sonnet to Opus for a task that matters is a smaller decision than it used to be.
  • Output tokens include thinking. All three current models think before answering by default, and that reasoning is billed as output. The effort setting controls how much they think, which makes it a cost lever in its own right (more below).

What a task actually costs

Assume a typical task sends 1,500 tokens and gets 500 back (including any thinking). Per 1,000 tasks:

ModelPer 1,000 tasks
Local: electricity only, Qwen3.8-27B UD-Q4_K_XL on an RTX 3090 at 350 W, $0.20/kWh (excludes hardware and idle power)$0.26
Haiku 5.5$0.40
Sonnet 5.5$8.00
Opus 5.5$16.00
Fable 5.2$32.00

A tiered mix of 40% local, 40% Haiku, 15% Sonnet and 5% Opus comes to $2.26 per 1,000 tasks: 86% less than sending everything to Opus 5.5, and 72% less than sending everything to Sonnet 5.5.

Per month, at 30 days:

UsageTasks per dayAll Opus 5.5All Sonnet 5.5All Haiku 5.5Tiered mix
Light50$24.00$12.00$0.60$3.39
Medium200$96.00$48.00$2.40$13.57
Heavy500$240.00$120.00$6.00$33.93

Computed from unrounded per-task costs (the mix is $2.2622 per 1,000 tasks), so the tiered column is a few cents off $2.26 times the task count.

These are straight arithmetic from the assumptions above, and the calculation script is published so you can change them. Your real costs depend on your prompt sizes and on how much the models think.

Local isn’t free

The local row needs explaining, because the old version of this page said local costs nothing. It doesn’t. In our power measurements, an RTX 3090 capped at 350 W used 8.48 joules per generated token running Qwen3.8-27B, a dense 27B model, at the UD-Q4_K_XL quant in llama.cpp, one request at a time. That’s about 2.4 kWh per million output tokens, or $0.47 per million in electricity at $0.20/kWh.

That figure is electricity only, and only the GPU board’s draw while generating. It leaves out the cost of the GPU and the rest of the machine, the power the system draws while idle between requests, and the CPU, RAM and PSU losses. It’s also one model on one card: a mixture-of-experts model or a different quant would land somewhere else. So it’s not “the same price as Haiku 5.5”, whose $0.50 per million output tokens is the whole cost. The fair reading is narrower: for a dense model of this size, the electricity alone for generating tokens is already in the same range as Haiku 5.5’s price, so a local tier doesn’t win on running cost unless the hardware is already paid for and sitting there.

So the reasons to keep a local tier in 2026 aren’t mainly about money:

  • Privacy. The prompt never leaves your machine. For client files, medical notes or unreleased code, that’s the deciding factor. See our privacy guide.
  • No rate limits, no outages, works offline.
  • Hardware you already own. If the GPU is sitting there, its electricity is the only marginal cost, and a mixture-of-experts model like Qwen 3.6-35B-A3B generates tokens several times faster than a dense 27B on the same card, which should cut energy per token too (we haven’t measured that model’s power draw).

If none of those apply to you, Haiku 5.5 is a perfectly good bottom tier on its own.


Tier 1: local models

Local models handle mechanical work well: checking whether JSON is valid, converting a list into a table, pulling dates out of text, filling templates, simple lookups. In our routing test below, a local Qwen 3.5 9B correctly spotted the trailing comma in {"a": 1,}.

Current picks, by VRAM:

VRAMModelOllama tagSpeed we measured
8-12 GBQwen 3.5 9Bqwen3.5:9bnot benchmarked by us
12 GBQwen 3.6-35B-A3B, with experts offloaded to system RAMqwen3.6:35b-a3b38.9 tok/s on an RTX 3060 12 GB (llama.cpp)
16 GBGemma 4 26B-A4B (QAT)gemma4:26b-a4b-it-qatnot benchmarked by us
24 GBQwen 3.6-35B-A3B, fully on the GPUqwen3.6:35b-a3b184 tok/s on an RTX 3090 (llama.cpp)
24 GBQwen 3.6-27B (dense)qwen3.6:27b41.8 tok/s on an RTX 3090 (llama.cpp)

Speeds are generation speeds from our benchmark records, measured with llama.cpp; Ollama uses its own engine, so treat them as a guide. Install Ollama, then ollama pull qwen3.5:9b or whichever fits your card.

Don’t send local models anything where being wrong has consequences: multi-step reasoning, security decisions, or questions that need broad, current knowledge.


Tier 2: Haiku 5.5

For tasks with a clear right answer and little judgment: is this email spam, summarize this paragraph, extract these fields, explain what a mutex does. In our test, Haiku 5.5 at low effort answered the mutex question correctly in 69 output tokens for $0.00004.

Two cautions. Prompts over 100,000 tokens cost five times as much on Haiku 5.5, so don’t route giant documents to it on autopilot. And when Haiku hedges, contradicts itself or misses the point, escalate rather than retrying.


Tier 3: Sonnet 5.5

The workhorse: refactoring a function, reviewing a pull request, writing documentation, debugging a failing test, comparing two designs. Most real work belongs here. Escalate to Opus for security, architecture, money handling and anything legal.


Tier 4: Opus 5.5 (and Fable 5.2 above it)

Reserve Opus 5.5 for tasks where a mistake is expensive:

CategoryExamples
SecurityAuth flows, input validation, encryption, API security review
MoneyPayment processing, billing logic, financial calculations
Legal and complianceRegulatory code, terms, compliance checks
ArchitectureSystem design, database schema, API contracts
Data integrityMigrations, transformations, backup logic
Novel problemsThe first time you solve this kind of problem

The 10x rule still applies: if fixing a mistake would cost ten times the price difference between tiers, use the better model. At 1,500 tokens in and 500 out, Opus 5.5 costs $0.016 per task against Sonnet 5.5’s $0.008. A security bug in production costs incomparably more.

Fable 5.2 sits above Opus at twice its price. It’s built for the hardest long-running work, and most people building a router won’t need it as a regular tier.


Before you build a router: three cheaper levers

Routing isn’t the only way to cut the bill, and sometimes it isn’t the best one.

  1. Lower the effort before you switch models. The effort setting controls how much a model thinks, and thinking is billed as output. A better model at low effort is sometimes a better deal than a weaker model at high effort, and it’s one model to maintain instead of four. Test it on your own tasks. Changing effort mid-conversation can invalidate the prompt cache, so pick a level per route and keep it.
  2. Cache the repeated part of your prompts. If every request starts with the same long system prompt or document, prompt caching bills those cached tokens at a fraction of the input price: $0.20 per million on Opus 5.5 and $0.10 on Sonnet 5.5 (5% of their input price), and $0.01 on Haiku 5.5 (the standard 10%). The two rates differ on purpose: Anthropic’s pricing page puts Opus 5.5 and Sonnet 5.5 on a lower cache-hit multiplier than its other models.
  3. Batch anything that can wait. The Batch API halves both input and output prices for requests that don’t need an answer right away.

The escalation pattern

Start at the cheapest tier that might work, and move up only when you have to.

Task arrives
  โ†“
Mechanical or private? (format, syntax, extraction, sensitive data) โ†’ local
  โ†“ no
Clear right answer, little judgment? (classify, summarize, simple Q&A) โ†’ Haiku 5.5
  โ†“ no
Everyday work? (code, analysis, writing) โ†’ Sonnet 5.5
  โ†“ no, or it matters a lot
Security, money, architecture, legal โ†’ Opus 5.5

Escalate when a tier’s answer is cut off, empty, hedged, inconsistent, or plainly wrong.


Routing code (tested)

This is a minimal router in Python with the Anthropic SDK and the Ollama Python library. You pick the starting tier, and it moves up one tier if an answer comes back cut off or empty. It also reports what each call cost.

pip install anthropic ollama
export ANTHROPIC_API_KEY=...        # from the Claude Console
ollama pull qwen3.5:9b
import anthropic
import ollama

# USD per million tokens (input, output), Anthropic pricing page, 1 December 2026.
# Haiku 5.5's price is for prompts up to 100,000 tokens; above that it's $0.50 / $2.50.
PRICES = {
    "claude-haiku-5-5": (0.10, 0.50),
    "claude-sonnet-5-5": (2.00, 10.00),
    "claude-opus-5-5": (4.00, 20.00),
}

# tier -> (model, effort). "local" runs on your own GPU through Ollama.
TIERS = {
    "local":    ("qwen3.5:9b", None),
    "simple":   ("claude-haiku-5-5", "low"),
    "standard": ("claude-sonnet-5-5", "medium"),
    "critical": ("claude-opus-5-5", "high"),
}
ORDER = ["local", "simple", "standard", "critical"]

client = anthropic.Anthropic()  # reads ANTHROPIC_API_KEY from the environment


def ask(tier: str, prompt: str, max_tokens: int = 2048) -> tuple[str, float, bool]:
    """Run one prompt on one tier. Returns (answer, cost in USD, finished cleanly)."""
    model, effort = TIERS[tier]
    if tier == "local":
        r = ollama.chat(model=model, messages=[{"role": "user", "content": prompt}], think=False)
        # electricity not counted here; see 'Local isn't free'
        return r.message.content, 0.0, r.done_reason == "stop"
    r = client.messages.create(
        model=model,
        max_tokens=max_tokens,
        output_config={"effort": effort},
        messages=[{"role": "user", "content": prompt}],
    )
    text = "".join(b.text for b in r.content if b.type == "text")
    price_in, price_out = PRICES[model]
    cost = (r.usage.input_tokens * price_in + r.usage.output_tokens * price_out) / 1_000_000
    return text, cost, r.stop_reason == "end_turn"


def route(prompt: str, start: str = "simple") -> str:
    """Start at a tier and move up one tier at a time if the answer comes back cut off or empty."""
    for tier in ORDER[ORDER.index(start):]:
        answer, cost, ok = ask(tier, prompt)
        print(f"[{tier}: {TIERS[tier][0]}, ${cost:.5f}]")
        if ok and answer.strip():
            return answer
    raise RuntimeError("no tier produced a complete answer")


if __name__ == "__main__":
    print(route("Is this valid JSON? Answer yes or no: {\"a\": 1,}", start="local"))
    print(route("In one sentence: what does a mutex do?", start="simple"))
    print(route("In two sentences: when is optimistic locking a bad idea?", start="standard"))
    print(route("In two sentences: what is the main risk of storing session tokens in localStorage?", start="critical"))

What happened when we ran it (1 December 2026, anthropic 2.16.0, full record):

RouteModelInput / output tokensCost
JSON checkqwen3.5:9b, localn/a$0 (answered “no”, correctly)
MutexHaiku 5.5, low effort22 / 69$0.00004
Optimistic lockingSonnet 5.5, medium effort28 / 116$0.00122
localStorage tokensOpus 5.5, high effort33 / 125$0.00263

All four answered correctly on their starting tier, so the escalation never fired, and the whole run cost $0.0039. A few notes on the code:

  • stop_reason == "end_turn" is the check for a clean finish. Anything else (hitting max_tokens, a refusal) counts as a failure and moves the task up a tier.
  • The cost is computed from the usage the API returns, so it includes thinking tokens.
  • Keyword routing (picking the tier from words in the prompt) is easy to add in front of route(), but it’s brittle. A cheaper and more reliable approach for many apps is to have Haiku classify the task first, or simply let each part of your app call the tier it needs.
  • In production you’d also want retries, logging and a budget cap. The SDK retries rate limits and server errors on its own.

For agents that pick models per step, see our model routing guide.


Common mistakes

Routing everything to the cheapest tier. Wrong answers you have to check and fix cost more than the API call you saved.

Being afraid of the top tier. Skipping Opus on a security review to save $0.008 a task is false economy.

No way up. Accepting a weak Haiku answer instead of escalating.

Ignoring thinking tokens. A cheap model at maximum effort can produce more billed output than you expect. Set effort per tier.

Context bloat. Sending 50,000 tokens of context when 5,000 would do costs ten times as much on every tier. Trim, and cache what you can’t trim.


Bottom line

Send each task to the cheapest model that can do it well: local or Haiku 5.5 for mechanical work, Sonnet 5.5 for most real work, Opus 5.5 when a mistake would be expensive. In December 2026 Haiku 5.5’s per-token price is in the same range as the electricity alone for a dense 27B on a 3090 (before hardware and idle power), so keep a local tier for privacy, offline work or hardware you already own, not to save money. Try lowering effort, caching and batching before you build anything elaborate. And when you do build a router, check what it actually costs, because the usage field tells you.