Commit graph

35825 commits

Author SHA1 Message Date
Cesar Garcia
6bd7cd7573
Merge branch 'main' into litellm_oss_staging_03_11_2026 2026-03-12 10:43:08 -03:00
Sameer Kankute
291e6e1841
Merge pull request #23435 from BerriAI/litellm_vector-store-retrieve-list-update-delete
Add vector store retrieve list update delete
2026-03-12 19:08:39 +05:30
Sameer Kankute
4f5b6ae556
Merge pull request #23448 from BerriAI/litellm_cicd_1203126
Litellm cicd 1203126
2026-03-12 19:07:33 +05:30
Sameer Kankute
b7cfcdd35d Add docs 2026-03-12 19:06:57 +05:30
Chesars
fa68d69bcf fix: restore _get_effort_level and is_model_gpt_5_4_plus_model (PR #23151)
Independent fix (base: main) collaterally removed by PR #23276.
Restores:
- _get_effort_level() for extracting effort from string or dict
- is_model_gpt_5_4_plus_model() classmethod
- effective_effort usage in xhigh/tool-drop/sampling/temperature guards
- Azure: _get_effort_level import and usage for dict reasoning_effort
- Azure: gpt-5.4+ tool+reasoning drop logic
2026-03-12 10:28:27 -03:00
Chesars
9d1bcc7d37 Merge upstream/main into litellm_oss_staging_03_11_2026
Restore independent fixes from main that were collaterally removed
when PR #23276 (staging_03_10 → main) carried a revert commit:
- bedrock: restore output_config pop (PR #23240)
- redact_messages: restore dict handling for ModelResponse (PR #23235)
- model_checks: restore list() copies to avoid cache mutation (PR #23236)
- openapi_to_mcp_generator: restore relative URL handling (PR #23238)
- vertex_ai/gemini: restore _LITELLM_INTERNAL_EXTRA_BODY_KEYS check (PR #23131)
- openai types: restore extra finish reasons (PR #22138)
- completion_extras: restore usage transformation logic

Accept main for: model_prices JSONs, credential_endpoints,
team_endpoints, object_permission_utils, responses transformation.
2026-03-12 10:25:13 -03:00
Sameer Kankute
bb451cfcb0 address greptile review feedback (greploop iteration 2)
- Thread api_version through HTTP handlers to Azure realtime endpoints
- Make expires_at optional in RealtimeClientSecretResponse
- Fix test token expiry times to be in the future
- Populate user_id and team_id in minimal_auth for spend tracking

Made-with: Cursor
2026-03-12 18:53:22 +05:30
Sameer Kankute
f4103c51a6 address greptile review feedback (greploop iteration 1)
- Add api-version query param to Azure realtime URLs
- Remove Content-Type from Azure realtime_calls headers (httpx sets it)
- Add token expiry validation in proxy_realtime_calls endpoint
- Fix type annotations for upstream_resp

Made-with: Cursor
2026-03-12 18:40:37 +05:30
Sameer Kankute
f5be79419c Fix test_claude_agent_sdk_streaming 2026-03-12 18:36:04 +05:30
Sameer Kankute
f6238e781e Fix mypy 2026-03-12 18:35:17 +05:30
Sameer Kankute
982f3917c5 Fix test_standard_logging_payload 2026-03-12 18:35:01 +05:30
Sameer Kankute
15d873e204 Fix update deprecated model test 2026-03-12 18:34:20 +05:30
Sameer Kankute
374c35a6b7 Fix update deprecated model test 2026-03-12 18:34:15 +05:30
Sameer Kankute
7c70015a5f Fix mcp error 2026-03-12 18:33:58 +05:30
Sameer Kankute
18df137021 Fix mypy error 2026-03-12 18:33:40 +05:30
Sameer Kankute
0f91a4f9da Fix test_get_tools_for_single_server 2026-03-12 18:33:14 +05:30
Sameer Kankute
412a283569 Revert "fix(vertex): skip harmful schema transforms for Gemini 2.0+ tool parameters"
This reverts commit a9c3095cc5.
2026-03-12 18:26:11 +05:30
Sameer Kankute
72c98489d1 Revert "fix(vertex): shallow copy parameters before mutating in _build_vertex_schema_for_gemini_2"
This reverts commit 08d81f5d7c.
2026-03-12 18:26:11 +05:30
Chesars
47e9a0dcf0 Merge branch 'litellm_oss_staging_03_11_2026' of https://github.com/BerriAI/litellm into litellm_oss_staging_03_11_2026 2026-03-12 09:39:22 -03:00
Chesars
1be6b31e2f merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
Sameer Kankute
7aa5bd3ff3
Merge pull request #23429 from BerriAI/litellm_dev_03_10_2026_p1
Litellm dev 03 10 2026 p1
2026-03-12 18:04:48 +05:30
Sameer Kankute
7778af6c78 Add tests 2026-03-12 17:54:57 +05:30
Sameer Kankute
e2be1aabae Add webrtc in init 2026-03-12 16:37:36 +05:30
Sameer Kankute
eb64cd6c46 Add webrtc transformations and http handler 2026-03-12 16:37:23 +05:30
Sameer Kankute
f793d2043b Add webrtc routing 2026-03-12 16:36:59 +05:30
Sameer Kankute
edd4463a28 Add webrtc endpoints 2026-03-12 16:36:33 +05:30
Cursor Agent
7737e9c313 feat(ui): migrate user_dashboard.tsx and user_info_view.tsx to /v2/user/info
- user_dashboard.tsx: Replace userInfoCall with userGetInfoV2 for spend data,
  remove keys/teams logic (keys come from props/useKeys hook, teams from fetchTeams)
- user_info_view.tsx: Replace userInfoCall with userGetInfoV2, flatten data
  structure from nested {user_info: {...}} to flat response, fetch team details
  separately using teamInfoCall, remove keys display (Virtual Keys section)
- Update user_dashboard.test.tsx and user_info_view.test.tsx mocks

Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
2026-03-12 07:50:36 +00:00
Cursor Agent
d03404d21e feat(ui): add userGetInfoV2 networking function and migrate useCurrentUser hook
- Add UserInfoV2Response type and userGetInfoV2() function in networking.tsx
- Migrate useCurrentUser hook from userInfoCall to userGetInfoV2
- Update useCurrentUser.test.ts to test new v2 API integration
- The hook no longer needs userRole since the endpoint handles auth itself

Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
2026-03-12 07:48:10 +00:00
Cursor Agent
679b8fd52a test: add unit tests for /v2/user/info endpoint and route checks
- 9 tests for the endpoint: admin access, self-lookup, unauthorized access,
  default to self, nonexistent user, response shape, team admin access,
  team admin denied, URL encoding
- 2 tests for route checks: route in info_routes, route access control

Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
2026-03-12 07:46:31 +00:00
Cursor Agent
81e3a2e421 feat: add /v2/user/info endpoint - lightweight user info with RBAC
- Add UserInfoV2Response type in _types.py (returns only user object, no keys/teams)
- Add /v2/user/info endpoint handler with proper access control:
  - Proxy admins can query any user
  - Team admins can query users in their teams
  - Internal users can query themselves only
  - Returns 404 for unauthorized/not-found (not 403)
- Add /v2/user/info to info_routes in LiteLLMRoutes
- Add route check passthrough in route_checks.py
- Add get_user_v2() method to Python client

Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
2026-03-12 07:43:55 +00:00
Sameer Kankute
e37efc4218
Merge pull request #23431 from BerriAI/litellm_gemini_model_map_update
Fix model cost for gemini-embedding-2-preview
2026-03-12 12:43:49 +05:30
Sameer Kankute
116795f7b4 Fix input_cost_per_video_per_second pricing 2026-03-12 12:43:08 +05:30
Sameer Kankute
36ec80d90c Fix azure model router 2026-03-12 12:40:37 +05:30
joereyna
791e598ad5 fix: add break on match and guard empty normalized_route in mapped route checks
- Add break after match in user_api_key_auth.py loop to avoid unnecessary
  iterations over remaining mapped routes
- Guard against normalized_route being empty when route == root_path exactly,
  which would otherwise match every mapped route via startswith("")
- Apply same empty-string guard in pass_through_endpoints.py for consistency
2026-03-11 23:50:34 -07:00
Joe Reyna
2848d5607f
Merge pull request #23417 from joereyna/fix/vertex-batch-cost-model-name
fix: update stale model name in vertex AI batch cost calculation test
2026-03-11 23:47:11 -07:00
Sameer Kankute
5927345eab Add get, list and delete for vector store endpoints 2026-03-12 12:09:51 +05:30
yuneng-jiang
2495579210
Merge pull request #23433 from BerriAI/litellm_fix_auth_error_message_typos
[Fix] Auth Error Message Typos
2026-03-11 23:31:33 -07:00
yuneng-jiang
9aab3eddb3 Fix typos in auth error messages for blocked teams and keys
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 23:30:14 -07:00
Sameer Kankute
18a05f7a40 feat(vector-stores): add retrieve/list/update/delete handlers
- Add vector_store_retrieve/list/update/delete handlers in llm_http_handler
- Fix AsyncHTTPHandler.get() timeout arg (not supported)
- Fix update/delete URL (api_base already includes /vector_stores)
- Clean metadata for update to avoid UserAPIKeyAuth JSON serialization

Made-with: Cursor
2026-03-12 11:58:44 +05:30
Sameer Kankute
5b83aae715 feat(azure_ai): show actual model used in Azure Model Router response
- Azure Model Router transform_response: let parent extract actual model from raw response
- common_request_processing: skip model override for Azure Model Router requests
- proxy_server: skip streaming chunk model restamp for Azure Model Router
- Add _is_azure_model_router_request helper
- Add tests for non-streaming and streaming

Made-with: Cursor
2026-03-12 11:41:19 +05:30
Joe Reyna
c4aa15b4e2
Merge pull request #23418 from joereyna/fix/gemini-passthrough-stale-model-name
fix: update stale gemini-1.5-flash model name in passthrough logging handler test
2026-03-11 22:55:19 -07:00
Ishaan Jaff
19db79db17
fix(mcp): OAuth2 chat connect - tools fetch, auth, and status fixes (#23406)
* fix(mcp): OAuth2 chat connect - tools fetch, auth flow, and status fixes

- schema.prisma: add missing MCP table fields (approval_status, submitted_by, submitted_at, reviewed_at, review_notes) to prevent destructive migrations
- rest_endpoints.py: inject user OAuth token via extra_headers for OAuth2 servers so tools list is populated; add server name->UUID resolution so MCPConnectPicker name lookups work
- mcp_registry.json: fix Atlassian defaults (transport: http, url: .../v1/mcp)
- ChatPage.tsx: read mcpOauthReturn param to init sidebarView="apps" on OAuth return, clean up param after mount
- MCPAppsPanel.tsx: auto-add OAuth2 servers to selectedServers when credential detected; onConnect also enables server for chat; disconnect removes from selectedServers
- mcp_servers.tsx: sort servers by created_at DESC
- useUserMcpOAuthFlow.tsx: append mcpOauthReturn=apps to return URL so Apps panel is mounted on return

* address greptile review feedback (greploop iteration 1)

* fix(mcp): inject stored OAuth2 token when fetching tools via /responses API

When a user has connected an OAuth2 MCP server (e.g. Atlassian) and then
uses the /responses endpoint with that server, tool listing was failing
because the stored per-user OAuth token was never injected.

Two fixes:
1. server.py: add _get_user_oauth_extra_headers_from_db() helper; call it
   in _get_tools_from_mcp_servers when oauth2_headers is None for an OAuth2
   server, falling back to the user's stored token in LiteLLM_MCPUserCredentials
2. litellm_proxy_mcp_handler.py: also intercept MCP tools whose server_url
   matches */mcp/<server_name> (e.g. http://localhost:4000/mcp/atlassian_test)
   by rewriting them to litellm_proxy/mcp/<server_name> so they go through
   the internal handler (and get the OAuth token injected) instead of being
   forwarded to OpenAI raw where localhost is unreachable

* address greptile review feedback (greploop iteration 2)

* test(mcp): add unit test for OAuth2 token injection in _get_tools_from_mcp_servers

Verifies that when _get_tools_from_mcp_servers is called for an OAuth2 MCP
server without oauth2_headers in the request, the implementation:
- calls _prefetch_oauth_creds_for_user once (not per-server) to avoid N+1 queries
- passes the stored token as extra_headers={"Authorization": "Bearer ..."} to
  _get_tools_from_server so the upstream OAuth2 MCP server authenticates correctly

* address greptile review feedback (greploop iteration 3)

* address greptile review feedback (greploop iteration 4)

* address greptile review feedback (greploop iteration 5)

* redesign credentials table to use Tremor table layout matching Keys page

* fix: /server/oauth authorize 422 - make client_id optional, fall back to real DB server

* fix: mcp_token client_id optional, resolve from server record

* fix: look up real server by UUID (get_mcp_server_by_id) before falling back to name

* Update litellm/responses/mcp/litellm_proxy_mcp_handler.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix: address greptile feedback - client_id guards, dict spread, helper refactor, tests

- mcp_management_endpoints: raise 400 when resolved_client_id is empty in
  mcp_authorize and mcp_token instead of forwarding "" to upstream
- litellm_proxy_mcp_handler: use {**tool, "server_url": ...} spread instead
  of dict(tool) + mutation for shallow copy safety
- rest_endpoints: extract _oauth2_server_ids set comprehension to a named
  _get_oauth2_server_ids() helper for clarity; add Set to typing imports
- test_rest_endpoints: add tests for name→UUID resolution path,
  access-denied when resolved UUID not in allowed list, and OAuth2 user
  token injection for single-server requests; fix fake_get_tools signature
  to accept extra_headers kwarg

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-11 22:07:02 -07:00
Sameer Kankute
59643cbcad Fix model cost for gemini-embedding-2-preview 2026-03-12 10:20:52 +05:30
Alvin Tang
2b7b7d3086
fix(snowflake): transform string tool_choice to object format (#23318)
Snowflake's Cortex LLM API (like Anthropic) requires tool_choice as an
object with a "type" field, not as a bare string. Passing tool_choice="auto"
(or "required"/"none") results in error 390142 "invalid payload".

This fix transforms OpenAI string tool_choice values to the Snowflake
object format:
- "auto"     -> {"type": "auto"}
- "required" -> {"type": "any"}  (Snowflake/Anthropic convention)
- "none"     -> {"type": "none"}

The dict-to-dict transformation for specific function tool choices
({"type": "function", "function": {"name": "..."}} -> {"type": "tool",
"name": [...]}) remains unchanged.

Fixes #23284

Co-authored-by: gambletan <tan@echooo.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2026-03-11 21:29:59 -07:00
Ishaan Jaff
b0aa71ed9b
feat(ui): group MCP tools by CRUD risk category in allowlist panels (#23403)
* feat(ui): group MCP tools by CRUD risk category in tool permission panels

Adds a CRUD-classification layer to the MCP tool allowlist UI so admins
can allow/block an entire risk category (Read / Create / Update / Delete)
with a single toggle instead of managing a flat list of individual tools.

- New `mcpToolCrudClassification.ts` utility: regex-based classifier that
  buckets tool names/descriptions into read/create/update/delete/unknown
- New `McpCrudPermissionPanel` component: collapsible sections per CRUD
  group, group-level Switch toggle, individual tool checkboxes, risk badges
  (green Safe / yellow Medium / red High Risk)
- `mcp_tool_configuration.tsx`: adds "Risk Groups / Flat List" radio toggle;
  defaults to the CRUD-grouped view, flat list is still accessible
- `MCPToolPermissions.tsx` (key/team assignment): replaces flat checkboxes
  with the CRUD panel; adds per-server view toggle; delete tools are blocked
  by default for newly-added servers (safer default for key/team scoping)

No backend or schema changes — uses existing `allowed_tools` and
`mcp_tool_permissions` fields.

* fix(mcp): OAuth2 chat connect - tools fetch, auth flow, and status fixes

- schema.prisma: add missing MCP table fields (approval_status, submitted_by, submitted_at, reviewed_at, review_notes) to prevent destructive migrations
- rest_endpoints.py: inject user OAuth token via extra_headers for OAuth2 servers so tools list is populated; add server name->UUID resolution so MCPConnectPicker name lookups work
- mcp_registry.json: fix Atlassian defaults (transport: http, url: .../v1/mcp)
- ChatPage.tsx: read mcpOauthReturn param to init sidebarView="apps" on OAuth return, clean up param after mount
- MCPAppsPanel.tsx: auto-add OAuth2 servers to selectedServers when credential detected; onConnect also enables server for chat; disconnect removes from selectedServers
- mcp_servers.tsx: sort servers by created_at DESC
- useUserMcpOAuthFlow.tsx: append mcpOauthReturn=apps to return URL so Apps panel is mounted on return

* fix(mcp-crud-ui): address greptile review feedback

- use Checkbox (not Switch) for group toggle so indeterminate works
- add toolPermissionsRef to avoid stale closure race on concurrent server fetches
- remove unused blockDeleteByDefault prop from McpCrudPermissionPanel
- classify tools by name first; fall back to description only when name yields no match
- add Risk Groups / Flat List toggle to mcp_tool_configuration.tsx

* fix(mcp-crud-ui): address greptile 3/5 review

- remove non-functional XIcon remove-server button (no onRemoveServer prop wired)
- fix stale closure in MCPAppsPanel auto-enable effect: use serversRef/selectedServersRef
- remove utility re-export from McpCrudPermissionPanel (classifyToolOp, groupToolsByCrud)
- remove redundant selectedTools.length === 0 guard (always true when !toolPermissions[id])

* fix(mcp-crud-ui): address greptile 3/5 review round 2

- check READ_RE before DELETE_RE in classifyToolOp so tools like
  get_removed_entries are not silently blocked by delete-by-default
- expand undefined (allow-all) to full tool name list instead of
  collapsing to [] (allow-none) in MCPToolPermissions and mcp_tool_configuration
- log OAuth credential fetch failures instead of silently swallowing them

* fix: cursor-pointer on read-only rows, stable sort, simplify handleCrudPanelChange

* fix: sanitize user_id/server_id in log to prevent log injection

* fix: add OAuth headers to call_tool_rest_api, fix stale accessToken closure, fix group toggle on filtered subset

* fix: batch OAuth creds query, hide empty CRUD groups on search, onChange stability

* fix: double-add race, conditional bulk query, narrow DELETE_RE, hoist search input

* fix(mcp): clear oauthConnected on deselect; null guard on allowedTools prop

* fix(mcp): remove user-provided values from debug log to fix log-injection lint

* fix(mcp): fix allowedTools undefined semantics; remove unused import and color field
2026-03-11 21:15:25 -07:00
yuneng-jiang
626d120873
Merge pull request #23425 from BerriAI/cursor/litellm-ci-stability-4513
[Infra] CI/CD Fixes
2026-03-11 21:08:16 -07:00
Sameer Kankute
53e8e3ec24
Merge pull request #23426 from BerriAI/revert-20795-chore/remove-deprecated-models
Revert "chore: cleanup deprecated models from pricing JSON"
2026-03-12 09:28:45 +05:30
Sameer Kankute
49d653c3aa
Revert "chore: cleanup deprecated models from pricing JSON" 2026-03-12 09:27:40 +05:30
yuneng-jiang
ce80e16755
Merge pull request #23419 from BerriAI/litellm_audit_log_admin_viewer
[Feature] Allow Admin Viewers to Access Audit Logs
2026-03-11 20:40:48 -07:00
Krrish Dholakia
e7f17a873f feat: enhancements to agent flow on LiteLLm 2026-03-11 20:38:32 -07:00