Commit graph

1087 commits

Author SHA1 Message Date
yuneng-jiang
91056c1d7e Merge remote-tracking branch 'origin' into litellm_daily_agent_table 2025-12-10 20:47:58 -08:00
Sameer Kankute
9344d29a15 fix: Preserve systemInstructions for vertex ai generate content request 2025-12-11 09:52:32 +05:30
Sameer Kankute
2ea855d225
Merge pull request #17707 from raghav-stripe/raghav-fix-responsesapi-rl
fix: responses api not applying tpm rate limits on api keys
2025-12-11 08:57:16 +05:30
Ishaan Jaff
059fedbed5
[Feat] Agent Gateway - Track agent_id in SpendLogs (#17795)
* add agent_id in metadata in spend logs

* add agent_id in SpendLogsPayload

* add agent_id in SpendLogsPayload

* add _set_agent_id_on_logging_obj

* add agent id tracking in SpendLogs

* add agent id in spend logs

* fix create_a2a_client

* test_asend_message_passes_agent_id_to_callback

* test_get_logging_payload_includes_agent_id_from_kwargs

* test_asend_message_streaming_triggers_callbacks

* fix asend_message_streaming

* asend_message_streaming

* A2AStreamingIterator

* _handle_stream_message

* test_asend_message_streaming_propagates_metadata
2025-12-10 16:09:56 -08:00
Ishaan Jaff
5d456bcdc3
[Feat] UI SSO - allow fetching role from generic SSO provider (Keycloak) (#17787)
* fix ui SSO

* TestGenericResponseConvertorUserRole

* Assigning User Roles via SSO
2025-12-10 13:09:28 -08:00
yuneng-jiang
1cad479297 Daily Agent Usage Table WIP 2025-12-10 11:50:52 -08:00
saisurya237
f3ead2c153
add a new feature fix to expose the team alias when authenticating th… (#17725)
* CLI SSO: show team aliases in team selection

* temp poetry lock fix

* add poetry.lock to gitignore

* Revert proxy_server background job refactor

* Revert proxy_server background job refactor

* rever gitignore and poetry lock file
2025-12-10 10:10:28 -08:00
yuneng-jiang
ba554a86b9
Merge pull request #16843 from BerriAI/litellm_allow_custom_mount_paths
[Feature] Allow Root Path to Redirect when Docs not on Root Path
2025-12-10 09:52:30 -08:00
Sameer Kankute
9e3a04a725 Add batch passthrough endpoint cost tracking for anthropic 2025-12-10 18:24:31 +05:30
Lucas Sugi
c7fd8fabdb
fix: Avoid error when we have just the tool_calls in input (#17753)
* fix: Avoid error when we have just the tool_calls in input

* fix: Remove the tool call validation

* feat: Add unit test
2025-12-09 22:59:59 -08:00
Ishaan Jaff
e546f0e021
[Fix] UI SSO - allow up-serting user role when SSO provider role changes (#17754)
* use _build_sso_user_update_data

* test_build_sso_user_update_data_with_valid_role
2025-12-09 19:16:10 -08:00
Peter Chanthamynavong
539ce89d4e
fix(guardrails): mask all regex pattern matches, not just first (#17727)
Before: search() + replace() only replaced first match
After: sub() replaces all matches of each pattern

Closes #17687
2025-12-09 18:51:28 -08:00
yuneng-jiang
0e2fcde145 Change health check to read env varlike chat completions 2025-12-09 18:17:07 -08:00
yuneng-jiang
d99cf81386 Fixing test 2025-12-09 16:11:17 -08:00
ephrimstanley
a91dda1194
Return 403 instead of 503 for unauthorized routes (#17723) 2025-12-09 15:16:11 -08:00
yuneng-jiang
879ae45421 Change credential encryption to only affect db credentials 2025-12-09 13:36:40 -08:00
yuneng-jiang
68419cfe4e Merge remote-tracking branch 'origin' into litellm_tag_spend_dedupe 2025-12-09 11:59:47 -08:00
yuneng-jiang
39bf7a9f7c Merge remote-tracking branch 'origin' into litellm_allow_custom_mount_paths 2025-12-09 11:58:05 -08:00
yuneng-jiang
4bffbe0bff Merge remote-tracking branch 'origin' into litellm_sso_config_2 2025-12-09 11:56:30 -08:00
yuneng-jiang
9253a9c365
Merge pull request #17689 from BerriAI/litellm_ui_settings_backend
[Feature] Get and Update Backend Routes for UI Settings
2025-12-09 11:55:28 -08:00
yuneng-jiang
e4442c2946 Change UI Settings to a dedicated table 2025-12-09 11:19:53 -08:00
Derek Duenas
3322523e07
Passthrough in response (#17102)
* attempt to implement the passthrough feature

* Formatting and small change

* Fix formatting

* feat: grayswan guardrail overwrite ModelResponse in passthrough mode

* fix missing exception error catching on certain
endpoints

* fix wrong call site

* fix: patch anthropic endpoint internal error on streaming obj

* fix grayswan testcase

* feat: update the violation response to more natural

* Formatting

* move passthrough exception definition to custom_guardrail.

* Enhancement: show whether the blocked at input or output

* update exception name

* fix a typo in testing unit.

---------

Co-authored-by: Xiaohan Fu <xiaohan@grayswan.ai>
2025-12-09 10:45:45 -08:00
yuneng-jiang
305a7c6bd5 Merge remote-tracking branch 'origin' into litellm_ui_settings_backend 2025-12-09 10:21:52 -08:00
Raghav Jhavar
face8173b0 fix failing test 2025-12-09 19:42:26 +07:00
Raghav Jhavar
9e85dcbd60 read responses api usage 2025-12-09 18:14:00 +07:00
yuneng-jiang
dab4c9d8ab Merge remote-tracking branch 'origin' into litellm_sso_config_2 2025-12-08 21:19:50 -08:00
yuneng-jiang
8039c5052f
Merge pull request #17681 from BerriAI/litellm_ui_fallback_login_alert
[Fix] Change deprecation banner to only show on /sso/key/generate
2025-12-08 21:18:38 -08:00
YutaSaito
5b926ae2c6
fix: resolve UI session MCP permissions across real teams (#17620)
* fix: resolve UI session MCP permissions across real teams

* fix: remove user from logs
2025-12-08 19:03:01 -08:00
Cesar Garcia
a7ad8a36a4
chore: cleanup unused scripts and fix misplaced test file (#17611)
Remove scripts/ directory containing unused development/debug scripts:
- mock_ibm_guardrails_server.py
- test_groq_streaming_issue.py (debug for #12660)
- test_mock_ibm_guardrails.py
- update_readme_providers_table.py

Move misplaced test file to correct location:
- test_litellm/ -> tests/test_litellm/ (from PR #17221)
2025-12-08 19:00:55 -08:00
Emil Svensson
61e737e361
fix Azure AI Anthropic api-key header and passthrough cost calculation (#17656)
* refactor: remove api-key conversion logic for Azure Anthropic

Co-authored-by: Erdem Halil <erdemhalil@users.noreply.github.com>

* fix(passthrough): pass custom_llm_provider to completion_cost for Azure AI Anthropic

The passthrough logging for Anthropic was failing when using Azure AI Anthropic
because the completion_cost function was not receiving the custom_llm_provider
parameter, causing it to fail with "LLM Provider NOT provided" error.

This fix:
- Retrieves custom_llm_provider from logging_obj.model_call_details
- Prepends provider prefix to model name for cost calculation
- Passes both formatted model and custom_llm_provider to completion_cost
- Centralizes provider prefix logic in _create_anthropic_response_logging_payload

This ensures cost calculation works correctly for Azure AI Anthropic requests
with models like azure_ai/claude-sonnet-4-5_gb_20250929.

Co-authored-by: Erdem Halil <erdemhalil@users.noreply.github.com>

* test: add unit tests for Azure AI Anthropic fixes

- Add tests for custom_llm_provider cost calculation in passthrough logging
- Add tests for ProviderConfigManager returning AzureAnthropicMessagesConfig
- Update existing tests to reflect removal of api-key to x-api-key conversion

Co-authored-by: Erdem Halil <erdemhalil@users.noreply.github.com>

---------

Co-authored-by: Erdem Halil <erdemhalil@users.noreply.github.com>
2025-12-08 18:50:26 -08:00
yuneng-jiang
3683614a6b Get and Update route for UI Settings 2025-12-08 18:07:00 -08:00
Ishaan Jaff
074445edb1
[Fix] AI Gateway Auth - allow using wildcard patterns for public routes (#17686)
* edit auth utils to allow wildcard patterns

* docs fix private / public routes

* test_route_in_additional_public_routes_wildcard_match
2025-12-08 17:39:53 -08:00
Ishaan Jaff
2f335ac5a6
[Feat] Dynamic Rate Limiter - allow specifying ttl for in memory cache (#17679)
* fix _get_saturation_value_from_cache

* fix _get_saturation_check_cache_ttl

* fix test_saturation_check_cache_ttl_configuration

* docs saturation_check_cache_ttl
2025-12-08 17:20:52 -08:00
yuneng-jiang
8338bd9c53 Change deprecation banner to only show on /sso/key/generate 2025-12-08 16:30:37 -08:00
yuneng-jiang
3394dbb363 Remove SSO config values from old config table on update 2025-12-08 13:06:39 -08:00
Tamir Kiviti
0f5694c8eb
add onyx guardrail hooks integration (#16591)
* add onyx guardrail hooks integration

* fix lint issue

* fix lint issue

* update PR to use the new custom guardrail interface

* lint fix
2025-12-07 23:33:28 -08:00
Raney Cain
eb689a1f07
fix(proxy): async_post_call_streaming_iterator_hook now properly iterates async generators (#17626)
The async_post_call_streaming_iterator_hook function was broken:
1. Was a sync function (def) not async generator
2. Returned AsyncGenerator without iterating it
3. Callback generators were chained but never consumed

This fix:
1. Makes the function an async generator (async def + yield)
2. Actually iterates through the chained callbacks with 'async for'
3. Properly yields chunks to the caller

Fixes #9639
2025-12-07 23:29:42 -08:00
yuneng-jiang
6777a23a53 Merge remote-tracking branch 'origin' into litellm_allow_custom_mount_paths 2025-12-06 22:22:59 -08:00
yuneng-jiang
321ffd7258
Merge pull request #17180 from BerriAI/litellm_non_root_docker_logo_fix
[Fix] Add User Writable Directory to Non Root Docker for Logo
2025-12-06 22:22:27 -08:00
yuneng-jiang
e2e35c3f87
Merge pull request #17522 from BerriAI/litellm_custom_webhook_fix
[Fix] Custom Callback on UI
2025-12-06 22:22:02 -08:00
yuneng-jiang
f9a4ba3359
Merge pull request #16795 from BerriAI/litellm_add_model_fix_team_admin
[Fix] Make /litellm_model_cost_map public
2025-12-06 21:06:39 -08:00
yuneng-jiang
a560db56d5 Merge remote-tracking branch 'origin' into litellm_scim_v2_fix 2025-12-06 20:01:05 -08:00
yuneng-jiang
1d95595522 Merge remote-tracking branch 'origin' into litellm_non_root_docker_logo_fix 2025-12-06 20:00:33 -08:00
yuneng-jiang
539e3721f2 Merge remote-tracking branch 'origin' into litellm_add_model_fix_team_admin 2025-12-06 20:00:01 -08:00
yuneng-jiang
96f39484f1 Merge remote-tracking branch 'origin' into litellm_custom_webhook_fix 2025-12-06 19:59:15 -08:00
yuneng-jiang
30eaa1c099 Merge remote-tracking branch 'origin' into litellm_new_user_collision_handling 2025-12-06 19:58:35 -08:00
Yuta Saito
21a18128ec fix: mcp test 2025-12-06 10:54:22 +09:00
yuneng-jiang
edf51a431a Fixed tests 2025-12-05 17:08:13 -08:00
yuneng-jiang
8e74a3b692
Merge pull request #17563 from BerriAI/litellm_v2_login_test_fix
[Fix] Mock server_root_path for v2/login test
2025-12-05 16:23:51 -08:00
YutaSaito
b5133c4c7d
Feat/mcp preserve tool metadata calltoolresult (#17561)
* feat(mcp): preserve tool metadata and full CallToolResult in MCP gateway

This PR fixes two issues that prevented ChatGPT from rendering MCP UI widgets
when proxied through LiteLLM:

1. Preserve Tool Metadata in tools/list
   - Modified _create_prefixed_tools() to mutate tools in place instead of
     reconstructing them, preserving all fields including metadata/_meta
   - This ensures ChatGPT can see 'openai/outputTemplate' URIs in tools/list
     and will call resources/read to fetch widgets

2. Preserve Full CallToolResult (structuredContent + metadata)
   - Changed call_mcp_tool() and _handle_managed_mcp_tool() to return full
     CallToolResult objects instead of just content
   - Updated error handlers to return CallToolResult with isError flag
   - Wrapped local tool results in CallToolResult objects
   - This preserves structuredContent and metadata fields needed for widget rendering

Files changed:
- litellm/proxy/_experimental/mcp_server/mcp_server_manager.py
- litellm/proxy/_experimental/mcp_server/server.py

Fixes issues where ChatGPT could not render MCP UI widgets when using
LiteLLM as an MCP gateway.

* feat(mcp): Preserve tool metadata and return full CallToolResult for ChatGPT UI widgets

- Preserve metadata and _meta fields when creating prefixed tools
- Return full CallToolResult instead of just content list
- Ensures ChatGPT can discover and render UI widgets via openai/outputTemplate
- Fixes metadata stripping that prevented widget rendering in ChatGPT

Changes:
- mcp_server_manager.py: Mutate tools in place to preserve all fields including metadata
- server.py: Return CallToolResult with structuredContent and metadata preserved
- Added test to verify metadata preservation

* fix: guard cost calculator when BaseModel lacks _hidden_params

---------

Co-authored-by: Afroz Ahmad <aahmad@Afrozs-MacBook-Pro.local>
Co-authored-by: Afroz Ahmad <aahmad@KNDMCPTMZH3.sephoraus.com>
2025-12-05 16:15:22 -08:00