Commit graph

48400 commits

Author SHA1 Message Date
Kerry Lu
d4e083348c revert: drop the create-release.yml gating and E2E_REDIS_CHAOS opt-in
create-release.yml is back to calling the chaos test through no mechanism at
all; it never called it. Also drops the E2E_REDIS_CHAOS opt-in gate itself:
the redis_chaos marker still exists for -m selection and is still excluded
from the per-PR selector by path (tests/e2e/(ui|claude_code|load)/), but the
test no longer needs an env var to run once its file is targeted.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 15:16:00 -07:00
Kerry Lu
7d8f2c9ad3 ci(e2e): drop the weekly cron for the Redis chaos test
Now that create-release.yml gates stable and RC releases on this test directly,
the weekly schedule is redundant: every release gets a run against its own
commit instead of whatever happened to be on the default branch that Saturday.
workflow_dispatch stays for manual runs.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 15:00:57 -07:00
Kerry Lu
39324dc960 ci(release): rename redis-chaos-gate to redis-chaos-check
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 14:59:35 -07:00
Kerry Lu
445b45f261 ci(release): rename the tag-classification job to run-stable-release-checks
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 14:55:59 -07:00
Kerry Lu
7ebf60f33e ci(release): rename the tag-classification job to classify-if-stable-release
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 14:49:59 -07:00
Kerry Lu
cdf8a8cab8 ci(release): rename the tag-classification job to prepare
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 14:47:57 -07:00
Kerry Lu
9d91aff249 ci(release): rename the tag-decision job to stable-release-gate
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 14:43:47 -07:00
Kerry Lu
93c8ef1beb docs(e2e): note the release gate in the load/ harness guide
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 14:40:08 -07:00
Kerry Lu
a8d0171800 ci: gate stable and RC releases on the Redis chaos load test
The chaos test only ran on a weekly cron, so a release could be cut from a
commit it had never covered. Making it callable lets create-release.yml run it
against the exact commit being tagged and refuse to tag if it fails.

Dev, nightly, alpha and beta tags skip the gate: they are cut far more often
than stable and RC tags, and the weekly schedule already covers the default
branch. Input validation moves into the gate job so a malformed tag or SHA
fails before spending a multi-minute chaos run.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 14:38:10 -07:00
Kerry Lu
0ea18f28af test(e2e): tighten chaos log-bytes ceiling to 10 KB per request
Local runs measured 3.5 KB per request, so 10 KB keeps close to 3x headroom
while tightening from the earlier 12 KB.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 13:45:42 -07:00
Kerry Lu
a1f9f4cbe8 test(e2e): tighten chaos latency ceilings to 1s/2s/3s
Local runs measured p50 0.19s, p90 0.23s, p99 0.69s, so 2s/3s/5s left several
times that as slack. 1s/2s/3s keeps a comfortable margin while catching a
smaller regression than the looser ceilings would have.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 13:45:11 -07:00
Kerry Lu
e81a788776 test(e2e): hold chaos CPU per request to 2x
Three local runs measured 1.33x-1.36x, so 2x is the tightest bound the data
supports and still catches a regression far smaller than 4x would. Noted in the
comment that this is the ceiling to loosen first if a weekly run trips it,
since core count shifts how much of baseline CPU is fixed per-request work.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 13:43:53 -07:00
Kerry Lu
1d71006567 test(e2e): tighten chaos RSS and CPU ceilings to what runs actually measured
RSS moved 0.91x-1.40x across three identical local runs, so it stays loose at
2x rather than the arbitrary 1.5x carried over from the pre-padding-payload
calibration. CPU per request held steady at 1.33x-1.36x across the same runs,
so 4x replaces the looser 6x it inherited from stale numbers.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 13:43:18 -07:00
Kerry Lu
cc1d2c66c8 test(e2e): bound chaos latency and log volume with flat ceilings
A ratio against the healthy phase cannot bound either metric. Once the Redis
circuit breaker opens, a request skips Redis instead of waiting on its socket
timeout, so the chaos phase can measure cheaper than the baseline it is compared
against: local runs came in at 0.61x baseline p90 while a log-bytes ratio read
724x. Splitting Budget into RatioBudget and AbsoluteBudget lets RSS and CPU keep
the ratio they need, since both are machine-shaped, while latency and log volume
get the wall-clock ceiling a user actually cares about.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 13:38:01 -07:00
Kerry Lu
66980bbb87 test(e2e): address Redis chaos PR review, add log-bytes budget
Pad the locust payload to tens of KB so per-request bookkeeping cost scales with
body size instead of hiding behind a 40-byte prompt. Turn on
use_redis_transaction_buffer in the chaos config and JSON_LOGS in the workflow so
the spend buffer, pod lock, and JSON-encoded breaker tracebacks are all part of
the measured chaos cost. Add a log-bytes-per-request budget alongside latency,
RSS, and CPU, reading the proxy's log file size at each phase split; its ceiling
is uncalibrated since no chaos run has measured it yet.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 12:40:25 -07:00
Kerry Lu
1270ecb781 test(load): drive /v1/messages alongside /chat/completions in the Redis chaos test
The Anthropic Messages route reaches the same Redis touchpoints and cost-tracking
callback through its own request path, so a failure-path regression there would not
surface from chat completions alone. Each simulated user now picks one endpoint round
robin and stays on it, and the per-endpoint split is asserted and reported so a run
that silently drove only one route fails instead of passing.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 12:28:02 -07:00
Kerry Lu
1699f2d6dc Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_e2e_redis_timeout
# Conflicts:
#	uv.lock
2026-09-11 11:38:22 -07:00
joshua-berri
6882f057b4
Merge pull request #40440 from BerriAI/litellm_mcp_upstream_error_log_detail
fix(mcp): log upstream request method, body and response on tool-list and OAuth2 token failures
2026-09-11 11:24:42 -07:00
Kerry Lu
5f17261534 test(load): pause Redis outright and budget the chaos phase against the baseline
CLIENT PAUSE ALL for the length of the chaos phase instead of CLIENT PAUSE WRITE, so every Redis touchpoint on the request path times out rather than just the writes. The pause is sized to the phase because it freezes the control connection too; teardown's CLIENT UNPAUSE is a safety net for a phase that overran

