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: "anthropic/claude-3.5-haiku", inputPer1M: 0.80, outputPer1M: 4.00 },
fallback: { model: "mistralai/codestral-2501", inputPer1M: 0.30, outputPer1M: 0.90 },
retryOnStatus: [429, 500, 502, 503, 529]
};
model_list:
- model_name: production-primary
litellm_params:
model: openrouter/anthropic/claude-3.5-haiku
timeout: 15
- model_name: cost-fallback
litellm_params:
model: openrouter/mistralai/codestral-2501
router_settings:
routing_strategy: latency-based-routing
fallbacks: [{"production-primary": ["cost-fallback"]}]