2026 · Engineering note · 5 min read

Cost-aware inference routing

Cheap first, smart when needed — with a quality floor that stops the savings from becoming a product incident.

In most production systems, the model choice is a per-request decision, not an architecture decision. A router can send easy requests to a small model and hard ones to a large model, and the cost curve bends without touching the product.

The failure mode is well known: the router is tuned to cost, the quality floor is not measured, and three weeks later the support team notices that short answers got worse.

What we measure

The policy

We start with a classifier on request features (length, language, presence of structured data, historical difficulty for similar requests). Threshold is set so that tier accuracy on the frozen set stays above 97% of the large model's score. If the threshold cannot be met, the router is not worth it.

We also cache aggressively on normalized request hashes, and we log the tier decision with the request id — so when quality drops, we can see whether the router or the model changed.

The result is usually a 30–60% cost reduction with a measurable, defended quality floor. Not free, not magic, but predictable.

← All notes