Commit graph

4874 commits

Author SHA1 Message Date
yuneng-jiang
cbcbbff604 fixing tests 2026-02-09 14:45:08 -08:00
yuneng-jiang
409d12b7a5 Add alert about email notifications 2026-02-09 14:40:51 -08:00
yuneng-jiang
c2536ee82a refactor antd tabs and table 2026-02-09 14:05:05 -08:00
yuneng-jiang
f8660a8ab0
Merge pull request #20780 from BerriAI/litellm_ui_coverage_04
[Refactor] UI - Remove unused files + Add unit tests
2026-02-09 13:02:42 -08:00
yuneng-jiang
ff5a3acc1c addressing feedback around tests 2026-02-09 12:07:53 -08:00
yuneng-jiang
fb4daad8d4 refactor: remove some unused files and add tests 2026-02-09 11:50:40 -08:00
yuneng-jiang
a7ed3f240c Show predefined error codes in UI with user adjustable fallback 2026-02-09 11:08:28 -08:00
Sameer Kankute
f929461fc6
Merge pull request #20702 from emerzon/fix/issue-20698-stream-chunk-thinking-blocks
fix(streaming): preserve interleaved thinking/redacted_thinking blocks
2026-02-09 16:32:43 +05:30
Varun Chawla
c8d9547095
fix(ui): add null guard for models in API keys table (#20655)
The VirtualKeysTable crashed when rendering keys with null or undefined
models field. The className expression tried to access .length on null,
throwing a TypeError that broke the entire keys table.

Added Array.isArray() guard before accessing .length on the models value.

Fixes #20611
2026-02-07 23:00:33 -08:00
Varun Chawla
7335965c12
fix: show error details instead of Data Not Available for failed requests (#20656) 2026-02-07 22:59:49 -08:00
Harshit Jain
3b043ee8bf
fix critical CVE vulnerabliltes (#20683) 2026-02-07 22:23:01 -08:00
Varun Chawla
e24ea2897a
fix: empty guardrails/policies arrays should not trigger enterprise license check (#20567)
* fix: empty guardrails/policies arrays should not trigger enterprise license check (#20304)

The UI sends empty arrays for enterprise-only fields (guardrails, policies,
logging) even when the user has not configured these features. The backend
`is not None` check treated `[]` as a truthy intent to use the feature,
falsely requiring an enterprise license for basic team operations.

Backend: Add `and updated_kv[field] != [] and updated_kv[field] != {}`
guards in `_update_metadata_fields` so empty collections are skipped.

UI: Conditionally omit guardrails, logging, and policies from the
payload when empty instead of defaulting to `[]`.

Fixes #20304

* fix: allow clearing fields with empty collections while skipping enterprise check

Address PR review feedback:

1. Move the empty-collection guard into _update_metadata_field (singular)
   so that empty lists/dicts skip only the premium license check but still
   get written into metadata. This lets users intentionally clear a
   previously-set field (e.g. guardrails: []) without being blocked, while
   the UI's default empty arrays still don't trigger a false enterprise
   error.

2. Remove sys.path hack from test file; use standard imports that work
   with pytest discovery.

3. Add tests verifying that empty collections are moved into metadata
   (field clearing works) even though they bypass the premium check.

Fixes #20304
2026-02-07 22:22:12 -08:00
yuneng-jiang
fb9f997dc1
Merge pull request #20687 from BerriAI/litellm_ui_minor_issues
[Refactor] AntD refactoring and 0 cost models fix
2026-02-07 18:09:04 -08:00
yuneng-jiang
7798d52cd4 truncate filter options 2026-02-07 18:04:35 -08:00
yuneng-jiang
53cf43dff6 fallback to team id and truncate 2026-02-07 18:04:10 -08:00
yuneng-jiang
6fad659ae2 Migrate to antd + fix cost to 0 costs models 2026-02-07 17:28:55 -08:00
yuneng-jiang
78f28d7c30 adding test 2026-02-07 16:46:11 -08:00
yuneng-jiang
70ebdeec8b modernize /team/available endpoint, migrate link to UI 2026-02-07 16:44:29 -08:00
yuneng-jiang
5a084cef41
Merge pull request #20657 from BerriAI/litellm_ui_logs_request
[Fix] UI - Logs: Input and Output Copying
2026-02-07 16:19:32 -08:00
yuneng-jiang
54828e3783 add knip as a dev dependency, remove some unused files 2026-02-07 15:51:21 -08:00
yuneng-jiang
73ddab2b46 fix input and output copying 2026-02-07 11:35:50 -08:00
yuneng-jiang
8ae1fe32c4 fixing test 2026-02-06 20:47:43 -08:00
yuneng-jiang
e968e3798c team settings soft budget and alerting emails 2026-02-06 20:40:52 -08:00
Ishaan Jaffer
51af66fdb2 ui new buil 2026-02-06 19:15:29 -08:00
Ishaan Jaff
9b1ccc0608
[Feat] IP-Based Access Control for MCP Servers (#20620)
* update MCPAuthenticatedUser

* add available_on_public_internet for MCPs

* update claude.md

* init IPAddressUtils

* init available_on_public_internet

* add on REST endpoints

* filter with IP

* TestIsInternalIp

* _extract_mcp_headers_from_request

* init get_mcp_client_ip

* _get_general_settings

* allowed_server_ids

* address PR comments

* get_mcp_server_by_name fix

* fix server

* fix review comments

* get_public_mcp_servers

* address _get_allowed_mcp_servers

* test fix

* fix linting

* inint ui types

* add ui for managing MCP private/public

* add ui

* fixes

* add to schema

* add types

* fix endpoint

* add endpoint

* update manager

* test mcp

* dont use external party for ip address
2026-02-06 17:58:24 -08:00
Krish Dholakia
ba74e6d9d2
Add http support to custom code guardrails + Unified guardrails for MCP + Agent guardrail support (#20619)
* fix: fix styling

* fix(custom_code_guardrail.py): add http support for custom code guardrails

allows users to call external guardrails on litellm with minimal code changes (no custom handlers)

Test guardrail integrations more easily

* feat(a2a/): add guardrails for agent interactions

allows the same guardrails for llm's to be applied to agents as well

* fix(a2a/): support passing guardrails to a2a from the UI

* style(code-editor): allow editing custom code guardrails on ui + add examples of pre/post calls for custom code guardrails

* feat(mcp/): support custom code guardrails for mcp calls

allows custom code guardrails to work on mcp input

* feat(chatui.tsx): support guardrails on mcp tool calls on playground
2026-02-06 17:34:32 -08:00
yuneng-jiang
a4689c9b22
Merge pull request #20549 from swayambhu94/fix/ui/antd-notification
refactor: migrate Ant Design notifications to use `App.useApp()` cont…
2026-02-06 13:15:37 -08:00
yuneng-jiang
dfc4a1b412
Merge pull request #20599 from BerriAI/litellm_model_page_col_resize
[Fix] UI - Model Page: Column Resizing on Smaller Screens
2026-02-06 12:38:01 -08:00
yuneng-jiang
ac8f3807db
Merge pull request #20462 from BerriAI/litellm_model_info_cost
[Fix] UI - Model Info Page: Fix Input and Output Labels
2026-02-06 12:34:34 -08:00
yuneng-jiang
4de0ed7a9e
Merge pull request #20444 from BerriAI/litellm_ui_config_req_auth_mh
[Feature] UI - Admin Settings: Add option for Authentication for public AI Hub
2026-02-06 12:34:27 -08:00
yuneng-jiang
8df6cfe9d8 fix model page col resize 2026-02-06 12:27:03 -08:00
yuneng-jiang
ee70010ef1 Adding testing coverage 2026-02-06 11:32:35 -08:00
Swayambhu
a48a8ec945 refactor: Directly use Ant Design's notification hook instead of App.useApp for notification management. 2026-02-06 15:35:11 +05:30
yuneng-jiang
968b953f84 rename admins to AdminPanel 2026-02-05 21:11:26 -08:00
Swayambhu
eee37c569d fix: ensure Ant Design notification instance is initialized only once using useRef. 2026-02-06 10:01:44 +05:30
yuneng-jiang
5ce5399fbb
Merge pull request #20469 from swayambhu94/fix/ui/model-hub-table-crash
fix: Add array type checks for model, agent, and MCP hub data to prev…
2026-02-05 20:14:51 -08:00
Swayambhu
08a6fe2bfa refactor: migrate Ant Design notifications to use App.useApp() context via a new global provider.
1.
notifications_manager.tsx
 - Hybrid notification approach:

Added notificationInstance variable to store the context-based instance
Added
setNotificationInstance()
 function to inject the instance from context
Created
getNotification()
 helper that prefers context instance, falls back to static
Added COMMON_NOTIFICATION_PROPS (exported) with showProgress: true and pauseOnHover: true
All notification methods (
error
,
warning
,
info
,
success
,
fromBackend
) now spread COMMON_NOTIFICATION_PROPS
2.
AntdGlobalProvider.tsx
 - New context provider:

Wraps app with Antd's <App> component
Uses App.useApp() hook to get the context-based notification instance
Injects it into NotificationManager via
setNotificationInstance()
2026-02-06 09:44:02 +05:30
yuneng-jiang
26cdc4a47b
Merge pull request #20465 from BerriAI/litellm_ui_dep_tremor
[Refactor] UI - Admin Page: Migrate to AntD Tabs
2026-02-05 20:12:17 -08:00
Swayambhu
926fb3525c refactor: Add error handling for network calls and apply consistent formatting across networking functions. 2026-02-06 08:33:18 +05:30
yuneng-jiang
f64f949715 Spend by provider refactor 2026-02-05 16:22:07 -08:00
yuneng-jiang
b5956cb020
Merge pull request #20513 from BerriAI/litellm_ui_test_cov_01
[Infra] UI - Adding Unit Tests for Coverage
2026-02-05 12:19:03 -08:00
yuneng-jiang
21d6025c01 adding test for converage 2026-02-05 12:02:12 -08:00
nina-hu
5904fa159b fix(ui): adjust daily spend date filtering for user timezone
The daily spend tables store dates in UTC, but the UI sends dates in the
user's local timezone. This causes a mismatch where records from the
user's evening (stored as the next UTC day) don't appear when filtering
by "today".

Changes:
- Add `_adjust_dates_for_timezone()` helper to expand date range based
  on timezone offset
- Add `timezone` query parameter to `/user/daily/activity` and
  `/user/daily/activity/aggregated` endpoints
- Frontend sends `timezone` using `Date.getTimezoneOffset()`

For users west of UTC (e.g., PST), end_date is extended by 1 day.
For users east of UTC (e.g., IST), start_date is extended by 1 day earlier.
This ensures all records within the user's local date range are captured.
2026-02-04 21:42:34 -08:00
Swayambhu
2c430ebd96 fix: Add array type checks for model, agent, and MCP hub data to prevent crashes from non-array API responses and include a regression test.
This PR:Fixes a frontend regression where the
PublicModelHub
 page would crash with TypeError: e.filter is not a function when the API returned an error object (e.g. { "detail": "..." }) instead of the expected data array.
Changes:

Added defensive Array.isArray() checks in
src/components/public_model_hub.tsx
 for:
modelHubData
agentHubData
mcpHubData
Updated useMemo hooks and helper functions to handle invalid data gracefully.
Added a regression test in
src/components/public_model_hub.test.tsx
 that mocks a non-array API response to ensure the component renders without crashing.
2026-02-05 10:28:04 +05:30
yuneng-jiang
ed7beba781 small fixes 2026-02-04 20:54:59 -08:00
yuneng-jiang
539ff7a850 refactor admin page 2026-02-04 20:46:31 -08:00
yuneng-jiang
fa86f1a10a Fix input and output label 2026-02-04 20:14:01 -08:00
yuneng-jiang
b982542c6c fixing build 2026-02-04 20:05:10 -08:00
Ishaan Jaff
15b717c300
[Feat] UI - Add support for MCP Semantic Filtering on UI (#20454)
* feat: remove_callbacks_by_type

* feat: _init_semantic_filter_settings_in_db

* add MCP semantic filtering settings endpoints

* v0 - semantic filter UI

* fix endpint _init_semantic_filter_settings_in_db

* refactor ui

* add LITELLM_UI_ALLOW_HEADERS

* ui fix

* ui fix
2026-02-04 18:38:53 -08:00
yuneng-jiang
d016ac863b Adding tests for model hub 2026-02-04 17:05:06 -08:00