惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
T
Threatpost
P
Palo Alto Networks Blog
NISL@THU
NISL@THU
O
OpenAI News
Project Zero
Project Zero
G
GRAHAM CLULEY
P
Privacy International News Feed
A
Arctic Wolf
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
S
Security @ Cisco Blogs
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
D
Docker
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
N
Netflix TechBlog - Medium
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
W
WeLiveSecurity
P
Proofpoint News Feed
腾讯CDC
Cloudbric
Cloudbric
S
Secure Thoughts
C
Check Point Blog
博客园 - Franky
T
The Exploit Database - CXSecurity.com
T
Troy Hunt's Blog
GbyAI
GbyAI
Security Archives - TechRepublic
Security Archives - TechRepublic
Application and Cybersecurity Blog
Application and Cybersecurity Blog
月光博客
月光博客
C
Cyber Attacks, Cyber Crime and Cyber Security
I
Intezer
TaoSecurity Blog
TaoSecurity Blog
L
Lohrmann on Cybersecurity
V
Visual Studio Blog
F
Fortinet All Blogs
博客园 - 叶小钗
C
CXSECURITY Database RSS Feed - CXSecurity.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recorded Future
Recorded Future
C
Cisco Blogs
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
The Bottleneck Was Never the Model — It's the Routing Layer
Xidao · 2026-05-07 · via DEV Community

In May 2026, a widely-discussed essay on Hacker News argued that "the bottleneck was never the code" — AI code generation has solved the coding bottleneck, but the real bottlenecks remain in specification, design, review, and deployment.

It resonated with thousands of developers. But there's another bottleneck nobody's talking about enough: the routing layer between your application and the LLM providers.
If you're building anything beyond a ChatGPT wrapper, you already know: models fail, rate limits hit at the worst times, pricing changes overnight, and latency varies wildly depending on region and provider load. The real engineering challenge in 2026 isn't generating code — it's keeping your LLM-dependent production app alive when upstream services go down.

The Production Failure Modes Nobody Warns You About

When you're prototyping with a single LLM provider, everything works. You call the API, you get a response, you move on. But at scale, here's what actually breaks:

1. Provider Outages Are Inevitable

Every major LLM provider has had significant outages in the past year. OpenAI's API has gone down during peak hours. Anthropic's Claude endpoints have experienced multi-hour degradations. Google's Gemini API has had regional availability issues.

If your app depends on a single provider, any outage means your users see errors. Period.

2. Rate Limits Hit at the Worst Moments

Rate limits aren't just about requests-per-second. They're about token limits, concurrent connections, and burst allowances. During a product launch or viral moment, you'll hit limits you never knew existed.

The typical developer response is to implement a simple retry with exponential backoff. That helps, but it doesn't solve the fundamental problem: when the rate limit is a hard ceiling, backoff just means slower failures.

3. Cost Optimization Requires Runtime Routing

Different models have wildly different pricing for the same quality of output. A summarization task might cost $0.001 with DeepSeek R1 but $0.012 with Claude Opus — and the quality difference might be negligible for your use case.

But you can't just pick one model and call it a day. Some tasks genuinely need the more expensive model. The challenge is making that routing decision at runtime, based on the task complexity, not at deploy time.

4. Latency Varies Wildly by Region and Load

A model that responds in 200ms during off-peak hours might take 3 seconds during peak usage. And if you're serving users globally, the network latency to a single-region API endpoint can dominate your total response time.

What a Production-Grade Failover Router Looks Like

Here's the architecture pattern that actually works in production. I've been building and refining this approach across multiple LLM-dependent applications:

import asyncio
import time
from dataclasses import dataclass
from enum import Enum

class CircuitState(Enum):    CLOSED = "closed"       # Normal operation
    OPEN = "open"           # Failing, reject immediately
    HALF_OPEN = "half_open" # Testing if provider recovered