Latency, RSS and CPU are now budgeted as chaos-over-baseline ratios (p50/p90/p99 for latency and RSS, CPU seconds per request once) through a small phase_budget module, replacing the machine-shaped absolutes. The Redis timeout rate is reported but no longer asserted

The final /metrics scrape waits for litellm_deployment_failure_responses_total to stop moving, since that counter is bumped from the async logging queue and lagged the load generator by thousands of increments. The model group carries a unique marker so a deployment left behind by an aborted run cannot absorb this run's retries

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-11 11:06:06 -07:00
Joshua Valluru
aef8888c0b ci: remove MCP tests from Python 3.10 import smoke 2026-09-11 11:02:38 -07:00
joshua-berri
3f81ba3d30
Merge pull request #40679 from BerriAI/litellm_fix_mcp_oauth_registration_7498
fix(mcp): explain refused OAuth registration and bound discovery retries
2026-09-11 10:51:31 -07:00
Anmol Jaiswal
dfab4794ec
docs(router): name both affinity TTL knobs in the _claim_pin docstring (#40663)
The docstring cited session_affinity_ttl_seconds as the keepalive bound,
but the Router-level knob feeding ttl_seconds is
deployment_affinity_ttl_seconds; session_affinity_ttl_seconds is the
separate per-request PreRoutingHookResponse override. Anyone grepping
the docstring's name to shrink the Router default finds only the
override. Name both, scoped correctly.
2026-09-11 10:22:32 -07:00
devin-ai-integration[bot]
9316b4194a
perf(proxy): register liveness and core inference routes first (#40687)
Starlette scans the route table in registration order, so a request pays one
regex match per route registered ahead of its own. The proxy registers several
hundred routes and left the liveness probe near position 280 and the lazy
loaded /v1/messages at the very end. Move /health/liveliness, /health/liveness,
/v1/chat/completions, /chat/completions and /v1/messages to the front of the
route table after startup registration and again after a lazy router loads.

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 17:10:38 +00:00
devin-ai-integration[bot]
db3338b206
feat(proxy): make the in-memory management cache capacity configurable (#40725)
* feat(proxy): make the in-memory management cache capacity configurable

Add general_settings.user_api_key_cache_max_size (positive int, default 200) to resize the
in-memory tier of the shared user_api_key_cache at startup and on DB config reloads, expose it
in the Admin UI general settings, and cover it with behavioral tests. Prior art: #34726

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(caching): resize the in-memory tier from DualCache so any cache instance honours the cap

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* style(proxy): wrap the cache capacity field description to the 120 col limit

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 09:55:30 -07:00
devin-ai-integration[bot]
de79310954
feat(secret_managers): support customer-managed KMS key for virtual keys stored in AWS Secrets Manager (#40475)
Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 09:54:08 -07:00
devin-ai-integration[bot]
47bba14336
fix(passthrough): parse Bedrock stream spend incrementally instead of buffering the whole response (#40724)
* fix(passthrough): parse Bedrock stream spend incrementally instead of buffering the whole response

Bedrock pass-through streaming kept every relayed chunk in memory until EOF and
then decoded, parsed and translated the whole stream again for spend logging.
Large or concurrent streams could exhaust proxy worker memory.

Sync and async passthrough wrappers now hand each chunk to a provider stream
collector as it is relayed. Bedrock decodes event-stream frames incrementally,
folds consecutive text deltas, and keeps only what stream_chunk_builder needs
for usage, tool calls and metadata. Text deltas are no longer retained in the
Bedrock and Anthropic stream decoders either. Providers without a collector
keep the previous raw-bytes behavior. Collector failures are isolated so spend
tracking can never interrupt the customer stream

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(passthrough): assert the spend payload the collector builds instead of mock internals

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(passthrough): type the Bedrock collector helpers by the collector protocol instead of asserting the class

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 09:53:37 -07:00
devin-ai-integration[bot]
3df127b439
fix(proxy): give user-key objects their own in-memory cache partition (#40713)
Key objects share the 200-entry UserApiKeyCache in-memory store with teams,
end users, tags and memberships, so churn in those objects evicts hot keys
and forces a LiteLLM_VerificationToken lookup on the next request. Route
bare hashed-token keys to a dedicated InMemoryCache inside UserApiKeyCache
while keeping Redis, TTL, serialization and invalidation shared

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 09:52:09 -07:00
devin-ai-integration[bot]
729ea6b832
perf(proxy): lazy-load provider passthrough routes (#40691)
Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 09:48:53 -07:00
Joshua Valluru
3883a891f0 fix(mcp): redact compact credential field names 2026-09-11 08:10:19 -07:00
Joshua Valluru
5c190e69bf fix(mcp): preserve timeout fallback on Python 3.10 2026-09-11 08:00:39 -07:00
Mateo Wang
67cb34ceee
Merge pull request #40606 from BerriAI/litellm_registry_audit_2026_09_10b 2026-09-11 08:00:04 -07:00
Joshua Valluru
e8c411fb43 test(mcp): cover deeply nested credential inspection limits 2026-09-11 07:32:38 -07:00
Joshua Valluru
5b13dfcc59 fix(mcp): omit credential-bearing paths from failure logs 2026-09-11 07:27:10 -07:00
Joshua Valluru
0ee9e1e448 fix(mcp): redact reflected credentials and avoid import cycles 2026-09-11 07:20:48 -07:00
Joshua Valluru
40f01e2fa5 chore: merge current staging into MCP OAuth fix 2026-09-11 07:07:07 -07:00
Joshua Valluru
8d5a675878 fix(mcp): expire temporary OAuth discovery results 2026-09-11 07:02:11 -07:00
Joshua Valluru
eec7c1e7f8 chore: merge current staging for MCP diagnostic compatibility 2026-09-11 07:01:06 -07:00
Joshua Valluru
3fc483d424 fix(mcp): capture bounded error diagnostics without exposing credentials 2026-09-11 06:58:40 -07:00
mateo
8762c664b7 test(registry): cover nemotron reasoning, v4-flash vision and xai/groq deprecation dates
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 13:28:35 +00:00
mateo
4382b86b0f registry audit 2026-09-11: xai/groq deprecation dates, deepseek-v4-flash vision, perplexity nemotron reasoning
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 13:14:37 +00:00
mateo
598e863510 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_registry_audit_2026_09_10b 2026-09-11 13:04:19 +00:00
joshua-berri
9a715df212
Merge pull request #40665 from BerriAI/litellm_fix_openapi_mcp_health_4896
fix(mcp): check OpenAPI specifications without native MCP handshakes
2026-09-10 22:02:45 -07:00
Kerry Lu
33ec56ed75 test(e2e): rewrite the Redis timeout test as a locust chaos load test
The sequential version sent one request at a time, so a Redis outage never
reached the concurrency where the failed-tracking alert body actually grows.
This drives the proxy with locust against one model group of three mock
deployments, two failing at order 1 and one serving at order 2, so every
request spends its retries on the failing pair and lands on the serving
deployment through the order-based fallback. Two phases, a healthy baseline
and a CLIENT PAUSE WRITE window, and every request must succeed in both.

Latency, RSS and CPU are reported as p50/p90/p99 per phase rather than
asserted on: RSS and CPU come from psutil on the proxy's process tree, since
a multi-worker proxy serves /metrics from the prometheus multiprocess
collector and that drops the process collector's series. Thresholds stay open
until weekly runs give real baselines.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-10 21:55:23 -07:00
Joshua Valluru
bb9b4c4aef fix(mcp): render registration refusals without recursion 2026-09-10 21:54:06 -07:00
Joshua Valluru
f04fb748c5 fix(mcp): explain refused OAuth registration and bound discovery retries 2026-09-10 21:02:46 -07:00
Joshua Valluru
ca03c889c9 fix(mcp): avoid caching cancelled OpenAPI health probes 2026-09-10 20:26:53 -07:00
joshua-berri
acb9086f29
Merge pull request #40664 from BerriAI/litellm_fix_mcp_vscode_dcr_7449
fix(mcp): accept VS Code OAuth registration callbacks
2026-09-10 20:17:46 -07:00
Joshua Valluru
da1dfcdb24 refactor(mcp): reuse the shared HTTP handler for bounded probes 2026-09-10 19:59:07 -07:00
Mateo Wang
ff4b558243
Merge pull request #40624 from BerriAI/litellm_redis_breaker_open_silent_miss
fix(caching): keep an open Redis circuit breaker open and quiet on the sync read and spend counter paths
2026-09-10 19:55:22 -07:00
Joshua Valluru
576c1bc5d6 fix(mcp): bound and coalesce OpenAPI health probes 2026-09-10 19:45:44 -07:00