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: "microsoft/phi-4", inputPer1M: 0.06, outputPer1M: 0.14 },
fallback: { model: "meta-llama/llama-3.1-8b-instruct", inputPer1M: 0.03, outputPer1M: 0.05 },
retryOnStatus: [429, 500, 502, 503, 529]
};
model_list:
- model_name: production-primary
litellm_params:
model: openrouter/microsoft/phi-4
timeout: 15
- model_name: cost-fallback
litellm_params:
model: openrouter/meta-llama/llama-3.1-8b-instruct
router_settings:
routing_strategy: latency-based-routing
fallbacks: [{"production-primary": ["cost-fallback"]}]