Commit Graph
3161 Commits
Author SHA1 Message Date
Ryan Crabbe c098eca509 fix(ui): CSV export empty on Global Usage page
Aggregated endpoint returns empty breakdown.entities; fall back to
grouping breakdown.api_keys by team_id.
2026-03-16 22:36:23 -07:00
yuneng-jiangandClaude Opus 4.6 8f56ddb9c6 Merge remote main into litellm_ci_optimize
Resolved conflict in test_claude_agent_sdk.py by keeping main's additions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 00:50:22 -07:00
yuneng-jiangandClaude Opus 4.6 eb7222c7cb [Infra] Reduce CI no_output_timeout and tighten Playwright timeouts
- Change no_output_timeout from 120m/60m to 15m across all test jobs
- Fix multi-line YAML formatting for no_output_timeout entries
- Reduce Playwright per-test timeout from 4min to 3min
- Add 15s actionTimeout and 30s navigationTimeout to Playwright config

Hanging tests now fail in 15min instead of 2hrs, cutting wasted CI time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 19:38:10 -07:00
yuneng-jiang 82fc819abf Merge remote-tracking branch 'origin' into litellm_internal_dev_03_14_2026 2026-03-14 18:35:03 -07:00
yuneng-jiangandGitHub a2708f332f Merge pull request #23658 from BerriAI/litellm_internal_dev_03_13_2026
[Infra] Merge internal dev 3/13 with main
2026-03-14 14:22:27 -07:00
yuneng-jiangandGitHub 2c840f1e8c Merge pull request #23622 from BerriAI/litellm_usage_page_auto_pagination
[Feature] UI - Usage: Auto-paginate daily spend data
2026-03-14 11:44:05 -07:00
yuneng-jiangandClaude Opus 4.6 d26faeb844 [Fix] UI - Usage: Reduce batch size to 3, add loading spinner to fetch banner
- Reduce RENDER_BATCH_SIZE from 5 to 3 for more frequent chart updates
- Add LoadingOutlined spinner at the start of all fetching Alert banners

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 11:28:15 -07:00
yuneng-jiangandGitHub 6b783cc0c5 Merge pull request #23614 from BerriAI/litellm_team_default_permissions
[Feature] UI - Default Team Settings: Modernize page and fix defaults application
2026-03-14 11:12:07 -07:00
yuneng-jiangandClaude Opus 4.6 f72931a463 [Feature] UI - Usage: Prominent fetch banner, batched pagination renders
Replace subtle loading text with antd Alert banners that clearly communicate
pagination status, and batch state flushes to reduce chart re-renders.

- Replace inline loading text with warning Alert banners showing progress,
  "open a new tab" link with ExportOutlined icon, and primary Stop button
- Batch setData calls every 5 pages instead of per-page to cut re-renders ~80%
- Reduce fetch delay from 500ms to 300ms for faster data loading
- Add "Charts will update periodically" messaging to set expectations
- Fix pre-existing TS error: Button icon prop was using render function instead of ReactNode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 11:09:10 -07:00
yuneng-jiangandGitHub e8e46af8b0 Merge pull request #23638 from BerriAI/litellm_ui_user_info_teams
[Feature] UI - Internal Users: Add/Remove Team Membership
2026-03-14 10:12:57 -07:00
yuneng-jiangandClaude Opus 4.6 db37f31099 [Fix] Address review feedback on paginated daily activity hook
1. Replace ...args spread in useEffect deps with JSON.stringify(args) key
   to prevent infinite re-renders when callers pass unstable array references.
2. Add missing agentCancelled partial-data message in EntityUsage so the
   outer condition no longer renders an empty div.
3. Store setTimeout ID in a ref and clearTimeout on cleanup/cancel to avoid
   orphaned timers under rapid re-renders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 09:55:57 -07:00
