When multiple AI agents, developer assistants, and data pipelines depend on a single LiteLLM proxy in front of cloud providers and local GPU models, outages rarely look like HTTP 502s.
In production, our gateway kept answering /health with 200 OK while:
- The router rejected 39% of generation requests over a 24-hour window (
92%in the worst half hour in gateway logs). - A provider silently routed an existing model name to a newer version—no errors appeared, yet our downstream scorer pass rate dropped from 10–11% to 5.9%, then ~3%.
- Gateway cost accounting logged 61% of actual official provider spend because manual rates masked updated off-peak/peak pricing (making per-key budgets 1.65× softer).
- Passing OpenAI-compatible
chat_template_kwargs: {"thinking": false}returned HTTP 200—while still burning 146 reasoning tokens on DeepSeek V4 and truncating short outputs.
Here is the diagnostic breakdown and the outcome-based checks we put in place. (Full postmortem and reference table: Softenq Engineering Case Study.)
1. Cooldowns & Daily Token Caps Hidden Behind Green Probes
In LiteLLM, callers request a logical model group, and the router picks a deployment, retries on failure, and puts noisy deployments into cooldown.
To prevent exhausted daily-quota models from spinning every minute, we had set allowed_fails: 1 and cooldown_time: 3600 on single-deployment groups without fallbacks. While LiteLLM's design normally avoids cooling down single-deployment groups, when allowed_fails is explicitly configured (fixed upstream later in LiteLLM PR #48644 / LTS 1.108.1 PR #50136), one transient provider 500 disabled the entire group for an hour with "No deployments available for selected model".
At night, the daily token cap configured inside the gateway returned the exact same error string, and our end-to-end probe stayed green because it hit a different model.
Outcome-Based Alert Rule (Prometheus + Grafana)
Resource headroom alerts ("daily pool 90% full") do not measure whether callers succeed. Instead, alert on the failed-request share across the gateway:
- uid: llm-gateway-failure-share
condition: C
data:
- refId: A
model:
# Share of failed requests over 1h; suppresses denominator noise below ~1 failure per 5m
expr: >
(sum(rate(litellm_proxy_failed_requests_metric_total[1h])) > 0.003)
/ clamp_min(sum(rate(litellm_proxy_total_requests_metric_total[1h])), 0.001)
- refId: C
model:
type: threshold
expression: B
conditions:
- evaluator: { type: gt, params: [0.1] }
for: 15m
noDataState: OK
labels:
severity: warning
We updated router settings (allowed_fails raised, cooldown shortened to 10s, automatic retry on 429), separated quota enforcement to the limiter, and locked these invariants in pytest configuration tests so config generators cannot revert them.
Measured impact: Over the next 30 days (5 Oct – 4 Nov 2026), upstream providers produced 3.9% 5xx/timeouts, yet only 0.34% of consumer requests failed. Across 158 of 163 high-error hours (>= 10% upstream errors), consumers saw zero rejections (97%).
2. Silent Model Version Swaps Under an Unchanged Name
Providers occasionally move an existing model identifier to a new release without raising errors. When a downstream pipeline filters incoming materials using LLM scores, a minor scale shift breaks fixed score thresholds completely.
Paired rescoring of 668 items sampled evenly across pre-change score buckets showed:
- Rank ordering stayed nearly identical (Spearman ρ
0.81–0.96across five feeds). - Absolute scores shifted downward by
0.8–1.6points, collapsing pass rates from10–11%to~3%. - Single canary items miss subtle shifts (
9 → 8still passes a threshold of7).
Fix: Recalibrate thresholds via paired rescoring and monitor daily pass-share deviation against the 14-day median, rather than trusting a single synthetic prompt.
3. Stale Spend Accounting & Hidden Health-Check Costs
Explicit pricing fields in LiteLLM model_list override the built-in cost map—and remain static when a provider introduces off-peak discounts or updates tiers. Because our config carried pre-change numbers, tracked gateway spend covered only 61% of official pricing.
Instead of relying on unsynced static tables or letting background health checks ping metered deployments (see LiteLLM issue #49089), we:
- Replaced static rates with a 28-day traffic-weighted blend matching official provider billing.
- Added a CI configuration test asserting every deployed price lies strictly inside
(off_peak, peak)official bounds and stays identical across aliases. - Disabled background self-probes on daily-quota/metered routes.
4. Perimeters (private/*) & Ignored Model Flags
-
Fail-closed isolation: Sensitive internal groups under
private/*must carry zero cloud fallbacks or aliases, pointing exclusively to private/internal GPU addresses—enforced in configuration tests so restricted data never spills outward during local outages. -
Verify flags on live usage tokens: Sending
chat_template_kwargs: {"thinking": false}(used by vLLM/SGLang) to DeepSeek V4 returned HTTP 200 while producing146reasoning tokens; switching to the provider-nativethinking: {"type": "disabled"}cut live reasoning tokens to0(0–0.3%across disabling consumers in logs).
Built and documented by Softenq — enterprise software engineering, self-hosted AI/RAG systems, and observability audits. Read the complete engineering case study with verification tables and code at https://www.softenq.com/cases/llm-gateway-silent-failures/.
Top comments (1)
The outcome-based rule is the right layer. Our equivalent gap was a Postgres deadlock arriving as an ordinary error with no stable code, so callers could not tell it from any other failure. In gophenberg we passed driver errors through classification and mapped dbkit.ErrBusy to 503 database_busy with a stable JSON code; that change covered 53 files. A synthetic health probe still reads green during such an incident, but callers at least get a distinguishable status instead of a generic 500. Worth placing beside your failed-request-share alert, not inside it.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.