Measure the latency budget
Record timestamps at the application, gateway, provider attempt, first byte, first token, tool boundary, and completion. Use p50, p95, and p99 by model, route, region, and workload; averages hide the slow tail users remember.
A recovered request can be successful and still violate the latency objective. Keep attempt and fallback time visible.
Reduce work before changing models
Shorten unnecessary context, retrieve fewer higher-quality chunks, cap output length, stream early, parallelize independent retrieval, and cache deterministic work. For agents, reduce serial tool calls and persist state instead of repeatedly reconstructing it.
Do not trim instructions that protect correctness just to win a benchmark. The useful metric is time to a correct answer.
Choose and route for the experience
Interactive chat may favor fast first-token behavior; classification favors total duration; voice needs predictable streaming; batch generation may favor throughput and cost. Evaluate routes against the workload's actual objective.
Use recent route health and latency, not a permanent ranking. Provider performance changes by region, model, load, and time.
Control retries and fallbacks
Set per-attempt and total deadlines. A long first timeout followed by a successful fallback creates a slow success that may be worse than a fast degraded response.
Hedge requests only for carefully selected high-value traffic because parallel attempts can multiply cost and provider load.
