Commit graph

16963 commits

Author SHA1 Message Date
yassin
f60a603519 fix(proxy): log configured model access denials at the final response boundary
Post-auth denials from can_key_call_resolved_model (per-request alias
rewrite, MCP sampling, realtime) never reach the auth exception handler,
so the internal allowlist reason was dropped when
model_access_denied_message was set. Log it once from the ProxyException
response handler and the realtime rejection path instead, and convert
JWT ModelAccessDeniedHTTPException into the specialized ProxyException so
the same boundary covers it

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-16 00:12:49 +00:00
yassin
7267c6bed7 Merge remote-tracking branch 'origin/main' into litellm_model_access_denied_message 2026-09-15 23:36:30 +00:00
yassin
b99f0c812f fix(proxy): log configured model access denial only at the auth error boundary
Move the WARNING that carries the internal denial detail out of the message formatter and into the auth exception handler. The denial exceptions now carry internal_message so access-group probes and fallback paths that catch and recover from the denial no longer log a false denial for an allowed request

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 23:36:12 +00:00
tin-berri
8cd00d2d6e
Merge pull request #41282 from BerriAI/litellm_fast_mode_toggle_0915
Some checks failed
Unit Tests: Proxy DB Operations / auth-checks (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / budgets (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / custom-logging (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / proxy-utils (push) Blocked by required conditions
Unit Tests / misc (push) Waiting to run
Unit Tests / proxy-auth (push) Waiting to run
Unit Tests / proxy-endpoints (push) Waiting to run
Unit Tests: Proxy DB Operations / db-and-spend (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / endpoints-and-responses (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / guardrails-hooks (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / jwt-and-keys (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / key-generation (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / logging-misc (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / proxy-runtime (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / proxy-server-core (push) Blocked by required conditions
Unit Tests / caching-local (push) Waiting to run
Unit Tests / core-utils (push) Waiting to run
Unit Tests / enterprise-package (push) Waiting to run
Unit Tests / enterprise-routing (push) Waiting to run
Unit Tests / integrations (push) Waiting to run
Unit Tests / All Other Providers (push) Waiting to run
Unit Tests / Vertex AI (push) Waiting to run
Unit Tests / proxy-extras (push) Waiting to run
Unit Tests / proxy-infra (push) Waiting to run
Unit Tests / proxy-server (push) Waiting to run
Unit Tests / responses-caching-types (push) Waiting to run
GitHub Actions Security Analysis / zizmor (push) Waiting to run
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
ai-gateway image / ai-gateway release image (push) Has been cancelled
feat(auto-router): add per-model Fast mode toggle
2026-09-15 16:10:06 -07:00
Mateo Wang
6bc821492b
Merge pull request #40476 from BerriAI/litellm_codex_model_catalog_sync
feat(cli): sync Codex /model picker from proxy /v1/models in lite codex
2026-09-15 15:59:04 -07:00
Yassin Kortam
9d75cdd502
Merge pull request #41304 from BerriAI/litellm_lit1698_openai_system_messages_first 2026-09-15 15:56:13 -07:00
Yassin Kortam
9bb83fdaea
Merge pull request #41281 from BerriAI/litellm_lit_7417_jwt_key_mapping_issuer_scope
fix(jwt-auth): scope JWT key mappings by issuer to prevent cross-issuer collisions
2026-09-15 15:51:50 -07:00
Yassin Kortam
94a6dfaf52
Merge pull request #41307 from BerriAI/litellm_passthrough_deployment_model_id
fix(passthrough): attribute Vertex passthrough successes to the resolved router deployment
2026-09-15 15:44:38 -07:00
yassin
d4d8cc9092 fix(proxy): apply access denied message to JWT paths, sanitize denial log, await dashboard saves
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 22:44:03 +00:00
Mateo Wang
6ee1d72ae8
Merge pull request #40872 from BerriAI/litellm_bedrock_sanitize_tool_use_id
fix(bedrock): sanitize client tool_call ids to Bedrock toolUseId constraints
2026-09-15 15:41:39 -07:00
Mateo Wang
c3222ec110
Merge pull request #41171 from BerriAI/litellm_converted_stream_spend_tracking
fix(logging): track spend for streams a deployment hook converted to non-streaming
2026-09-15 15:34:13 -07:00
mateo-berri
fa116a0ecc Merge remote-tracking branch 'origin/main' into litellm_bedrock_sanitize_tool_use_id 2026-09-15 15:27:55 -07:00
yassin
9261a72eb7 test(passthrough): cover Vertex router resolution without a matching deployment
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 22:14:44 +00:00
Yassin Kortam
226b1e1bb9
Merge pull request #41288 from BerriAI/litellm_langsmith_preserve_events_during_flush
fix(langsmith): keep events appended during an in-flight flush instead of clearing them
2026-09-15 15:06:36 -07:00
yassin
168b5bc4fb feat(proxy): configurable client-facing model access denied message
Add litellm_settings.model_access_denied_message, a template ({model} placeholder) returned to clients instead of the detailed "can only access models=[...]" text on key/team/user/org/project and team-member model access denials. The full denial reason is still written to the proxy logs at WARNING. Unset keeps the existing detailed message, status codes and error types are unchanged.

Expose the new setting and the existing expose_router_debug_in_errors flag in the Admin UI general settings (String editor, Boolean toggle with an explicit True default) and allow both as safe DB overrides so they persist and propagate across workers.

Resolves LIT-5283

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 22:05:08 +00:00
Yassin Kortam
e36626174b
Merge pull request #41297 from BerriAI/litellm_return_400_on_lone_surrogate_input
fix(proxy): return 400 instead of 500 for lone surrogate escapes in request body
2026-09-15 15:04:08 -07:00
Yassin Kortam
579a30de83
Merge pull request #41300 from BerriAI/litellm_lit_1742_custom_provider_map_router
fix(router): accept custom_provider_map providers before the first completion call
2026-09-15 15:03:42 -07:00
Yassin Kortam
ee51be4db2
Merge pull request #41289 from BerriAI/litellm_fix_clientside_credential_deployment_scope
fix(router): stop registering a caller-supplied credential as a router deployment
2026-09-15 15:00:50 -07:00
Yassin Kortam
1b8daf20e0
Merge pull request #38268 from BerriAI/litellm_fix_xai_web_search_nested_filters
fix(xai): honor nested web_search filters on the xAI Responses API
2026-09-15 14:56:36 -07:00
yassin
77d913958d feat(openai): add openai_system_messages_first to put system messages first for prompt caching
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:53:29 +00:00
Yassin Kortam
fa09de9e45
Merge pull request #41279 from BerriAI/litellm_reset_budget_decrement_spend
fix(proxy): reset budgets by decrementing pre-reset spend instead of zeroing rows
2026-09-15 14:45:03 -07:00
Yassin Kortam
c1e1d62903
Merge pull request #41291 from BerriAI/litellm_lit1643_auth_failure_user_agent
fix(proxy): keep client User-Agent on auth failure spend logs
2026-09-15 14:44:32 -07:00
yassin
0cc6968495 fix(router): accept custom_provider_map providers before the first completion call
get_llm_provider() and Router._add_deployment() only knew the built-in
provider_list and JSON providers, so a provider registered through
litellm.custom_provider_map was rejected until custom_llm_setup() had
run inside the first completion() call. Both now check the map directly.

Resolves LIT-1742

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:43:47 +00:00
tin-berri
ce1a4f896a
Merge pull request #41272 from BerriAI/litellm_fuse_v2_classifier_pr
feat(router): add Fuse V2 classifier after capability forecasting
2026-09-15 14:43:44 -07:00
yassin
e62ff9ebee fix(proxy): return 400 instead of 500 for lone surrogate escapes in request body
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:40:53 +00:00
yassin
96bffb1290 fix(passthrough): attribute Vertex passthrough successes to the resolved router deployment
The Vertex passthrough route resolved a router deployment only to rewrite the
upstream URL and dropped its model_info, so the standard logging payload and
the Prometheus litellm_deployment_success_responses_total counter carried
model_id="". Carry the deployment's model_info through request.state into the
passthrough logging metadata, where it overrides any client-supplied model_info.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:39:39 +00:00
Yassin Kortam
140229bc4a
Merge pull request #41230 from BerriAI/litellm_client_timeout_408_skips_cooldown
fix(router): stop counting caller-set timeout 408s toward deployment cooldown
2026-09-15 14:31:11 -07:00
yassin
afb6f8be65 fix(xai): treat an explicit empty web_search filters object as unrestricted
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:24:32 +00:00
Yassin Kortam
a6127d2363
Merge pull request #35180 from BerriAI/litellm_lit4995_vertex_rerank_search_units
fix(rerank): bill Vertex search_units from input records and give every rerank response a unique id
2026-09-15 14:23:23 -07:00
Yassin Kortam
5df127d483 fix(router): stop registering a caller-supplied credential as a router deployment
_handle_clientside_credential registered the per-request Deployment it built for
a client-supplied api_key/api_base via upsert_deployment, which added it to
self.model_list under the shared model_name. That made a request-scoped
credential a permanent, load-balanced deployment that any later caller of the
same model group could be routed onto, reaching the provider with someone
else's forwarded credential.

The per-request Deployment still gets its own stable id for cooldown and
logging identity; it is just never registered with the router.

Resolves LIT-7811
2026-09-15 14:18:03 -07:00
mrinal
4c179f2f59 test(langsmith): type the flush race test and cancel its periodic task
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:17:36 +00:00
yassin
595bec46ff fix(router): time fallback-hop 408s against now, not the previous hop's end_time
The failure logger skips fallback hops (has_logged_async_failure is already set), so
model_call_details.end_time still belongs to the previous hop and predates this hop's
api_call_start_time. The fallback cooldown guard measured a negative elapsed time and
cooled down deployments for caller-set timeouts.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:11:40 +00:00
yassin
2f719fec52 test(router): run the fallback provider-408 cooldown regression inside an event loop
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:11:40 +00:00
yassin
5da497f4ac fix(router): only exempt 408s that arrive after the caller's timeout from cooldown
client_side_timeout records that the caller configured a timeout, not that
the timeout fired. A 408 the provider returns before that deadline is a
deployment failure and must still count toward cooldown.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:11:40 +00:00
Yassin Kortam
e54b93017b fix(jwt-auth): scope JWT key mappings by issuer to prevent cross-issuer collisions 2026-09-15 21:02:17 +00:00
mateo-berri
a9c422735f fix(router): stop counting caller-set timeout 408s toward deployment cooldown
A 408 produced by a timeout the caller set (a timeout body field or an
x-litellm-timeout header, which the proxy marks as client_side_timeout)
says nothing about the deployment's health, yet the router's primary
failure callback counted it toward allowed_fails and cooled the
deployment down. The fallback path already skipped it.

The marker never reached that callback because get_litellm_params drops
kwargs outside OPTIONAL_KWARGS_KEYS, so it is listed there now, and
deployment_callback_on_failure returns before the failure counter when
is_caller_timeout_408 holds. A 408 from a timeout the deployment or the
provider set still counts and still cools the deployment down.
2026-09-15 21:02:15 +00:00
Devin AI
3cb5ceb98c fix(xai): honor nested web_search filters on the xAI Responses API
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:02:10 +00:00
yassin
fad11fa66e fix(proxy): keep client User-Agent on auth failure spend logs
Auth gate rejections are raised before add_litellm_data_to_request stamps the caller User-Agent and SpendLogsMetadata dropped the field, so failure spend logs and prometheus labels could not identify an abusive client. Stamp requester_ip_address and user_agent on the failure hook payload and carry user_agent through spend log metadata. Request scopes without a headers entry are tolerated.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:02:06 +00:00
Yassin Kortam
79d4d4d8f5
Merge pull request #38278 from BerriAI/litellm_fix_xai_chat_web_search_live_search
fix(xai): stop sending web_search_options to xAI's retired Live Search path
2026-09-15 14:01:13 -07:00
yassin
113e43b87a Merge remote-tracking branch 'origin/main' into litellm_fix_xai_chat_web_search_live_search 2026-09-15 20:46:51 +00:00
yassin
4ba136946c Merge remote-tracking branch 'origin/main' into litellm_lit7223_reconcile_before_db 2026-09-15 20:46:14 +00:00
Yassin Kortam
e6af62aaac
Merge pull request #40997 from BerriAI/litellm_batch_tpd_limit
feat(proxy): add tpd_limit (tokens per day) for batch submissions
2026-09-15 13:39:45 -07:00
Yassin Kortam
5199f4fca2
Merge pull request #40191 from BerriAI/litellm_fix_streaming_guardrail_block_logging
fix(proxy): log blocked streaming guardrail responses as failures, not success
2026-09-15 13:39:23 -07:00
mrinal
4a8986dd72 fix(langsmith): keep events appended during an in-flight flush instead of clearing them
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 20:38:35 +00:00
Yassin Kortam
cdb4eaac59
Merge pull request #40262 from BerriAI/litellm_lit_7190_inline_token_counts
fix(proxy): run the remaining inline token counts off the event loop
2026-09-15 13:38:00 -07:00
yassin
95cc3bfabb Merge remote-tracking branch 'origin/main' into litellm_fix_xai_chat_web_search_live_search 2026-09-15 20:27:48 +00:00
yassin
46bd3d40d7 refactor(logging): bill an assembled stream on the failure log via a public Logging method
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 20:23:50 +00:00
kerry-berri
7d3917dbf4
Merge pull request #41269 from BerriAI/litellm_ban_vendor_fact_pinning_tests
test: drop tests that pin vendor facts and add the CLAUDE.md rule
2026-09-15 13:16:55 -07:00
Yassin Kortam
367393405c
Merge pull request #41170 from BerriAI/litellm_prometheus_401_failed_requests_metric
fix(prometheus): count 401 auth failures in litellm_proxy_failed_requests_metric
2026-09-15 13:13:49 -07:00
Yassin Kortam
0e5be275b0
Merge pull request #41283 from BerriAI/litellm_writer_pinned_raw_sql_writes
fix(proxy): keep access-group raw SQL writes on the writer while writer_unavailable is stale
2026-09-15 13:13:30 -07:00