fix(litellm): anti-pattern circuit-breakers for public exposure (per-key limits, request_timeout, bounded summarizer fan-out) - #531
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.)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.Promise.allover 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