Commit graph

6721 commits

Author SHA1 Message Date
devin-ai-integration[bot]
5d3d99eb9f
fix(proxy): drop cost-map metadata echoed back on model save (#41944)
* fix(proxy): drop cost-map metadata echoed back on model save

Filter unchanged cost-map fields from model-info save echoes while preserving edited overrides.

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

* fix(proxy): drop a stored override when an echoed save resets it to the cost-map value

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

* fix(proxy): compare model_info echo against the deployment's cost-map lookup

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

* fix(proxy): decrypt the stored model before the cost-map lookup

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

* fix(proxy): treat a reset to the bundled catalog value as an echo even after router registration

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

* fix(proxy): compare the reset against the catalog as loaded, not only the bundled backup

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

* fix(types): type the catalog snapshot and echo filter parameters as Mapping[str, object]

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

* test(proxy): inject the loaded catalog into update_db_model instead of patching the class

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

* fix(proxy): use contextlib.suppress for cost-map lookup miss to stay under BLE001 budget

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

---------

Co-authored-by: ryan <ryan@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 19:33:16 -07:00
devin-ai-integration[bot]
8b33da7bb3
feat(proxy): opt-in litellm_call_id in JSON error bodies (#42391)
* feat(proxy): opt-in litellm_call_id in JSON error bodies

Add general_settings.include_call_id_in_error_body. When true, the value
already on the x-litellm-call-id response header is copied into JSON error
bodies: as error.litellm_call_id on the OpenAI-shaped routes, /v1/messages,
and streaming first-chunk errors, and as a top-level litellm_call_id on
pass-through routes. Off by default, so error bodies stay byte-identical
unless an admin opts in

* chore(proxy): drop helper docstring and restore lazy OpenAPI snapshot

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-21 19:17:18 -07:00
Mateo Wang
5eb4e30f29
Merge pull request #42352 from BerriAI/litellm_mcp_tools_camelcase_keys
fix(mcp): return camelCase tool keys from /v1/mcp/tools after the SDK 2 upgrade
2026-09-21 18:46:17 -07:00
kerry
41d6acaa97 test(proxy): isolate the agent read-through singleton between unknown-agent tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 01:34:31 +00:00
yucheng-berri
12f79308cf
Merge pull request #42354 from BerriAI/litellm_fix_video_key_guardrails_lit_6685
* fix(guardrails): scan video prompts for key-attached guardrails on /v1/videos

/v1/videos dispatches call_type avideo_generation, which CallTypes did not
know and no guardrail translation handler covered, so the unified guardrail
hook returned the request unscanned. Add the video call types and an OpenAI
video guardrail translation package that scans the prompt for create, remix,
edit and extension requests

Resolves LIT-6685

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

* chore(ui): regenerate api types for video call types

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

* test: skip avideo_generation in azure sdk client exhaustive check

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

* test(e2e): retry a leaked video job until the guardrail sync deadline

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

* refactor(guardrails): satisfy the type-discipline gate in the video handler

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

* test(guardrails): gate the video e2e on a chat probe so a miss starts at most one paid job

Addresses Greptile review: typed RewritingGuardrail override, dropped routine docstrings, and the e2e waits for the key guardrail to sync via /chat/completions before its single /v1/videos call

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

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 17:23:56 -07:00
mateo-berri
1c6c1e568d Merge remote-tracking branch 'origin/main' into litellm_mcp_tools_camelcase_keys 2026-09-21 17:21:46 -07:00
Yassin Kortam
9cc5b78c33
Merge pull request #41634 from BerriAI/litellm_agent_access_groups
feat(agents): attach access groups to agents and enforce them for models, MCP servers and agent calls
2026-09-21 19:13:46 -05:00
tin-berri
24f616b637
Merge pull request #42356 from BerriAI/litellm_cli_footer_version_guard
fix(cli): preserve newer installed status lines during setup
2026-09-21 17:09:38 -07:00
yucheng-berri
99e284106d
Merge pull request #41213 from BerriAI/litellm_spend_log_cleanup_cancel_outcome
fix(proxy): record aborted outcome when spend-log cleanup is cancelled at shutdown
2026-09-21 17:03:25 -07:00
yuneng-jiang
1f4b595072
Merge pull request #41788 from BerriAI/litellm_config_read_source
feat(proxy): report the source of alerting, UI and router settings on read
2026-09-21 17:02:18 -07:00
Tin Chi Lo
0cfc4bc782 fix(cli): serialize footer installs and tolerate unknown versions 2026-09-21 16:48:08 -07:00
yuneng-jiang
6b254b6be2
Merge pull request #41769 from BerriAI/litellm_model-actor-edges
test(model_management): cover actor edges and wildcard models
2026-09-21 16:43:24 -07:00
tin-berri
c1c1ec4f84
Merge pull request #42026 from BerriAI/litellm_user_jwt_savings
feat(ui): add internal-user savings and auto-router usage
2026-09-21 16:41:16 -07:00
ryan-crabbe-berri
582c664168
Merge pull request #42346 from BerriAI/litellm_jwt_team_allowed_routes_passthrough_grant
fix(auth): let jwt team_allowed_routes paths grant auth=true passthrough
2026-09-21 16:38:05 -07:00
yucheng
2f0584cec6 test(guardrails): gate the video e2e on a chat probe so a miss starts at most one paid job
Addresses Greptile review: typed RewritingGuardrail override, dropped routine docstrings, and the e2e waits for the key guardrail to sync via /chat/completions before its single /v1/videos call

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 23:20:29 +00:00
mateo-berri
b58c9349dd test(mcp): drop the docstring from the wire spelling regression test 2026-09-21 16:15:43 -07:00
joshua-berri
1baa26d36b
Merge pull request #41074 from BerriAI/litellm_mcp_server_list_stable_order
fix(mcp): keep server lists stable across refreshes
2026-09-21 23:06:09 +00:00
ryan-crabbe-berri
a0d1f0236e
Merge pull request #42122 from BerriAI/litellm_db_callback_redaction_settings
fix(proxy): apply DB-stored callback redaction settings before logger init
2026-09-21 16:03:44 -07:00
Yuneng Jiang
143725fc06
Merge remote-tracking branch 'origin/main' into litellm_config_read_source 2026-09-21 15:54:52 -07:00
Tin Chi Lo
467d13ebac fix(cli): preserve newer installed status lines during setup 2026-09-21 15:54:41 -07:00
Yuneng Jiang
a5cce1b859
fix(proxy): let the config file win over the stored row in ui settings 2026-09-21 15:49:09 -07:00
ryan-crabbe-berri
0efcb9956d
Merge pull request #42278 from BerriAI/litellm_cherry_pick_password_breach_reset
feat(auth): breached password detection, self-service change-password and forced password reset
2026-09-21 15:47:46 -07:00
yucheng
9ae2fe2ea4 fix(guardrails): scan video prompts for key-attached guardrails on /v1/videos
/v1/videos dispatches call_type avideo_generation, which CallTypes did not
know and no guardrail translation handler covered, so the unified guardrail
hook returned the request unscanned. Add the video call types and an OpenAI
video guardrail translation package that scans the prompt for create, remix,
edit and extension requests

Resolves LIT-6685

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 22:47:14 +00:00
joshua-berri
3353c57e76
Merge pull request #42292 from BerriAI/litellm_extract_mcp_operation_context_7741
refactor(mcp): extract explicit operation context and dispatch
2026-09-21 22:38:07 +00:00
mateo-berri
51aa021c6e fix(mcp): return camelCase tool keys from /v1/mcp/tools after the SDK 2 upgrade
SDK 2 spells the Tool model's Python attributes in snake_case behind camelCase aliases, so dumping attribute names handed scripts input_schema and output_schema instead of the inputSchema and outputSchema v1.102.0 returned. Dump each tool by its MCP wire aliases, as the other list routes do, and pin the shape with a regression test. Also drop an unused tools dict in the Responses MCP stream iterator.
2026-09-21 15:38:06 -07:00
yassin
82eef2fcca fix(proxy): scope agent permissions to invoking caller
An agent key that echoes the x-litellm-user-id / x-litellm-team-id headers
forwarded by /a2a is capped at that user's and team's models, MCP servers
and agents, on top of its own grants and access group ceiling. The echoed
ids only narrow, and nested A2A hops forward the original human caller

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 22:32:32 +00:00
ryan-crabbe-berri
dac88cc6d0 fix(auth): keep blanket wildcards and team-less jwts out of the passthrough grant
A team_allowed_routes entry that names no path segment, such as * or /*, is a blanket grant like a named route group, so it no longer opens auth=true passthroughs. The grant in the shared route check now also requires a team on the JWT token, because team_allowed_routes should not apply to a JWT that resolved no team
2026-09-21 15:28:25 -07:00
ryan
8a1c6e49fb feat(auth): only allow password-login dashboard sessions to call /user/password/change
Password login now stamps login_method=username_password into the UI session key
metadata, and change_password rejects any caller that is not a litellm-dashboard
key carrying that marker with 403 before the user row is read. SSO sessions and
user-associated virtual keys can no longer use the endpoint as a current_password
guessing oracle. The forced-reset session is still minted by the password login
path, so it keeps access to the endpoint

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 22:22:12 +00:00
ryan-crabbe-berri
a8003102b2 fix(auth): let jwt team_allowed_routes paths grant auth=true passthrough
Explicit paths and trailing-wildcard prefixes in litellm_jwtauth.team_allowed_routes
passed the JWT route check but were then denied by the auth-enforced passthrough
gates, which only read allowed_passthrough_routes from key or team metadata. Both
gates now also accept an explicit team_allowed_routes entry for tokens built by JWT
auth. Named route groups still never grant, and virtual keys, including JWT-mapped
ones, stay key-scoped
2026-09-21 15:11:48 -07:00
ryan
28f70c75d1 fix(auth): reject unchanged password on /user/password/change
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 22:02:05 +00:00
Yuneng Jiang
1cc38f05f4
test(proxy): type the router settings source test parameters 2026-09-21 15:00:24 -07:00
Mateo Wang
7b8bc54237
Merge pull request #42036 from BerriAI/litellm_team_membership_lookup_fail_closed
fix(auth): fail closed when the team membership lookup hits a db outage
2026-09-21 14:58:46 -07:00
ryan
7c8aed072f chore: merge main into litellm_cherry_pick_password_breach_reset
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 21:54:35 +00:00
Mateo Wang
4b54897b36
Merge pull request #42315 from BerriAI/litellm_scim_delete_evict_user_cache
fix(proxy): evict the cached user row when SCIM or /user/delete removes a user
2026-09-21 14:51:53 -07:00
Yassin Kortam
17b56cc4ca
Merge pull request #41505 from BerriAI/litellm_keep_config_models_on_empty_config_read
fix(proxy): keep config-defined deployments when a config read returns no model_list
2026-09-21 16:43:15 -05:00
Joshua Valluru
5ec61e7a0b chore: merge main into MCP ordering fix 2026-09-21 14:36:41 -07:00
yucheng-berri
79d6e236f9
Merge pull request #39805 from BerriAI/litellm_mcp_admin_api_preserve_oauth_scopes
fix(mcp): keep oauth scopes in admin api credential redaction
2026-09-21 14:29:13 -07:00
Yuneng Jiang
4602376977
fix(proxy): report a stored alerting value as db even when it is null
A stored null or empty list for a nested alerting field is still the value
the proxy serves when the config file leaves alerting_args alone, so the
source is db. Keying off the value rather than its presence reported those
fields as default and hid a stored setting that is genuinely in effect.

Presence in the stored row now decides, with the config file still checked
first so a config-owned key keeps reporting config. Test helpers are typed
and the router test injects a stub rather than patching a class attribute.
2026-09-21 14:24:32 -07:00
Yassin Kortam
da1ccaec67
Merge pull request #40322 from BerriAI/litellm_lit7351_reservation_lease_renewal
fix(proxy): renew budget reservation counter TTL while the request is in flight
2026-09-21 16:07:14 -05:00
yuneng-jiang
5e0512b611
Merge pull request #42291 from BerriAI/litellm_lit7597_detach_credential
fix(proxy): detach stored credential when model editor selects None
2026-09-21 14:05:28 -07:00
kerry-berri
f5f53a4cf4
Merge pull request #40429 from BerriAI/litellm_upgrade_banner_changelog_stats
feat(ui): add upgrade banner with latest release changelog stats
2026-09-21 13:56:05 -07:00
Yuneng Jiang
f998ab53d5
fix(proxy): treat a config-owned alerting_args as shadowing the stored row
When the config file declares alerting_args at all, the resolver hands the
file's dict to every reader and the stored row never reaches one. Reporting
a nested field as "db" because the row happens to carry it told the admin a
value was in effect that the proxy does not serve: a live proxy answered
source "db" for outage_alert_ttl while serving the default.

A config-owned parent now reports the field's own default, and the DB is
consulted only when the file leaves the parent alone.
2026-09-21 13:52:16 -07:00
mateo-berri
d8ce49de06 fix(proxy): evict the cached user row when SCIM or /user/delete removes a user 2026-09-21 13:51:26 -07:00
Yuneng Jiang
a45be4f276
fix(proxy): let the config file win when reporting nested alerting sources
_nested_setting_source returned "db" whenever the stored row held a value,
without first asking whether the config file declares the same key. For a
config-owned alerting_args field that disagrees with the database, the
endpoint reported source "db" while the proxy actually serves the file's
value and rejects any write to it.

Config ownership is now checked first, matching SettingsStore.source and
the precedence the rest of the resolver applies. The source test set grows
a field that only the database sets, a field only the file sets, and a
stored empty list, so each reported source is discriminating.
2026-09-21 13:48:37 -07:00
Yuneng Jiang
ddf6565970
Merge remote-tracking branch 'origin/main' into litellm_config_read_source 2026-09-21 13:25:45 -07:00
Yuneng Jiang
be2f0d081b
fix(proxy): report sources only on the read endpoints main does not cover
/config/field/info and /config/list already report per-key source on main,
so this drops the branch's versions of those and keeps /alerting/settings,
/get/ui_settings and /router/settings.

Read endpoints no longer write the freshly read database row back into the
shared settings store; the reload path already keeps it current, and a GET
that mutates global state leaks across callers.

Regenerates the lazy OpenAPI snapshot on Python 3.12, matching CI, and the
dashboard API types for the two new response fields.
2026-09-21 13:25:39 -07:00
Mateo Wang
662e5b6e32
Merge pull request #42284 from BerriAI/litellm_qianwen_ai_platform_rename
fix: rename the mainland China brand to Qianwen AI Platform
2026-09-21 13:18:20 -07:00
Joshua Valluru
ef67412e50 fix(mcp): keep OAuth prefetch failure logs free of caller data 2026-09-21 13:13:20 -07:00
kerry
9611af7817 Merge remote-tracking branch 'origin/main' into litellm_upgrade_banner_changelog_stats 2026-09-21 20:06:41 +00:00
joshua-berri
3549143bcd
Merge pull request #34919 from BerriAI/litellm_fix_mcp_peek_utf8_boundary
fix(mcp): handle split UTF-8 routing previews
2026-09-21 19:56:50 +00:00