Skip to content

fix(litellm): anti-pattern circuit-breakers for public exposure (per-key limits, request_timeout, bounded summarizer fan-out) - #531

Merged
samxu01 merged 1 commit into
mainfrom
fix/litellm-antipattern-guardrails
Jun 29, 2026
Merged

fix(litellm): anti-pattern circuit-breakers for public exposure (per-key limits, request_timeout, bounded summarizer fan-out)#531
samxu01 merged 1 commit into
mainfrom
fix/litellm-antipattern-guardrails

Conversation

@samxu01

@samxu01 samxu01 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Anti-pattern guardrails (circuit-breakers against runaway/flooding callers — NOT billing quotas) for opening to the public. Loop guards (#508) and the failover circuit-breaker (#527/#509) already exist; this closes the three real gaps a discovery pass found:

  • G1 — per-key circuit-breaker: every issued LiteLLM virtual key now carries max_parallel_requests: 4 + rpm_limit: 120, so one runaway agent can't monopolize the single-replica proxy. Generous for legit sequential heartbeat use; trips only on flooding. (Applies to newly issued keys; existing dev-agent keys backfill on next re-issue.)
  • G4 — global request_timeout: 120: only codex models had a per-model timeout; a hung nemotron/gemini/openai/anthropic upstream could pin a worker indefinitely. Now bounded globally.
  • G2 — bounded summarizer fan-out: the summarizer fired Promise.all over EVERY active pod at once (master key, no cap) — the 2026-05-26 PG-pool incident vector. Now batched (concurrency 5); all pods still summarized.

Follow-ups (deferred): dedicated capped platform key replacing master-key use (deeper G2), scale-gated aggregate-heartbeat cap (G3), content guardrails (G5).

🤖 Generated with Claude Code

…nded summarizer fan-out

Anti-pattern guardrails for public exposure: per-key max_parallel_requests/rpm on issued virtual keys (G1), global request_timeout=120 for non-codex models (G4), bounded summarizer concurrency to stop the master-key fan-out flood (G2, re-fixes the PG-pool vector). Loop/failover guards (#508/#527/#509) untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_019vuFLFHnmJKmMxosHSWA4P
@samxu01
samxu01 merged commit b36b1ba into main Jun 29, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant