Smart Router Configuration & Cost Failover: Google Gemini 4 Neon (google/gemini-4-neon) to Gemini 4 Carbon (google/gemini-4-carbon)
Production LLM API routing configuration, TTFT latency SLA (<400ms), and contribution margin failover benchmark generated by TokenMargin.dev.
1. Pricing & Latency Benchmark Summary
- Primary Model (Google Gemini 4 Neon — google/gemini-4-neon): $3.00 / 1M input tokens, $15.00 / 1M output tokens | TTFT: 145ms | Throughput: 195 tok/s
- Fallback Model (Gemini 4 Carbon — google/gemini-4-carbon): $2.00 / 1M input tokens, $10.00 / 1M output tokens | TTFT: 210ms | Throughput: 155 tok/s
2. Zero-Dependency TypeScript / Node.js Smart Router Configuration
export const SMART_ROUTER_CONFIG = {
slaMaxTtftMs: 400,
primary: { model: "google/gemini-4-neon", inputPer1M: 3.00, outputPer1M: 15.00 },
fallback: { model: "google/gemini-4-carbon", inputPer1M: 2.00, outputPer1M: 10.00 },
retryOnStatus: [429, 500, 502, 503, 529]
};
3. LiteLLM / OpenRouter YAML Router Configuration (config.yaml)
model_list:
- model_name: production-primary
litellm_params:
model: openrouter/google/gemini-4-neon
timeout: 15
- model_name: cost-fallback
litellm_params:
model: openrouter/google/gemini-4-carbon
router_settings:
routing_strategy: latency-based-routing
fallbacks: [{"production-primary": ["cost-fallback"]}]
⚡ Ready for Production Deployment?
Download Full Production TypeScript Failover Gateway + CI Token Guardrails
Includes zero-dependency circuit-breaker router, Redis semantic cache docker-compose & CFO board audit spreadsheet.