Commit graph

35104 commits

Author SHA1 Message Date
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
ryan-crabbe
a976fccd76
Merge pull request #23422 from BerriAI/litellm_guardrail-info-helpers-tests
tests: add ui unit tests for guardrail_info_helpers
2026-03-11 20:17:45 -07:00
yuneng-jiang
76cff9ae0e Allow proxy_admin_viewer to access audit log endpoints
Add /audit and /audit/{id} to admin_viewer_routes so read-only admins
can view audit logs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:07:51 -07:00
Ryan Crabbe
8c4603641e test(ui): add unit tests for guardrail_info_helpers
Cover populateGuardrailProviders, getGuardrailProviders,
shouldRender* config checks, and getGuardrailLogoAndName.
2026-03-11 20:07:30 -07:00
yuneng-jiang
5d7bfe6260
Merge pull request #23407 from BerriAI/cursor/litellm-ci-stability-4513
LiteLLM CI stability
2026-03-11 20:03:07 -07:00
ryan-crabbe
6229e73dfc
Merge pull request #23415 from BerriAI/litellm_style-created-by-not-uuid
style: make virtual keys tables' created by not a UUID
2026-03-11 19:53:39 -07:00
Joe Reyna
483a605f6e
fix: add custom_body param to URL-based endpoint_func in create_pass_through_route (#23412) 2026-03-11 19:46:50 -07:00
Joe Reyna
36819ffb6f
fix: null AWS SigV4 fields on MagicMock in TestTemporaryMCPSessionEndpoints (#23408)
* fix(test): null AWS SigV4 fields on MagicMock in test_inherit_credentials_from_existing_server

* fix(test): null AWS SigV4 fields on MagicMock in test_add_session_mcp_server_caches_and_redacts_credentials
2026-03-11 19:46:08 -07:00
Ryan Crabbe
dfda7c10fc fix: set created_by on mock keys in test_list_keys_with_expand_user 2026-03-11 19:45:04 -07:00
ryan-crabbe
2a879ef6f3
Merge pull request #23181 from BerriAI/feat_agg_token_totals
Feat add token totals
2026-03-11 19:30:30 -07:00
ryan-crabbe
2e3c1c41a7
Merge pull request #23371 from BerriAI/litellm_fix-refetch-mcp-after-add
fix: refetching mcp after creating
2026-03-11 19:27:00 -07:00
Shivam Rawat
74a9dbd8ac
Merge pull request #23413 from BerriAI/docs_policyy_builder
v1.82.0 promote to stable
2026-03-11 19:19:15 -07:00
Ryan Crabbe
4973311070 test: add tests for created_by_user expansion in key list 2026-03-11 19:16:09 -07:00
shivam
0c7c0a93ed v1.82.0 promote to stable 2026-03-11 19:15:21 -07:00
Ryan Crabbe
d4fa990176 feat(ui): show user email/alias instead of UUID in Virtual Keys "Created By" column
Expand the existing expand=user lookup on /key/list to also resolve
created_by user IDs, and display the result in the Created By column
with alias > email > UUID fallback and a popover showing all three.
2026-03-11 19:12:14 -07:00
Shivam Rawat
50e68dc387
Merge pull request #23410 from BerriAI/docs_policyy_builder
Docs policyy builder
2026-03-11 19:03:55 -07:00
Shivam Rawat
4e7003afef
Fix 404 when fetching config-based MCP servers by ID (#22711)
* fixed mcp api

* added non-admin test

* resolved greptile comemnt

* fix: add IP filtering to get_mcp_server_by_id path in fetch_mcp_server

Apply _is_server_accessible_from_ip check after get_mcp_server_by_id lookup
to prevent external callers from accessing MCP servers configured with
available_on_public_internet=False when they know the server_id.

Made-with: Cursor
2026-03-11 18:30:30 -07:00
Cursor Agent
49dc391a46 fix(ci): remove unused is_expired variable (ruff F841) and handle ModelDeprecated in image gen test
- Remove dead code: is_expired was assigned but never used in
  mcp_management_endpoints.py (the raw expires_at timestamp is passed
  directly to the client per existing comment)
- Handle Azure DALL-E 3 ModelDeprecated (HTTP 410) error gracefully in
  base_image_generation_test.py so CI doesn't fail on deprecated model
  deployments

Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
2026-03-12 01:27:42 +00:00
github-actions[bot]
85f66ea9c7
chore: regenerate poetry.lock to match pyproject.toml (#23405)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-12 01:09:56 +00:00
yuneng-jiang
2731337ba3
Merge pull request #23404 from BerriAI/litellm_proxy_extras_mar11_2
chore: bump proxy extras
2026-03-11 18:08:57 -07:00
yuneng-jiang
299ee16780 adding build 2026-03-11 18:08:20 -07:00
yuneng-jiang
e1674bd34f bump: version 0.4.53 → 0.4.54 2026-03-11 18:07:58 -07:00
yuneng-jiang
d39355d36f
Merge pull request #23402 from BerriAI/litellm_proxy_extras_mar11
Revert "fix: add missing indexes for top CPU-consuming queries (#23147)"
2026-03-11 18:00:47 -07:00
yuneng-jiang
64ed29db57 Revert "fix: add missing indexes for top CPU-consuming queries (#23147)"
This reverts commit 323b473835.
2026-03-11 17:40:59 -07:00
yuneng-jiang
56557bfae1
Merge pull request #23400 from BerriAI/litellm_/elated-hoover
[Fix] Replace deprecated models in tests
2026-03-11 17:25:37 -07:00
Ryan Crabbe
62343b477c fix: use Grid layout for token cards and guard against NaN in paginated aggregation 2026-03-11 17:20:38 -07:00
yuneng-jiang
82de82f1b6 Fix test_completion_cost_prompt_caching gemini parametrization
gemini/gemini-2.5-flash lacks cache_creation_input_token_cost in the
model cost map, causing a TypeError when the test multiplies
cache_creation_input_tokens by None. Use claude-haiku-4-5 instead,
which has the required prompt caching cost fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:12:15 -07:00
yuneng-jiang
c9f7075690 Replace additional deprecated models across test files
- tests/local_testing/test_completion_cost.py:
  - claude-3-5-sonnet-20240620 -> claude-sonnet-4-6
  - gemini/gemini-1.5-flash-001 -> gemini/gemini-2.5-flash

- tests/test_litellm/test_utils.py:
  - claude-3-5-sonnet-20240620 -> claude-sonnet-4-6 (VertexAI config test, proxy tests)
  - gemini-1.5-pro -> gemini-2.5-pro (pre_process_non_default_params)
  - gemini/gemini-1.5-pro -> gemini/gemini-2.5-pro (proxy tests)

- tests/litellm_utils_tests/test_utils.py:
  - claude-3-opus-20240229 -> claude-sonnet-4-6 (trimming, vision tests)
  - gemini-pro -> gemini-2.5-pro (function calling test)
  - gemini-pro-vision -> gemini-2.5-flash (vision test)
  - gemini-1.5-pro -> gemini-2.5-pro (response schema test)
  - gemini/gemini-1.5-flash -> gemini/gemini-2.5-flash (function calling test)
  - gemini-1.5-pro -> gemini-2.5-pro (vision gemini test)
  - gpt-4-vision-preview -> gpt-4o (vision test)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:03:54 -07:00
ryan-crabbe
fdfb65c204
Merge pull request #23395 from BerriAI/litellm_fix-default-user-perms-respected-through-SCIM
fix: fix default user perms respected through SCIM
2026-03-11 16:57:29 -07:00
Ryan Crabbe
7e1c860ffe fix: make token breakdown cards click-to-expand on Total Tokens card 2026-03-11 16:52:25 -07:00
yuneng-jiang
9379cb1038 [Fix] Replace deprecated models in function calling tests
Replace deprecated model references in test_proxy_function_calling_support_consistency:
- claude-3-5-sonnet-20240620 -> claude-sonnet-4-6
- gemini-pro -> gemini-2.5-pro
- gemini/gemini-1.5-pro -> gemini/gemini-2.5-pro
- gemini/gemini-1.5-flash -> gemini/gemini-2.5-flash

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:46:56 -07:00
yuneng-jiang
c239d33925
Merge pull request #23393 from BerriAI/litellm_ui_component_tests
[Test] Add Unit Tests for 5 UI Components
2026-03-11 16:44:15 -07:00
ryan-crabbe
e4e5436bc2
Merge pull request #23399 from BerriAI/revert-23174-feat_adding_timezone_to_usage_page
Revert "feat: adding a timezone picker to the usage page"
2026-03-11 16:34:14 -07:00
yuneng-jiang
8617ca6e12
Merge pull request #23390 from BerriAI/litellm_/reverent-kalam
[Fix] Update test_bad_database_url CI check for new error message
2026-03-11 16:33:45 -07:00
ryan-crabbe
c2c102c6e2
Revert "feat: adding a timezone picker to the usage page" 2026-03-11 16:33:03 -07:00
yuneng-jiang
28989a11e7 [Fix] Update test_bad_database_url to match new startup error message
PR #23257 changed proxy startup to exit early with "Database setup
failed after multiple retries" instead of letting uvicorn emit
"Application startup failed. Exiting." Update the CI grep check
to accept either error message for robustness.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:25:35 -07:00
Ishaan Jaff
f5e5d17e4a
fix(mcp): fix OpenAPI OAuth flow — transport mapping, error messages, and discovery bypass (#23315)
* fix(mcp): fix OpenAPI OAuth flow — transport mapping, error messages, and discovery bypass

Three bugs fixed to make the end-to-end OAuth flow work for OpenAPI MCP servers:

1. **Transport mapping in getTemporaryPayload**: `TRANSPORT.OPENAPI` is a UI-only concept;
   the backend only accepts `"http"`, `"sse"`, or `"stdio"`. The pre-OAuth temp-session
   call was sending `transport: "openapi"` and getting a 422. Fixed by mapping to `"http"`.

2. **deriveErrorMessage handles FastAPI 422 arrays**: FastAPI validation errors return
   `detail` as an array of `{loc, msg, type}` objects. The shared error extractor was
   returning the array directly, causing `Error: [object Object]`. Fixed to map each
   item to its `.msg` field.

3. **Skip OAuth discovery when authorization_url already provided**: `build_mcp_server_from_table`
   was unconditionally calling `_descovery_metadata(server_url)` for OAuth servers. For
   OpenAPI servers the url is the spec JSON file, not the API base — this caused a timeout
   fetching e.g. the GitHub spec (2 MB). Fixed by skipping discovery when `authorization_url`
   is already set.

Also: collapsible auth section in MCP server form, "Create OAuth App →" link next to
Client ID when a docs URL is available (e.g. GitHub OAuth App creation page), and
`extractErrorMessage` helper in `useMcpOAuthFlow` for cleaner error display.

* refactor(mcp): extract needs_discovery flag and reduceStaticHeaders helper

* feat(mcp): user OAuth connect flow — OAuthConnectModal, MCPCredentialsTab, useUserMcpOAuthFlow

Adds the user-facing MCP OAuth2 PKCE connect flow:

- OAuthConnectModal: modal that launches the PKCE flow for a user to connect to an MCP server
- MCPCredentialsTab: credentials management tab in the MCP apps panel
- useUserMcpOAuthFlow: hook that handles the full PKCE auth code exchange for user-level connections
- MCPAppsPanel: wires up the new credentials tab and connect modal
- ChatPage: further cleanup after responses-API revert
- db.py / mcp_management_endpoints.py / _types.py: backend support for storing user MCP credentials

* fix(mcp): make client_id optional in /authorize — use server's stored client_id when not provided

* address greptile review feedback

* fix(mcp): narrow bare except to RecordNotFoundError in BYOK credential delete

* refactor(mcp): move inline imports to module level in db.py

* docs(claude): add MCP OAuth, transport mapping, and browser storage patterns

* fix(security): remove accessToken from sessionStorage in OAuth flow state

The LiteLLM API key was being serialised into sessionStorage as part of
StoredFlowState. After the OAuth redirect the component re-mounts with the
same accessToken prop, so it never needed to be stored. Read it from props
in resumeOAuthFlow instead.

* fix(ui): remove duplicate extractErrorMessage, sessionStorage-only in admin OAuth hook, call delete API on disconnect

* fix(ui): guard resumeOAuthFlow against wrong hook instance consuming OAuth result

* fix(ui): separate OAuth result keys per flow, sessionStorage-only, surface revoke errors

* fix(ui): remove dead OAuthConnectModal, revert tsconfig jsx mode to preserve

* fix(mcp): guard BYOK overwrite in oauth credential store, raise clear error when client_id absent

* fix: forward OAuth error params in callback, fix BYOK guard exception handling in db.py
2026-03-11 16:16:08 -07:00
yuneng-jiang
1f721fd133
Merge pull request #23394 from BerriAI/litellm_internal_dev_staging_branch
[Infra] Add Daily Internal Dev Staging Branch
2026-03-11 15:57:18 -07:00
yuneng-jiang
202b5b29de Add daily internal dev branch creation job
Adds a new job to the existing daily staging branch workflow that creates
a `litellm_internal_dev_MM_DD_YYYY` branch from main twice a day. This
branch serves as a staging area before merging into main to improve
stability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:53:42 -07:00
yuneng-jiang
4405837aaa Add unit tests for 5 untested UI components
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:46:14 -07:00
Ryan Crabbe
18c0e8843c test: unit test for mkaing sure that user being created with correct value 2026-03-11 15:20:17 -07:00
yuneng-jiang
56af724943
Merge pull request #23379 from BerriAI/litellm_ui_perf_fixes
[Fix] UI - Usage: Memoize Expensive Computations in UsagePageView
2026-03-11 14:55:23 -07:00
yuneng-jiang
52f93aedc2
Merge pull request #23387 from BerriAI/litellm_fix_ruff_lint_errors
[Fix] Ruff Lint Errors: Unused Imports, Undefined Names, Statement Counts
2026-03-11 14:39:44 -07:00
ryan-crabbe
79058ad596
Merge pull request #23174 from BerriAI/feat_adding_timezone_to_usage_page
feat: adding a timezone picker to the usage page
2026-03-11 14:38:19 -07:00
yuneng-jiang
896e7b7623
Merge pull request #23367 from BerriAI/litellm_auto_redirect_sso_config
[Feature] Support auto_redirect_ui_login_to_sso in config.yaml
2026-03-11 14:37:24 -07:00
yuneng-jiang
3968146f67
Merge pull request #23363 from BerriAI/litellm_fix_is_master_key_none_api_key
[Fix] TypeError in spend tracking when request has no API key
2026-03-11 14:34:44 -07:00
yuneng-jiang
9c0cd6e02e Fix ruff lint errors: unused imports, undefined names, and statement counts
Remove unused imports (F401), add missing TYPE_CHECKING imports for
forward references (F821), and extract helpers to reduce statement
counts below the 50-statement limit (PLR0915).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:34:43 -07:00
yuneng-jiang
b5dfde892c
Merge pull request #23377 from BerriAI/litellm_fix_flaky_mcp_and_agentcore_tests
[Fix] Flaky MCP Server and AgentCore Streaming Tests
2026-03-11 13:20:59 -07:00
yuneng-jiang
13c0741262 Memoize expensive computations in UsagePageView to prevent unnecessary recalculations on every render
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:20:50 -07:00