Commit graph

6027 commits

Author SHA1 Message Date
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
Krish Dholakia
b0a5a4b81d
Arize Phoenix OSS - Prompt Management Integration (#17750)
* docs(prompt_management.md): document how to onboard prompts to litellm

* feat(arize_phoenix_prompt_manager.py): support new prompt management integration

allows users to connect arize phoenix prompt manager to litellm

* fix(proxy/utils.py): remove prompt variables to avoid re-processing prompt

* docs(arize_phoenix_prompts.md): document new prompt management integration
2025-12-09 22:53:42 -08:00
Sameer Kankute
bcac9e41f6 Add support for computer use for gemini 2025-12-10 10:34:08 +05:30
yuneng-jiang
0769a290da Sendgrid integration + bump enterprise package 2025-12-09 19:34:09 -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
Hunter Wittenborn
82f0c3c887
Support model names with slashes on Gemini endpoints (#17743)
* Support model names with slashes on Gemini endpoints

* Fix test

* Update tests/proxy_unit_tests/test_google_endpoint_routing.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/proxy_unit_tests/test_google_endpoint_routing.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/proxy_unit_tests/test_google_endpoint_routing.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/proxy_unit_tests/test_google_endpoint_routing.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/proxy_unit_tests/test_google_endpoint_routing.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/proxy_unit_tests/test_google_endpoint_routing.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-09 18:40:51 -08:00
Krrish Dholakia
8b125ff74e test: remove test_helicone - integration test made live calls to api and broke ci/cd 2025-12-09 18:36:51 -08:00
Cesar Garcia
01dec55c2f
fix(anthropic): preserve server_tool_use and web_search_tool_result in multi-turn conversations (#17746)
- Extract web_search_tool_result blocks in extract_response_content()
- Store web_search_results in provider_specific_fields for round-trip
- Detect srvtoolu_ prefix to reconstruct as server_tool_use (not tool_use)
- Add corresponding web_search_tool_result after server_tool_use blocks

This ensures multi-turn conversations with Anthropic web search + custom
tools work correctly without Anthropic expecting tool_result for server-
side tool executions.
2025-12-09 18:25:23 -08:00
Krish Dholakia
9fa6c51678
Fix: Add Gemini context window exception mapping (#17751)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-12-09 18:24:13 -08:00
Krrish Dholakia
f23a78fddc test: remove expensive test 2025-12-09 18:23:03 -08:00
Krrish Dholakia
c276a87ab0 fix(anthropic/chat/transformation.py): pass output_config + thinking to claude opus 4.5 2025-12-09 18:21:41 -08:00
Sameer Kankute
8fafd81f9d
Merge pull request #17732 from BerriAI/litellm_videos_bugs_2
Fix : use litellm params for all videos apis
2025-12-10 07:49:55 +05:30
yuneng-jiang
0e2fcde145 Change health check to read env varlike chat completions 2025-12-09 18:17:07 -08:00
Shivam Rawat
4ada6bee49
fixed flex tier pricing (#17748) 2025-12-09 18:10:51 -08:00
Yuta Saito
ed5cbdac2f feat: add support for using MCPs on /chat/completions 2025-12-10 10:55:33 +09:00
Cesar Garcia
63a97db663
feat(voyage): add rerank API support (#17744)
* feat(voyage): add rerank API support

Add support for Voyage AI rerank models (rerank-2.5, rerank-2.5-lite,
rerank-2, rerank-2-lite) to the LiteLLM rerank API.

Changes:
- Add VoyageRerankConfig transformation class
- Register voyage provider in rerank_api/main.py
- Add voyage case in utils.py get_provider_rerank_config
- Add rerank-2.5 and rerank-2.5-lite models to pricing JSON
- Add unit tests for transformation logic
- Update documentation for voyage.md and rerank.md

Usage:
```python
from litellm import rerank

response = rerank(
    model="voyage/rerank-2.5",
    query="What is the capital of France?",
    documents=["Paris is...", "London is..."],
    top_n=3,
)
```

* refactor(voyage): simplify rerank transformation code

Remove verbose docstrings to align with other providers (jina_ai pattern).
No functional changes - 168 lines vs 169 for jina_ai.

* fix(voyage): remove incorrect input_cost_per_query from rerank models

Voyage AI charges per token, not per query. The input_cost_per_query
field was incorrectly set to the same value as input_cost_per_token
in the existing rerank-2 and rerank-2-lite models.

Removes input_cost_per_query from all Voyage rerank models:
- voyage/rerank-2
- voyage/rerank-2-lite
- voyage/rerank-2.5
- voyage/rerank-2.5-lite

Pricing source: https://docs.voyageai.com/docs/pricing
2025-12-09 17:34:09 -08:00
Ishaan Jaff
3631e8fa1d
[Feat] Containers API - add new container API file management + UI Interface (#17745)
* test_router_acreate_container_without_model

* _init_containers_api_endpoints

* test_init_containers_api_endpoints

* init container files endpoints

* init files api

* init container files API

* add containers api file content

* add code interpreter output UI

* add code interpreter input ui

* refactor code interpreter ui

* fix: require model selection

* cleaner container provision

* fix ContainerFileObject

* def container_file_content_handler(
add

* add retrieve_container_file_content

* aretrieve_container_file_content

* UI fix model

* fix linting errors
2025-12-09 17:33:26 -08:00
Ishaan Jaff
142567e143
[Fix] Containers API - Allow using LIST, Create Containers using custom-llm-provider (#17740)
* test_router_acreate_container_without_model

* _init_containers_api_endpoints

* test_init_containers_api_endpoints
2025-12-09 17:00:35 -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
bdfc3308b1
Merge pull request #17741 from BerriAI/litellm_ui_cred_fix_2
[Fix] Change credential encryption to only affect db credentials
2025-12-09 14:04:20 -08:00
yuneng-jiang
879ae45421 Change credential encryption to only affect db credentials 2025-12-09 13:36:40 -08:00
YutaSaito
80a18f989a
feat: propagate Langfuse trace_id (#17669) 2025-12-09 12:25:52 -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
Sameer Kankute
baed9fcea2
Merge branch 'main' into litellm_videos_bugs_2 2025-12-09 23:30:13 +05:30
Sameer Kankute
878c86e632 Add tests for handling video with litellm param 2025-12-09 23:27:20 +05:30
Sameer Kankute
237f6b991f
Merge pull request #17708 from BerriAI/litellm_videos_bug_fixes
Fix error about encoding video id for azure
2025-12-09 23:11:17 +05:30
Raghav Jhavar
face8173b0 fix failing test 2025-12-09 19:42:26 +07:00
Sameer Kankute
b39c21d90c fix: Add _delete_nested_value_custom to recursive function ignore list
The _delete_nested_value_custom function is recursive but has bounded depth
(limited by the number of path segments), preventing infinite recursion.
This is necessary for nested field removal in additional_drop_params.
2025-12-09 17:56:13 +05:30
mzagar
9bb0e7dd75 feat: Replace jsonpath-ng with custom minimal parser for additional_drop_params 2025-12-09 17:30:30 +05:30
mzagar
da2aa2ba8d feat: Add nested field removal support to additional_drop_params using JSONPath 2025-12-09 17:29:56 +05:30
Raghav Jhavar
9e85dcbd60 read responses api usage 2025-12-09 18:14:00 +07:00
Sameer Kankute
a7e5be8e03 Fix error about encoding video id for azure 2025-12-09 16:36:11 +05:30
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
Earl St Sauver
ad9c69860e
Fix Cerebras context window errors not recognized (#17587)
Add detection for Cerebras's context window exceeded error format:
"Current length is X while limit is Y"

This ensures LiteLLM raises ContextWindowExceededError instead of
generic BadRequestError when Cerebras API calls exceed the model's
context limit, enabling downstream libraries like DSPy to properly
catch and handle these errors for automatic context management.
2025-12-08 19:02:06 -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
Cesar Garcia
0295f912be
fix(openai): include 'user' param for responses API models (#17648)
The 'user' parameter was being ignored when using responses API models
(e.g., model="openai/responses/gpt-4.1") because the model name check
in get_supported_openai_params() didn't account for the "responses/" prefix.

Fix: Normalize the model name by stripping "responses/" prefix before
checking if the model is in the list of supported OpenAI models.

This is a minimal, non-breaking change that:
- Adds 2 lines of code in gpt_transformation.py
- Only affects the parameter support check, not the model variable itself
- Includes unit and integration tests
2025-12-08 18:52:47 -08:00
Cesar Garcia
fd9ff90307
fix(responses): prevent streaming tool_calls from being dropped when text + tool_calls (#17652)
When OpenAI Responses API returns both text AND tool_calls, the bridge
transformation was emitting is_finished=True after the text message completed,
causing subsequent tool_call chunks to be dropped.

The fix:
- response.output_item.done for messages no longer emits is_finished=True
- Added handler for response.completed to properly signal stream end
2025-12-08 18:51:59 -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
Cesar Garcia
7c2e2111c0
fix(router): handle tools=None in filter_web_search_deployments (#17684)
Fixes #17672

Changed `request_kwargs.get("tools", [])` to `request_kwargs.get("tools") or []`
to handle the case where tools is explicitly set to None.
2025-12-08 18:36:46 -08:00
yuneng-jiang
3683614a6b Get and Update route for UI Settings 2025-12-08 18:07:00 -08:00