Commit graph

31511 commits

Author SHA1 Message Date
Harshit Jain
37fc4a35ff
Update tests/test_litellm/proxy/management_endpoints/test_ui_sso.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-14 04:27:13 +05:30
Harshit Jain
c56bbb9067
Update tests/test_litellm/proxy/management_endpoints/test_ui_sso.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-13 04:48:36 +05:30
Harshit Jain
a2b4728e74
Update tests/test_litellm/proxy/management_endpoints/test_ui_sso.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-13 04:40:29 +05:30
Harshit Jain
e0846389e9
add modify test to perform async run 2026-02-13 04:04:03 +05:30
Harshit Jain
847402b68d
Merge branch 'fix/sso_PKCE_deployments' of https://github.com/Harshit28j/litellm into fix/sso_PKCE_deployments 2026-02-13 03:50:16 +05:30
Harshit Jain
eb249b2f06
fix: add await in tests 2026-02-13 03:46:31 +05:30
Harshit Jain
bc5543cfdc
Update tests/test_litellm/proxy/management_endpoints/test_ui_sso.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-13 03:39:57 +05:30
Harshit Jain
1792b3c8e5
fix: add async call to avoid server pauses 2026-02-13 03:28:51 +05:30
Harshit Jain
aac04d5665
fix: SSO PKCE support fails in multi-pod Kubernetes deployments 2026-02-03 07:54:44 +05:30
Alexsander Hamir
1b9631d260
Add blog post: Achieving Sub-Millisecond Proxy Overhead (#20309) 2026-02-02 17:46:36 -08:00
yuneng-jiang
8eba641190
Merge pull request #20299 from BerriAI/litellm_ui_allowed_routes_dropdown
[Feature] UI - SSO: Add Team Mappings
2026-02-02 17:17:54 -08:00
yuneng-jiang
62993b5f0e
Merge pull request #20305 from BerriAI/litellm_reset_spend_endpoint
[Feature] Key reset_spend endpoint
2026-02-02 16:54:01 -08:00
yuneng-jiang
cd154c4048
Merge pull request #20307 from BerriAI/litellm_ui_disable_global_guardrail
[Fix] UI  - Team Settings: Disable Global Guardrail Persistence
2026-02-02 16:53:08 -08:00
yuneng-jiang
2645d258cb fixing tests 2026-02-02 16:37:40 -08:00
yuneng-jiang
16f0b4942a team setting disable global guardrail fix 2026-02-02 16:34:23 -08:00
yuneng-jiang
edfe2394b9 reset_spend endpoint 2026-02-02 15:52:30 -08:00
shin-bot-litellm
0614ff9fda
docs: add Prisma migration troubleshooting guide (#20300)
* docs: add Prisma migration troubleshooting guide

Add troubleshooting documentation for common Prisma migration errors
encountered when upgrading/downgrading LiteLLM proxy versions.

Covers:
- 'relation does not exist' errors after version rollback
- Blocked migrations from previous failures
- Migration state mismatch after version rollback
- General tips for prisma migrate resolve, db push, and migrate deploy

* docs: simplify prisma migration troubleshooting - focus on delete + restart
2026-02-02 14:39:18 -08:00
shin-bot-litellm
31241416d4
feat: add base /scim/v2 endpoint for SCIM resource discovery (#20301)
Add the following SCIM v2 discovery endpoints per RFC 7643/7644:

- GET /scim/v2 - Base resource discovery (ListResponse of ResourceTypes)
- GET /scim/v2/ResourceTypes - List all supported resource types
- GET /scim/v2/ResourceTypes/{id} - Get a specific resource type (User/Group)
- GET /scim/v2/Schemas - List all supported schemas
- GET /scim/v2/Schemas/{uri} - Get a specific schema by URI

These endpoints are required by identity providers (Okta, Azure AD, etc.)
for SCIM resource discovery. Previously, GET /scim/v2 returned 404.

Also adds SCIMResourceType, SCIMSchema, and SCIMSchemaAttribute Pydantic
models to the SCIM types module.

Fixes #20295
2026-02-02 14:27:00 -08:00
yuneng-jiang
f1227ce5a8
Merge pull request #20111 from BerriAI/litellm_sso_map_teams
[Feature] SSO Config Team Mappings
2026-02-02 14:18:25 -08:00
yuneng-jiang
65c62ffb1b Adding tests 2026-02-02 14:16:50 -08:00
shin-bot-litellm
923b1cfd92
fix: MCP "Session not found" error on VSCode reconnect (#20298)
* fix: strip stale mcp-session-id header to prevent 'Session not found' error loop

When VSCode reconnects to LiteLLM's MCP endpoint after a reload, it sends
a stale mcp-session-id header. The session was already cleaned up, causing
a 404 'Session not found' error. VSCode retries with the same stale ID,
creating an infinite error loop.

Before forwarding requests to the StreamableHTTP session manager, check if
the mcp-session-id header references a valid session. If the session doesn't
exist, strip the header so a new session is created automatically.

Fixes #20292

* refactor: extract stale session handling into _strip_stale_mcp_session_header helper
2026-02-02 14:15:31 -08:00
krauckbot
c4bbd56a56
feat: add Kimi K2.5 model entry for Moonshot provider (#20273)
Add moonshot/kimi-k2.5 model with:
- Input cost: $0.60/M tokens (6e-07)
- Output cost: $3.00/M tokens (3e-06)
- Cache read cost: $0.10/M tokens (1e-07)
- 256K context window
- Vision, function calling, tool choice, web search support

Reference: https://huggingface.co/moonshotai/Kimi-K2.5

Note: K2.5 thinking mode is controlled via API parameters, not a separate model ID.

Co-authored-by: krauckbot <krauckbot123@gmail.com>
2026-02-02 13:28:57 -08:00
yuneng-jiang
899bafb290 adding team mappings UI 2026-02-02 13:12:20 -08:00
yuneng-jiang
1f51f067eb Merge remote-tracking branch 'origin' into litellm_sso_map_teams 2026-02-02 12:40:12 -08:00
yuneng-jiang
f1bca73431 temp commit for branch switching 2026-02-02 12:38:36 -08:00
yuneng-jiang
b30c17c72d
Merge pull request #20210 from BerriAI/litellm_key_block_rev
[Fix] Remove Key Blocking on Login
2026-02-02 12:00:26 -08:00
yuneng-jiang
bb7712366a
Merge pull request #20220 from BerriAI/litellm_ui_next_upgrade
[Infra] UI - Update next to 16.1.6
2026-02-02 12:00:01 -08:00
Ishaan Jaff
73691fb373
Model request tags documentation (#20290)
* Add request tags documentation for spend tracking

- Add new concise doc explaining how to tag model requests
- Include Python SDK and cURL examples
- Show where tags appear in spend logs
- Add common use cases table (AWS accounts, teams, projects)
- Include how to set default tags on API keys
- Add to Spend Tracking section in sidebar

Co-authored-by: ishaan <ishaan@berri.ai>

* Simplify request tags doc for AI Gateway usage

- Focus on config.yaml setup with default_key_generate_params
- Show both request body and header methods for sending tags
- Remove SDK examples, keep concise cURL examples
- Streamline for quick reference

Co-authored-by: ishaan <ishaan@berri.ai>

* Update request tags doc to show model-level config

- Set tags directly on model deployments in litellm_params
- Requests just specify model, tags applied automatically
- Use clear naming: AWS_IAM_PROD, AWS_IAM_DEV

Co-authored-by: ishaan <ishaan@berri.ai>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ishaan <ishaan@berri.ai>
2026-02-02 11:32:00 -08:00
shin-bot-litellm
0a1b98895b
docs: Add FAQ for setting up and verifying LITELLM_LICENSE (#20284)
* docs: add FAQ for setting up and verifying LITELLM_LICENSE

Added two new FAQ entries to the Enterprise docs page:
- How to set up your Enterprise License (LITELLM_LICENSE) via .env, Docker, or docker-compose
- How to verify the license is active by checking for 'Enterprise Edition' in the Swagger UI

* docs: trim license FAQ to essential steps only
2026-02-02 11:03:45 -08:00
ryan-crabbe
7a6820defa
perf: cache _get_relevant_args_to_use_for_logging() at module level (#20077)
* perf: cache _get_relevant_args_to_use_for_logging() as module-level frozenset

The set of valid LLM API parameter names for logging was being rebuilt
on every request from 8 OpenAI SDK type annotations + set operations.
Since these are static TypedDict annotations that never change at
runtime, compute once at import time and store as a class-level
frozenset.

Line profiler: get_standard_logging_model_parameters() dropped from
774ms to 77ms across 12K calls (90% reduction, ~25µs/req saved).

* test: add tests for cached ModelParamHelper logging args

Verify cached frozenset matches dynamic computation and that
prompt content keys (messages, prompt, input) are excluded from
logged model parameters.
2026-02-02 10:54:49 -08:00
ryan-crabbe
fadc04fbe2
perf: optimize wrapper_async with CallTypes caching and reduced lookups (#20204)
- Cache CallTypes enum values as module-level dict to avoid repeated list
  comprehension and enum construction on every call
- Hoist update_response_metadata getattr lookup to top of function
- Guard verbose print_verbose call behind _is_debugging_on() check
2026-02-02 10:42:12 -08:00
Sameer Kankute
ade35a3f9a
Merge pull request #20266 from BerriAI/litellm_oss_staging_01_31_2026_3
Litellm oss staging 01 31 2026 3
2026-02-02 19:08:14 +05:30
Sameer Kankute
b85f1f2e6d fix: litellm_core_utils/prompt_templates/factory.py:3431 2026-02-02 19:00:12 +05:30
Sameer Kankute
7329fa8e7a fix: litellm_oss_staging_01_31_2026_3 failing tests 2026-02-02 18:50:58 +05:30
Graham Neubig
a513cfdefa fix: Set standard_logging_object for pass-through endpoints (#19887)
Pass-through endpoints (like vLLM classify) were not setting
standard_logging_object because _get_assembled_streaming_response
returns None for non-ModelResponse results.

This caused model_max_budget_limiter.async_log_success_event to raise
ValueError('standard_logging_payload is required').

The fix adds an elif branch in async_success_handler that mirrors the
non-pass-through code path.

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2026-02-02 18:25:02 +05:30
Nate Tessman
d7997db912 fix: Include hidden params in chat response to responses api response transformation (#20084)
* Include hidden_params in chat completion to responses transformation

* add tests
2026-02-02 18:24:21 +05:30
Lovro Seder
726988aed4 Fix Azure AI Anthropic CountTokens 401 auth error (#20069)
Add x-api-key header to CountTokens handler to match chat completion
authentication. Azure AI Anthropic requires this header per Microsoft's
native API format.
2026-02-02 18:24:06 +05:30
Abdullah Habib Biswas
ef73f330f1 fix: prevent error when max_fallbacks exceeds available models (#20071) 2026-02-02 18:23:53 +05:30
Simon Lynch
07bffddbfa fix(bedrock): deduplicate toolResult and toolUse blocks in Converse message transformation (#20049)
Bedrock rejects requests when toolResult or toolUse blocks within a
single message contain duplicate IDs. The Converse message transformer
merges consecutive tool/assistant messages without checking for
duplicate toolUseId values, causing BedrockException errors.

Add _deduplicate_bedrock_content_blocks() — a generalized helper that
removes duplicate blocks by ID, logs a warning for each dropped
duplicate via verbose_logger, and preserves non-tool blocks (e.g.
cachePoint). Apply it at all four merge sites (sync/async × toolResult/
toolUse).

The Anthropic /messages path was fixed in PR #19324; this applies the
equivalent fix to the Bedrock Converse path.

Fixes #20048

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:23:43 +05:30
jquinter
1985aa04fa Fix Nova grounding web_search_options={} not applying systemTool (#20044)
* Fix Nova grounding web_search_options={} not applying systemTool

Two bugs prevented web_search_options={} from working for Nova grounding:

1. Empty dict falsy check: The condition `value and isinstance(value, dict)`
   short-circuits to False when value is {} (empty dict is falsy in Python).
   Changed to `isinstance(value, dict)` to match Anthropic's implementation.

2. Pre-formatted tools mangled by _bedrock_tools_pt: The systemTool
   (already in Bedrock format) was added to optional_params["tools"], but
   _process_tools_and_beta passed all tools through _bedrock_tools_pt which
   expects OpenAI-format tools. This corrupted the systemTool into an empty
   toolSpec. Fixed by separating systemTool blocks before transformation
   and appending them after.

Fixes follow-up to #19598

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

* Fix python-multipart Python version constraint for Poetry lock

python-multipart ^0.0.22 requires Python >=3.10 but the project supports
>=3.9. Add python = ">=3.10" marker so Poetry can resolve dependencies
for Python 3.9.

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:23:31 +05:30
Carlo Alberto Ferraris
1e8848ca97 add missing indexes on VerificationToken table (#20040) 2026-02-02 18:22:15 +05:30
Hi120ki
c9757cd0d7 fix(guardrails): populate applied_guardrails when Model Armor blocks content (#20034)
Previously, when Model Armor guardrail blocked a request/response,
the `applied_guardrails` field was not populated in the logs because
`add_guardrail_to_applied_guardrails_header()` was called after the
HTTPException was raised.

This fix moves the `add_guardrail_to_applied_guardrails_header()` call
to before the blocking check in all hooks:
- async_pre_call_hook (pre_call mode)
- async_moderation_hook (during_call mode)
- async_post_call_success_hook (post_call mode)
- async_post_call_streaming_iterator_hook (streaming)

This ensures that even when a guardrail blocks content, the guardrail
name is properly recorded in the logs for observability.

Added regression tests to verify applied_guardrails is populated when
content is blocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-02 18:21:44 +05:30
Harshit Jain
6d86808eaf feat: enforce model-level TPM/RPM limits (enforce_model_rate_limits) … (#19230)
* feat: enforce model-level TPM/RPM limits (enforce_model_rate_limits) flag

* fix lint errors
2026-02-02 18:18:46 +05:30
Harshit Jain
a457162517 fix: handle deprecated 'redis_db' arg to prevent crash (#19808)
* fix: handle deprecated 'redis_db' arg to prevent crash

* renamed: changed dir
2026-02-02 18:18:05 +05:30
Cesar Garcia
61a84e9fdb fix(anthropic-adapter): truncate tool names exceeding OpenAI's 64-char limit (#20107)
When using LiteLLM's Anthropic /v1/messages endpoint to route requests to
OpenAI models, requests fail if any tool name exceeds OpenAI's 64-character
limit. Anthropic API has no such limit, causing compatibility issues.

Changes:
- Add truncate_tool_name() function using {55-char-prefix}_{8-char-hash} format
- Modify translate_anthropic_tools_to_openai() to truncate and return mapping
- Modify translate_anthropic_tool_choice_to_openai() to truncate tool name
- Restore original tool names in responses using the mapping
- Support tool name restoration in streaming responses
- Add backwards-compatible API (existing methods still work)

The fix only applies when routing Anthropic requests to OpenAI models.
Native Anthropic/Claude requests pass through unchanged.
2026-02-02 18:16:07 +05:30
Harshit Jain
72e5193451 fix: models loadbalancing billing issue by filter (#18891) (#19220)
* fix: models loadbalancing billing issue by filter (#18891)

* fix: models loadbalancing billing issue by filter

* fix: separate key and team access groups in metadata

* fix: lint issues
2026-02-02 18:14:39 +05:30
Aarish Alam
3e04e20205 🐛 Bug Fix #19642 : bug in Vertex AI context caching (#19657)
* add vertex tests

* add uperbound

* add pagination tests
2026-02-02 18:13:34 +05:30
Chesars
b3f1696946 refactor(vertex_ai): reuse get_vertex_base_url for URL construction
Use existing get_vertex_base_url from common_utils instead of duplicating
the global vs regional URL logic in create_vertex_url and get_api_base.
2026-02-02 18:13:18 +05:30
Chesars
3215dc4d4e feat(vertex_ai): add global endpoint support for Qwen MaaS models
Fixes #19788

- Add `supported_regions: ["global"]` to Qwen MaaS models in model_prices_and_context_window.json
- Update `get_supported_regions()` to read directly from `model_cost` dict
- Update `get_complete_vertex_url()` to use `get_vertex_region()` for global-only models
- Update `create_vertex_url()` to generate correct URL for global location (without region prefix)
- Add tests for Qwen global endpoint support
2026-02-02 18:13:10 +05:30
Emerson Gomes
bb5397d9b2 fix: enforce scheme for Azure AI rerank api_base 2026-02-02 18:13:04 +05:30