@dataclass
class ProviderHealth:
    name: str
    endpoint: str
    priority: int
    circuit_state: CircuitState = CircuitState.CLOSED
    failure_count: int = 0
    last_failure: float = 0
    success_count: int = 0
    avg_latency_ms: float = 0

    # Circuit breaker config
    failure_threshold: int = 5
    recovery_timeout_sec: int = 60
    half_open_max_calls: int = 3

class LLMFailoverRouter:
    """    Routes LLM requests across multiple providers with:
    - Circuit breaker per provider
    - Priority-based failover
    - Latency tracking
    - Cost-aware routing hints
    """

    def __init__(self, providers: list[ProviderHealth]):
        self.providers = sorted(providers, key=lambda p: p.priority)
        self._latency_buffer: dict[str, list[float]] = {
            p.name: [] for p in providers
        }

    def _is_available(self, provider: ProviderHealth) -> bool:
        if provider.circuit_state == CircuitState.CLOSED:
            return True        if provider.circuit_state == CircuitState.OPEN:
            if time.time() - provider.last_failure > provider.recovery_timeout_sec:
                provider.circuit_state = CircuitState.HALF_OPEN
                provider.success_count = 0
                return True
            return False
        # HALF_OPEN: allow limited calls
        return provider.success_count < provider.half_open_max_calls

    def _record_success(self, provider: ProviderHealth, latency_ms: float):
        provider.failure_count = 0
        provider.success_count += 1        if provider.circuit_state == CircuitState.HALF_OPEN:
            if provider.success_count >= provider.half_open_max_calls:
                provider.circuit_state = CircuitState.CLOSED
        # Update rolling average
        buf = self._latency_buffer[provider.name]
        buf.append(latency_ms)
        if len(buf) > 100:
            buf.pop(0)
        provider.avg_latency_ms = sum(buf) / len(buf)

    def _record_failure(self, provider: ProviderHealth):
        provider.failure_count += 1
        provider.last_failure = time.time()        if provider.failure_count >= provider.failure_threshold:
            provider.circuit_state = CircuitState.OPEN

    async def route(self, request_fn, **kwargs):
        """
        Try providers in priority order with failover.
        request_fn: async callable that takes (provider_endpoint, **kwargs)
        """
        errors = []
        for provider in self.providers:
            if not self._is_available(provider):
                continue
            start = time.monotonic()
            try:
                result = await request_fn(provider.endpoint, **kwargs)                latency_ms = (time.monotonic() - start) * 1000
                self._record_success(provider, latency_ms)
                return {
                    "result": result,
                    "provider": provider.name,
                    "latency_ms": round(latency_ms, 1),
                }
            except Exception as e:
                self._record_failure(provider)
                errors.append((provider.name, str(e)))
                continue
        raise Exception(f"All providers failed: {errors}")

Enter fullscreen mode Exit fullscreen mode

This is a simplified version of what I've been running in production. The key insight: treat your LLM providers like you'd treat database replicas. Each one can fail independently, and your routing layer needs to handle that transparently.

The Hidden Cost of Static Model Selection

Most teams pick a model during development and stick with it. This seems reasonable — you've tested your prompts, you've validated the outputs, it works. But it's costing you money and reliability.
Consider this real-world example. A content moderation pipeline I worked with was using Claude Sonnet for all requests — simple classification, complex analysis, everything. The cost breakdown looked like:

Task Type % of Requests Claude Sonnet Cost Optimal Model Optimal Cost
Simple classification 60% $0.008/call DeepSeek V3 $0.001/call
Complex analysis 30% $0.008/call Claude Sonnet $0.008/call
Critical decisions 10% $0.008/call Claude Opus $0.025/call

By routing simple tasks to a cheaper model and reserving Opus for critical decisions, the total cost dropped by 65% while maintaining quality where it mattered.

The trick is building a task classifier that can make this routing decision in real-time, without adding significant latency.

