Production LLM API routing configuration, TTFT latency SLA (<400ms), and contribution margin failover benchmark generated by TokenMargin.dev.
export const SMART_ROUTER_CONFIG = {
slaMaxTtftMs: 400,
primary: { model: "openai/gpt-4o-mini", inputPer1M: 0.15, outputPer1M: 0.60 },
fallback: { model: "openai/gpt-4.1-nano", inputPer1M: 0.10, outputPer1M: 0.40 },
retryOnStatus: [429, 500, 502, 503, 529]
};
model_list:
- model_name: production-primary
litellm_params:
model: openrouter/openai/gpt-4o-mini
timeout: 15
- model_name: cost-fallback
litellm_params:
model: openrouter/openai/gpt-4.1-nano
router_settings:
routing_strategy: latency-based-routing
fallbacks: [{"production-primary": ["cost-fallback"]}]