Skip to content

Model selection: capability, cost and latency

A practical framework for choosing a model per task instead of defaulting to the largest one.

5 MIN READUPDATED 2026-11-18Models & foundations
ORIGINAL DIAGRAM · 4 STEPS1Label each step by2Benchmark a small and3Route simple steps to4Keep a documented fallb…

Original flow diagram from note steps — not a copied image

§ 01Key concepts
Capability tierThe class of tasks a model handles reliably (extraction, reasoning, coding).
Time to first tokenLatency felt by users before streaming begins.
Model routingSending each request to the smallest model that can handle it.
§ 02When to use
  • A workflow has several steps with different difficulty.
  • Cost or latency budgets are tight.
  • You need a fallback when a provider is unavailable.
§ 03How it works
  1. 01Label each step by required capability (classification vs reasoning).
  2. 02Benchmark a small and large model on your own evaluation set.
  3. 03Route simple steps to the smaller model; escalate on low confidence.
  4. 04Keep a documented fallback provider for critical paths.
§ 04Use cases & scenarios

Two-tier ticket triage

Context
A support desk classifies thousands of tickets per day.
Problem
Sending every ticket to a frontier model makes cost per ticket hard to justify.
Approach
Route with a small model and escalate only low-confidence cases to a larger one.
Outcome
Lower cost per correctly resolved ticket with quality held steady.

Customer assistant during a provider outage

Context
A customer-facing assistant depends on a single model provider.
Problem
A latency spike makes the assistant unusable for several minutes.
Approach
Configure a pinned fallback on a different provider and log which tier answered each request.
Outcome
Continuous service with an auditable record of routing decisions.
§ 05Examples

Route ticket classification

ts
async function classify(text: string) {
  const small = await call(smallModel, { text, format: "label" });
  if (small.confidence >= 0.75) return small.label;
  return call(strongModel, { text, format: "label" }); // escalate
}

Measure cost per correctly classified ticket; cheap wrong answers are not savings.

Fallback chain for a customer assistant

yaml
primary:  { model: "pinned-small", timeout_ms: 1500 }
fallback: { model: "pinned-large", provider: "other-vendor" }
record:   [model_version, route_reason, confidence]

Use a different provider for the fallback to reduce correlated outages, and log which tier answered each request.

§ 06Trade-offs

Frontier model everywhere

Up: Highest capability

Down: Highest cost and latency

Small model routing

Up: Fast and cheap

Down: Needs confidence checks and escalation

Self-hosted

Up: Control and data residency

Down: Infrastructure and operations burden

§ 07Implementation checklist
  • Evaluate on your data, not public leaderboards.
  • Measure cost per successful task, not per token.
  • Pin versions and record which model produced each answer.
  • Re-run the benchmark when models change.
§ 08Configuration reference
KeyTypical valueNote
primary_modeltask-specificRecord in one config file.
fallback_modeldifferent providerReduces correlated outages.
confidence_thresholdtask-specificTriggers escalation to a stronger model.
§ 09Troubleshooting
SymptomCauseFix
Costs grew after a model upgradeRouting was removed or thresholds changedRestore per-step routing and review logs.
Fallback never triggersNo health or confidence signalAdd explicit escalation rules.
§ 10Frequently asked questions

Is the biggest model always best?

No. For classification, extraction and formatting, smaller models often match larger ones at a fraction of cost.

How many models should we use?

Usually two or three tiers plus a fallback. More adds operational complexity.

More in Models & foundations