Commit graph

4703 commits

Author SHA1 Message Date
yuneng-jiang
97957ae9a3 option to hide usage indicator 2026-02-10 17:21:41 -08:00
Julio Quinteros Pro
80a3e072be fix(ui): remove duplicate URL in tagsSpendLogsCall query string
The template literal in the tags query parameter concatenation included
`${url}` inside a `+=` assignment, causing the full URL to be doubled.

Supersedes #8793 (original fix by @Mte90, now stale).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 22:13:00 -03:00
yuneng-jiang
e86d7f59c6 new login with sso button in login page 2026-02-10 17:04:52 -08:00
yuneng-jiang
c68383068a
Merge pull request #20803 from BerriAI/litellm_ui_e2e_02
[Infra] UI - E2E Tests: Key Delete, Regenerate, and Update TPM/RPM Limits
2026-02-10 17:02:37 -08:00
yuneng-jiang
a8b4b4ccba
Merge pull request #20894 from BerriAI/litellm_ui_chart_fix_02
[Fix] UI - Usage: Request Chart stack variant
2026-02-10 16:32:04 -08:00
yuneng-jiang
cfd261d679 Split e2e ui testing for browser 2026-02-10 16:30:31 -08:00
Alexsander Hamir
ebce0e5f8c
[Release - 02/10/2026] v1.81.10-nightly 2026-02-10 16:26:30 -08:00
Krish Dholakia
10d891a365
Guardrails - add logging to all unified_guardrails + link to custom code guardrail templates (#20900)
* feat(guardrail_hooks/): add guardrail logging to all unified guardrails

ensures unified guardrails use the 'log_guardrail_information' decorator for logging

* fix(custom_guardrail.py): don't log inputs on guardrail response - just emit state

* refactor: don't double log bedrock guardrail information

* feat: add in-product nudges for contributing + trying community custom code guardrails

allows users to contribute / share custom code guardrails
2026-02-10 15:13:54 -08:00
yuneng-jiang
79b24c8f25 remove stack from charts 2026-02-10 14:11:55 -08:00
yuneng-jiang
3fe1c1ba24 fixing build 2026-02-10 12:53:51 -08:00
yuneng-jiang
7fd8c0e160 Searchable Paginated Model Select For Spend Logs 2026-02-10 12:44:38 -08:00
Sameer Kankute
5222fd4795
Merge pull request #20783 from BerriAI/litellm_oss_staging_02_09_2026
litellm oss staging 09/02/2026
2026-02-10 18:02:14 +05:30
Seongho Bae
d56a0a97f8 fix(ui): allow editing MCP stdio transport config (#20241)
* fix(ui): enable stdio transport edits for MCP servers

* fix(ui): use antd Input in MCP edit stdio

Align MCP Server Edit with UI guidelines by replacing deprecated Tremor TextInput, and relax stdio args validation to match create flow while improving test stability.

* fix(otel): make semantic log LogRecord import mypy-safe

Prefer the OTEL >=1.39.0 LogRecord import path and keep an ignored fallback for older versions so MyPy doesn't fail on newer SDK stubs.

* fix(otel): tolerate LogRecord ctor changes across SDK versions

Create semantic LogRecords via a best-effort wrapper that falls back when the `resource` kwarg is unsupported (OTEL >= 1.39), and avoid MyPy overload/no-redef failures.

* fix(otel): silence mypy no-redef on versioned LogRecord import

MyPy sees both branches of the version-compat import and flags a redefinition. Ignore no-redef on the legacy import path to keep CI passing.

* fix(ui): ensure mcp_info.server_name is always populated

When using stdio transport there may be no URL to fall back on; prefer existing server_name/url/alias to avoid sending an empty mcp_info.server_name on update.

* chore(otel): format opentelemetry; ignore ui export output

* fix: guard optional a2a resolver + make OTEL semantic logs mypy-safe

* chore: format A2A resolver and OTEL semantic logs

* fix: address review feedback for MCP stdio edit

* fix: keep MCP stdio edit PR scoped

* fix(otel): make semantic logs mypy-safe
2026-02-10 16:16:59 +05:30
Praveena Mundolimoole
ab670a74f4 Add support for extra fields in Generic SSO via GENERIC_USER_EXTRA_ATTRIBUTES (#20761)
* Add chat completion support for websearch

* Add chat completion tool calls support and response transformation

* Add new methods in chat completion

* Add chat completion tool format

* Add callback for websearch in completion method

* Add test for web search

* Potential fix for code scanning alert no. 4046: Clear-text logging of sensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Update litellm/integrations/websearch_interception/tools.py

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

* 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

* fix critical CVE vulnerabliltes (#20683)

* fix: add hook to handle db case (#20635)

* Add team policy mapping for zguard (#20608)

* support policy mapping on team key level

* update document

* update document

* address comments

* update document

* add unit test for new feature

* add more test case

* feat: add support for anthropic_messages call type in prompt caching (#19233)

* feat: add support for anthropic_messages call type in prompt caching

* test: move anthropic_messages prompt caching test to main router test file

* add tutorial on using claude code with prompt cache routing

* docs: add SDK proxy authentication (OAuth2/JWT auto-refresh) documentation (#20680)

Adds documentation for the litellm.proxy_auth feature that automatically
obtains and refreshes OAuth2/JWT tokens when connecting to a LiteLLM Proxy.

* Fixes #20582 (#20663)

* fix: show error details instead of Data Not Available for failed requests (#20656)

* 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

* Fix: Spend logs pickle error with Pydantic models and redaction (#20685)

* docs: add callback registration optimization to v1.81.9 release notes (#20681)

* docs: add callback registration optimization to v1.81.9 release notes

* Update v1.81.9.md

---------

Co-authored-by: Alexsander Hamir <alexsanderhamirgomesbaptista@gmail.com>

* Fix spend logs pickle error with Pydantic models

Replace copy.deepcopy() with Pydantic-safe serialization to avoid
"cannot pickle '_thread.RLock' object" errors when request/response
redaction is enabled.

Changes:
- Add _convert_to_json_serializable_dict() helper that uses
  model_dump() for Pydantic models instead of pickle
- Replace copy.deepcopy() calls in request and response redaction
  paths with the new helper function
- Recursively handles nested dicts, lists, and Pydantic models

Root cause: Pydantic v2 BaseModel instances contain internal
_thread.RLock objects for thread-safety. When copy.deepcopy()
attempts to pickle these objects, it fails because threading
primitives cannot be pickled.

Fixes #20647

* chore: remove unused copy import

Remove unused copy import that was causing lint failure. The copy.deepcopy()
calls were replaced with _convert_to_json_serializable_dict() helper function
in the previous commit, making the copy module no longer needed.

---------

Co-authored-by: ryan-crabbe <128659760+ryan-crabbe@users.noreply.github.com>
Co-authored-by: Alexsander Hamir <alexsanderhamirgomesbaptista@gmail.com>

* fix(vertex_ai): propagate extra_headers anthropic-beta to request body (#20666)

Vertex AI requires Anthropic beta flags in the request body
(anthropic_beta array), not as HTTP headers. The Bedrock handler
already extracts user-specified beta headers from the headers dict,
but the Vertex handler was missing this, causing extra_headers like
interleaved-thinking-2025-05-14 to be silently dropped.

This extracts anthropic-beta values from optional_params extra_headers
and merges them into the anthropic_beta request body field, and also
removes extra_headers from the request body since the parent's
transform_request spreads optional_params into data.

* fix(streaming): preserve interleaved thinking/redacted blocks

* test(streaming): build thinking chunks with typed Delta/StreamingChoices

* Fix video list pagination cursors not encoded with provider metadata

first_id and last_id in the video list response were returned as raw
provider IDs while data[].id was properly wrapped with
encode_video_id_with_provider(). This caused pagination to break when
clients passed unencoded cursors back as the `after` parameter.

- Encode first_id/last_id in transform_video_list_response
- Decode the `after` param in transform_video_list_request via
  extract_original_video_id()
- Add 6 unit tests covering encoding, decoding, passthrough, and
  full round-trip pagination

Fixes #20708

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

* fix(responses): preserve streamed tool deltas when id is omitted

* fix(responses): guard ambiguous tool-call index reuse

* Add compaction for vertex ai

* Add all new feat for v1/messages

* Add inference_geo as supported messages param

* Add inference based costing

* Add inference_geo as supported messages param

* Add support for fast param

* Add fast mode for other providers

* Add documentation for Fast Mode

* add missing indexes on VerificationToken table

* Fix structured response of tool call

* Add tests for WebSearch interception with chat completions API

* Add doc for chat completion web search

* Fix: is_web_search_tool_chat_completion

* Fix double json import

* Add new vercel ai anthropic models

* Fix: base_model name for body and deplyment name in URL

* Add output_config as supported param

* Add response schema for vercel ai sonnet 4.5

* handle when litellm_parrams might be none

* Fix : litellm/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_bedrock_chat_invoke_transformations_anthropic_claude3_transformation.py

* fix: Missing return statement for async streaming

* Fix: get_supported_anthropic_messages_params

* Fix mypy issues

* Fix mypy issues

* Add support for extra fields in Generic SSO via GENERIC_USER_EXTRA_ATTRIBUTES

Enables extraction of additional fields from the Generic SSO userinfo endpoint response beyond the standard 8 fields (id, email, name, etc.). Custom handlers can now access these fields via CustomOpenID.extra_fields dict.

Changes:

- Add extra_fields: Optional[Dict[str, Any]] to CustomOpenID type

- Add GENERIC_USER_EXTRA_ATTRIBUTES env var (comma-separated field names)

- Extract specified fields using get_nested_value() with dot notation support

- Add 4 test cases covering basic, nested, and missing field scenarios

- Update custom_sso.py example showing how to access extra_fields

Backward compatible: extra_fields is None when env var not set

* docs: Add documentation for GENERIC_USER_EXTRA_ATTRIBUTES

Document the new GENERIC_USER_EXTRA_ATTRIBUTES environment variable for Generic SSO

- Add to admin_ui_sso.md: explanation and usage examples

- Add to config_settings.md: environment variable reference

- Add to custom_sso.md: code example showing how to access extra_fields

- Includes examples for nested field paths with dot notation

---------

Co-authored-by: Sameer Kankute <sameer@berri.ai>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Varun Chawla <34209028+veeceey@users.noreply.github.com>
Co-authored-by: Harshit Jain <48647625+Harshit28j@users.noreply.github.com>
Co-authored-by: jwang-gif <j.wang@zscaler.com>
Co-authored-by: nuernber <benjamin.nuernberger@jpl.nasa.gov>
Co-authored-by: Cesar Garcia <128240629+Chesars@users.noreply.github.com>
Co-authored-by: John Lathouwers <john.lathouwers@oracle.com>
Co-authored-by: ryan-crabbe <128659760+ryan-crabbe@users.noreply.github.com>
Co-authored-by: Alexsander Hamir <alexsanderhamirgomesbaptista@gmail.com>
Co-authored-by: Elias Högbom Aronsson <elias.aronson@gmail.com>
Co-authored-by: Emerson Gomes <emerson.gomes@thalesgroup.com>
Co-authored-by: tshushan <tshushan@outbrain.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Carlo Alberto Ferraris <cafxx@mercari.com>
2026-02-10 16:00:28 +05:30
Ishaan Jaff
36e0361187
[UI] M2M OAuth2 UI Flow (#20794)
* add has_client_credentials

* MCPOAuth2TokenCache

* init MCP Oauth2 constants

* MCPOAuth2TokenCache

* resolve_mcp_auth

* test fixes

* docs fix

* address greptile review: min TTL, env-configurable constants, tests, docs

- Fix zero-TTL edge case: floor at MCP_OAUTH2_TOKEN_CACHE_MIN_TTL (10s)
- Make all MCP OAuth2 constants env-configurable via os.getenv()
- Move test file to follow 1:1 mapping convention (test_oauth2_token_cache.py)
- Add MCP OAuth doc page (mcp_oauth.md) with M2M and PKCE sections
- Update FAQ in mcp.md to reflect M2M support
- Add E2E test script and config

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

* fix mypy lint

* fix oauth2

* ui feat fixes

* test M2M

* test fix

* ui feats

* ui fixes

* ui fix client ID

* fix: backend endpoints

* docs fix

* fixes greptile

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 19:28:02 -08:00
yuneng-jiang
b70f97e653
Merge pull request #20790 from BerriAI/litellm_ui_inv_user_msg
[Feature] UI - Invite User: Email Integration Alert
2026-02-09 18:04:17 -08:00
yuneng-jiang
efdf05cab0 e2e tests, key delete, update tpm rpm, and regenerate 2026-02-09 18:01:52 -08:00
yuneng-jiang
a41a4b41f5 Text changes 2026-02-09 15:20:39 -08:00
yuneng-jiang
145ef7d388 extending timeout for long running tests 2026-02-09 15:02:47 -08:00
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