def classify_task_complexity(user_message: str, context: dict) -> str:
    """
    Fast heuristic to route tasks to appropriate model tier.
    Returns: 'simple', 'standard', or 'complex'
    """
    # Simple: short messages, classification keywords, yes/no patterns
    simple_indicators = [        len(user_message) < 100,
        any(kw in user_message.lower() for kw in [
            "classify", "categorize", "is this", "yes or no",
            "label", "tag", "sentiment"
        ]),
        context.get("system_prompt", "").count("\n") < 5,
    ]

    # Complex: long context, multi-step, reasoning required
    complex_indicators = [
        len(user_message) > 2000,
        context.get("token_count", 0) > 4000,
        any(kw in user_message.lower() for kw in [
            "analyze", "compare", "evaluate", "reason through",
            "write a detailed", "comprehensive"        ]),
    ]

    if sum(complex_indicators) >= 2:
        return "complex"
    if sum(simple_indicators) >= 2:
        return "simple"
    return "standard"

Enter fullscreen mode Exit fullscreen mode

What to Monitor (and What Most People Miss)

Observability for LLM applications goes beyond "did the API call succeed." Here's what you actually need to track:

Per-provider metrics:

  • P50/P95/P99 latency (not just average)
  • Error rate by error type (429 rate limit vs 500 server error vs timeout)
  • Token throughput (tokens/second)
  • Cost per request (input + output tokens × price)

Routing metrics:- Failover frequency (how often your backup providers are used)

  • Circuit breaker trips (which providers are degrading)
  • Task complexity distribution (are you routing efficiently?)

Business metrics:

  • Cost per user action (not per API call)
  • Quality score by model (A/B test results)
  • Time-to-first-token for user-facing applications The metric most people miss: cost per successful user action. An API call that fails and retries costs 2x. A call that routes to a more expensive model when a cheaper one would suffice costs 5-10x. But a call that fails completely and loses a user costs infinity.

The Multi-Provider Setup Checklist

If you're setting up multi-provider LLM routing for the first time, here's the order I'd recommend:

  1. Start with two providers minimum — pick one primary and one backup from different vendors (e.g., Anthropic + DeepSeek, or OpenAI + Google)
  2. Implement basic health checks — ping each provider's endpoint every 30 seconds, track response time and error rate

  3. Add circuit breaker logic — when a provider fails 5+ times in a minute, stop sending requests for 60 seconds, then probe with a single request

  4. Build the routing layer — use the pattern above, starting with simple priority-based failover before adding cost optimization

  5. Add observability — instrument everything from day one. You can't optimize what you can't measure

  6. Test failover regularly — don't wait for a real outage. Simulate provider failures in staging to verify your circuit breakers work

The Infrastructure Shift Nobody Expected

Looking at the broader picture: Anthropic just leased SpaceX's Colossus-1 data center with 220,000+ GPUs. OpenAI partnered with AMD, Broadcom, Intel, Microsoft, and NVIDIA on a new networking protocol for their Stargate supercomputer. Google released multi-token prediction for Gemma 4, achieving 3x speed boosts.
The infrastructure is scaling massively, but the routing and orchestration layer hasn't kept up. Most developers are still making single-provider API calls like it's 2024. The gap between "works in development" and "survives production" is widening.

If you're building LLM-dependent applications in 2026, your routing layer is your most important piece of infrastructure. Treat it that way.

Tools That Help

For those looking to implement this pattern without building from scratch, there are several options:

  • Open-source routers like LiteLLM provide multi-provider proxying with basic failover
  • API gateways with LLM-specific features are emerging — some offer unified billing, automatic failover, and cost optimization across providers
  • Self-hosted solutions give you full control over routing logic and data privacy

The key is choosing a solution that supports OpenAI-compatible endpoints, since that's become the de facto standard for LLM API integration. This lets you swap providers without changing your application code.

Discussion

What's your experience with LLM provider reliability in production? Have you implemented multi-provider routing, or are you still running on a single provider?

I'm particularly curious about:

  • How do you handle prompt compatibility differences between providers?
  • What's your strategy for testing output quality across different models?
  • Have you found cost-optimization routing worth the added complexity?

This article reflects production experience building LLM-dependent applications. The failover router code is a simplified version of patterns used in real deployments.