yuneng-jiangandClaude Opus 4.6 0cd4a68157 [Fix] Add missing networking mocks to CreateKeyPage test
The test's partial vi.mock of @/components/networking was missing the daily
activity call exports now imported by EntityUsage via ENTITY_FETCH_FNS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 09:47:56 -07:00
yuneng-jiangandGitHub 36c076d56c Merge pull request #23550 from Sameerlite/litellm_azure-model-router-cost-breakdown
feat(azure): Azure Model Router cost breakdown in UI + additional_costs from hidden_params
2026-03-14 09:39:04 -07:00
yuneng-jiangandClaude Opus 4.6 83e6096dae [Feature] UI - Internal Users: Add/remove team membership from user info page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 09:37:44 -07:00
yuneng-jiangandClaude Opus 4.6 3ae9e070d9 [Feature] UI - Usage: Auto-paginate daily spend data with progressive rendering
Previously, EntityUsage only fetched page 1 of paginated daily spend endpoints,
showing incomplete data. UsagePageView fetched all pages but blocked the UI until
completion. This adds a reusable usePaginatedDailyActivity hook that fetches pages
sequentially with 500ms delays, updates charts progressively, and supports
cancellation on unmount or user action.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 00:30:03 -07:00
yuneng-jiangandClaude Opus 4.6 f0d283cf9f [Feature] UI - Default Team Settings: Modernize page and fix defaults application
Rewrite Default Team Settings UI from Tremor to antd with hardcoded fields,
fix default team params not applying during team creation or persisting
across proxy restarts, remove dead code, and add comprehensive tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 00:01:25 -07:00
yuneng-jiangandGitHub 957dbf506d Merge pull request #23607 from BerriAI/litellm_ui_component_unit_tests
[Test] UI - Add Unit Tests for 5 Untested Components
2026-03-13 23:18:00 -07:00
25ee2fb3f9 fix(security): bump tar to 7.5.11 and tornado to 6.5.5 (#23602)
* fix(security): bump tar to 7.5.11 and tornado to 6.5.5

- tar >=7.5.11: fixes CVE-2026-31802 (HIGH) in node-pkg
- tornado >=6.5.5: fixes CVE-2026-31958 (HIGH) and GHSA-78cv-mqj4-43f7 (MEDIUM) in python-pkg

Addresses vulnerabilities found in ghcr.io/berriai/litellm:main-v1.82.0-stable Trivy scan.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: document tar override is enforced via Dockerfile, not npm

* fix: revert invalid JSON comment in package.json tar override

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 23:08:14 -07:00
yuneng-jiangandClaude Opus 4.6 1b0c4bdbb7 Add unit tests for 5 previously untested UI components
Tests for HelpLink, ScoreChart, AgentCard, ToolPoliciesView, and CostBreakdownViewer (33 tests total).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 22:48:50 -07:00
Ethan T.andGitHub 7bb2d78394 fix: add getPopupContainer to Select components in fallback modal to fix z-index issue (#23516)
The model dropdown menus in the Add Fallbacks modal were rendering behind
the modal overlay because Ant Design portals Select dropdowns to document.body
by default. By setting getPopupContainer to attach the dropdown to its parent
element, the dropdown inherits the modal's stacking context and renders above
the modal.

Fixes #17895
2026-03-13 21:58:58 -07:00
yuneng-jiangandClaude Opus 4.6 bce37e28c3 [Test] Add tests for organization dropdown in key create/edit
- OrganizationDropdown: renders options, calls onChange on selection,
  applies disabled state, handles empty list
- CreateKey: org dropdown renders, disabled for non-admin users,
  enabled for admins, form state updates on org selection
- KeyEditView: org dropdown renders, disabled for non-admin,
  enabled for admin, initializes from keyData.organization_id

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 18:15:42 -07:00
yuneng-jiang 8069829c59 Merge branch 'litellm_internal_dev_03_13_2026' of github.com:BerriAI/litellm into litellm_ui_keys_org_13 2026-03-13 17:13:43 -07:00
yuneng-jiang c6da45795b temp commit 2026-03-13 17:12:30 -07:00
yuneng-jiang 0b3dc00440 Merge remote-tracking branch 'origin' into litellm_internal_dev_03_12_2026 2026-03-13 15:11:49 -07:00
Sameer Kankute 7e662afe01 feat(azure): Azure Model Router cost breakdown in UI + additional_costs from hidden_params
- Backend: Use request model from hidden_params for Azure Model Router additional_costs when response has actual model
- Backend: Add additional_costs to total cost calculation
- UI: Show all non-null/non-zero additional_costs in CostBreakdownViewer
- UI: Render cost breakdown when only additional_costs exist
- Tests: Backend test for hidden_params flow; frontend tests for additional_costs

Made-with: Cursor
2026-03-13 18:25:29 +05:30
yuneng-jiangandGitHub beb521b241 Merge pull request #23437 from BerriAI/litellm_user-info-endpoint-v2-24cc
[Feature] User Info V2 Endpoint
2026-03-12 17:39:03 -07:00
yuneng-jiangandClaude Opus 4.6 c557286cac Add unit tests for 5 untested MCP tools components
Cover utils, types, MCPStandardsSettings, MCPLogoSelector, and
mcp_connection_status with 44 behavior-focused Vitest tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 15:24:44 -07:00
Cesar GarciaandGitHub ec763784e0 Merge branch 'main' into litellm_oss_staging_03_11_2026 2026-03-12 16:21:28 -03:00
yuneng-jiang c8ce098b65 fixing tests 2026-03-12 11:24:15 -07:00
yuneng-jiang e38edb6190 fixing ui build 2026-03-12 10:51:49 -07:00
Cesar GarciaandGitHub e01d722803 Merge branch 'main' into litellm_oss_staging_03_11_2026 2026-03-12 13:53:14 -03:00
Sameer KankuteandGitHub d1a99f571e Merge pull request #23446 from BerriAI/litellm_add_webrtc_support
[Feat] Add WebRTC support
2026-03-12 22:16:55 +05:30
Sameer Kankute 507bced04f Fix the live tester 2026-03-12 22:14:08 +05:30
Chesars 4e6e1d8de8 merge: resolve conflicts with upstream staging (bedrock + mcp tests)
Keep both sets of tests: upstream's OAuth2 token injection test and
our case-insensitive tool matching tests. Use upstream's version of
the bedrock output_config test (more comprehensive).
2026-03-12 13:40:16 -03:00
Chesars feed274aa3 Reapply "feat: add model_cost aliases expansion support"
This reverts commit 3d2df7e8b5.
2026-03-12 13:36:57 -03:00
Sameer Kankute b7cfcdd35d Add docs 2026-03-12 19:06:57 +05:30
Chesars 1be6b31e2f merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
Sameer KankuteandGitHub 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
Cursor Agentandyuneng-jiang 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 Agentandyuneng-jiang 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
Ishaan JaffGitHubgreptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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
Ishaan JaffandGitHub 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
Krrish Dholakia e7f17a873f feat: enhancements to agent flow on LiteLLm 2026-03-11 20:38:32 -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
ryan-crabbeandGitHub 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
ryan-crabbeandGitHub 2a879ef6f3 Merge pull request #23181 from BerriAI/feat_agg_token_totals
Feat add token totals
2026-03-11 19:30:30 -07:00
ryan-crabbeandGitHub 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
Ryan Crabbe 4973311070 test: add tests for created_by_user expansion in key list 2026-03-11 19:16:09 -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
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