Commit graph

29663 commits

Author SHA1 Message Date
Ishaan Jaffer
3f720f0b56 add OAI Compact API 2026-01-06 15:15:35 +05:30
Ishaan Jaffer
091c3a3d00 fix acompact_responses 2026-01-06 15:02:34 +05:30
Ishaan Jaffer
a10fee0cef init acompact_responses 2026-01-06 14:53:00 +05:30
Ishaan Jaffer
fab4199bee init transform_compact_response_api_request for openai 2026-01-06 14:51:13 +05:30
Ishaan Jaffer
629db98f6c init async_compact_response_api_handler in llm http handler 2026-01-06 14:51:01 +05:30
Ishaan Jaffer
8a0b5ce782 init acompact_responses 2026-01-06 14:50:25 +05:30
Ishaan Jaffer
d3e88df4f1 init transform_compact_response_api_request 2026-01-06 14:50:14 +05:30
YutaSaito
facc4b0b79
Merge pull request #18693 from BerriAI/litellm_fix_main_test
fix main test
2026-01-06 17:17:33 +09:00
Yuta Saito
ca14160375 Revert "fix: model eol"
This reverts commit 5aa1665d79.
2026-01-06 16:49:30 +09:00
Yuta Saito
23713d1811 fix: anthropic claude-3-opus-20240229 EOL 2026-01-06 16:06:21 +09:00
Yuta Saito
5aa1665d79 fix: model eol 2026-01-06 15:47:37 +09:00
YutaSaito
abb4df9dc7
Merge pull request #18687 from BerriAI/revert-18177-litellm_fix_redisvl_dependency
Revert "Add redisvl in requirements.txt"
2026-01-06 15:12:39 +09:00
YutaSaito
1897a1f894
Revert "Add redisvl in requirements.txt" 2026-01-06 15:04:56 +09:00
Sameer Kankute
694e44551f
Merge pull request #17330 from nmgarza5/add-model-metadata
feat(model_cost): add display_name, model_vendor, and model_version metadata to model entries
2026-01-06 10:56:49 +05:30
Sameer Kankute
0f55c2b216
Merge pull request #18513 from talesofai/feat/responses-api-hooks-parity
feat (proxy) : Responses API Support More Streaming Callback Hooks
2026-01-06 10:51:48 +05:30
Sameer Kankute
3c0248edb9
Merge pull request #18663 from BerriAI/litellm_staging_01_05_2026
Staging 01/05/2026
2026-01-06 10:46:04 +05:30
Sameer Kankute
4ebd9b266b
Merge pull request #18177 from BerriAI/litellm_fix_redisvl_dependency
Add redisvl in requirements.txt
2026-01-06 10:43:25 +05:30
0717376
12f02f6c54
feat: Add GigaChat provider support (#18564)
* feat: Add GigaChat provider support

Add native support for GigaChat API (Sber AI, Russia's leading LLM).

Supported features:
- Chat completions (sync/async)
- Streaming (sync/async)
- Function calling / Tools
- Structured output via JSON schema (emulated through function calls)
- Image input (base64 and URL)
- Embeddings

Closes #18515

* fix: resolve mypy type errors in GigaChat handler

- Fix _prepare_file_data return type (use 3-tuple for cleaner type flow)
- Add type annotations for lists in _process_content_parts methods
- Add type annotations in _collapse_user_messages
- Use ChatCompletionToolCallChunk for proper tool_use typing
- Add type: ignore[override] for astreaming async generator

* refactor(gigachat): migrate to BaseConfig pattern

* fix: remove unused imports

* fix: resolve mypy type errors

* fix: mypy type errors

* refactor: address review feedback for GigaChat provider

- Remove singleton pattern, reuse litellm HTTPHandler
- Move constants/errors to transformation files, delete common_utils.py
- Add models to model_prices_and_context_window.json
- Fix ssl_verify not passed to HTTP client for embeddings

* docs: update GigaChat documentation with ssl_verify requirement
2026-01-06 10:10:02 +05:30
YutaSaito
a774e7899c
Merge pull request #18281 from Eric84626/main
Fix: fixed some MCP gateway oauth2 auth issues and ClosedResourceError
2026-01-06 13:22:46 +09:00
yuneng-jiang
612782e2fb
Merge pull request #18680 from BerriAI/litellm_sso_modal_fix
[Fix] UI - SSO Edit Modal Clear Role Mapping Values on Provider Change
2026-01-05 19:55:49 -08:00
YutaSaito
31470032ad
Merge pull request #18681 from BerriAI/litellm_feat_mcp-server-visibility-configurable
[feat] mcp server visibility configurable
2026-01-06 12:53:07 +09:00
YutaSaito
ccdcb20048
Merge pull request #18279 from mangabits/fix-otel-provider
Use already configured opentelemetry providers
2026-01-06 12:49:48 +09:00
mangabits
ce678403b3 Address review comments 2026-01-05 19:42:44 -08:00
LingXuanYin
d101990342 Clarify responses API streaming context 2026-01-06 10:54:19 +08:00
LingXuanYin
499fc9f48a Align responses API streaming hooks with chat pipeline 2026-01-06 10:54:19 +08:00
Yuta Saito
29e658012a docs: add user_mcp_management_mode 2026-01-06 11:43:58 +09:00
Yuta Saito
375f3ed439 fix: missing mcp_allow_all_ui.png 2026-01-06 11:23:22 +09:00
yuneng-jiang
4566255181 Fixing tests 2026-01-05 18:22:54 -08:00
Yuta Saito
694bcb6186 feat: add user_mcp_management_mode for view_all visibility 2026-01-06 11:22:28 +09:00
yuneng-jiang
2d464032c5 Fixing Edit SSO Settings Modal 2026-01-05 18:08:41 -08:00
yuneng-jiang
4cdcdc98e8
Merge pull request #18677 from BerriAI/litellm_ui_sso_settings_role
[Feature] UI - SSO Settings Page Add Role Mappings
2026-01-05 17:40:29 -08:00
yuneng-jiang
8851b86d93 Adding Role Mappings 2026-01-05 17:30:31 -08:00
Eric84626
f59e9cef55
Merge branch 'main' into main 2026-01-06 06:57:25 +08:00
YutaSaito
8d40335684
Merge pull request #18670 from BerriAI/litellm_fix_async_client
fix: ensure_async_clients_test error
2026-01-06 07:38:15 +09:00
Yuta Saito
a8092ab4c4 fix: ensure_async_clients_test error 2026-01-06 07:13:13 +09:00
YutaSaito
100f617a8f
Merge pull request #18668 from BerriAI/litellm_feat_noma_mcp_guardrail
[feat] add support MCP guardrail to noma
2026-01-06 07:01:57 +09:00
Yuta Saito
e5b06effda fix: correct incorrect type annotation 2026-01-06 06:38:33 +09:00
YutaSaito
0e9c5739ff
Merge pull request #18669 from BerriAI/litellm_doc_mcp_resources
[docs] mention MCP prompt/resources types in overview
2026-01-06 06:30:54 +09:00
Yuta Saito
bdd95314a7 docs: mention MCP prompt/resources types in overview 2026-01-06 06:29:37 +09:00
Yuta Saito
4eecf59f86 feat: add support MCP guardrail to noma 2026-01-06 06:15:56 +09:00
yuneng-jiang
7937c8674b
Merge pull request #18666 from BerriAI/litellm_keys_create_hour_fix
[Fix] Use timedelta to Calculate Key Expiry on Generate
2026-01-05 12:57:53 -08:00
yuneng-jiang
c7345e4bfd Use timedelta to calculate key expiry 2026-01-05 12:24:34 -08:00
Urain Ahmad Shah
bf33e639ef
Fix User Invite & Key Generation Email Notification Logic (#18524)
* Fix email notification

* Update email notification tests

* moved test file
2026-01-06 01:35:52 +05:30
drorIvry
b6a64ff99a
feature/ add qualifire guardrails (#18594)
* init guardrails

* init guardrails

* some fixes

* some fixes

* ruff

* some fixes

* some fixes

* some fixes

* some fixes

* some fixes

* some fixes

* docs
2026-01-06 01:34:43 +05:30
Cesar Garcia
0e601d0bfe
Fix: Map Gemini cached_tokens to Langfuse cache_read_input_tokens (#18614)
* Fix: Map Gemini cached_tokens to Langfuse cache_read_input_tokens

Fixes #18520

## Problem
Langfuse integration was not capturing cached tokens from Gemini models.
Gemini returns cached tokens in `usage.prompt_tokens_details.cached_tokens`,
but Langfuse only read from top-level `usage.cache_read_input_tokens`
(which only Anthropic populates).

## Solution
Updated langfuse.py to check both locations:
1. First check top-level cache_read_input_tokens (for Anthropic)
2. Then check prompt_tokens_details.cached_tokens (for Gemini, OpenAI, others)

This ensures all providers' cached tokens are properly reported to Langfuse.

## Changes
- Modified litellm/integrations/langfuse/langfuse.py (lines 742-761)
- Added 3 unit tests in tests/test_litellm/integrations/langfuse/test_gemini_cached_tokens.py
- All existing Langfuse tests still pass (11/11)

## Testing
- test_cached_tokens_extraction: Verifies Gemini cached_tokens extraction
- test_cached_tokens_not_present: Backward compatibility (no cached_tokens)
- test_cached_tokens_is_zero: Edge case when cached_tokens = 0

* Refactor: Extract cache token logic into helper function

Address review feedback from @officer47p

- Created _extract_cache_read_input_tokens() helper function
- Reduces code bloat in _log_langfuse_v2 method
- Improves testability and reusability
- All tests still passing (11/11)
2026-01-06 01:34:09 +05:30
Alexsander Hamir
85a357c7e5
fix: extend case normalization to ALL guardrail types (not just tool_permission) (#18664)
This extends the previous fix to handle capitalized fields across ALL guardrail types,
including Presidio, Azure, Lakera, Bedrock, etc.

Discovery:
- Database investigation revealed the issue affects multiple guardrail types
- Found 4 affected guardrails in staging: 3 Presidio + 1 Azure
- All had default_action: 'Deny' causing the same validation failures
- The initial fix only covered ToolPermissionGuardrailConfigModel

Root Cause (Deeper):
- LitellmParams inherits from 13+ different guardrail config models
- Models use ConfigDict(extra="allow") allowing any field to be set
- Users can set default_action/on_disallowed_action on ANY guardrail type
- Only ToolPermissionGuardrailConfigModel was validating these fields

Solution:
- Added field validators to LitellmParams class (parent of all guardrails)
- Validators run for ALL guardrail types: Presidio, Azure, Bedrock, Lakera, etc.
- Added comprehensive tests covering multiple guardrail types

Changes:
- litellm/types/guardrails.py:
  * Added @field_validator for default_action in LitellmParams
  * Added @field_validator for on_disallowed_action in LitellmParams
  * Added normalization in LitellmParams.__init__ as backup
  * Imported field_validator from pydantic

- tests/test_litellm/types/test_guardrails_case_normalization.py:
  * New test file with 7 tests covering multiple guardrail types
  * Tests verify Presidio, Azure, Tool Permission, Lakera, Bedrock
  * All tests passing

Impact:
- Previous fix: Only tool_permission guardrails protected
- This fix: ALL guardrail types now protected (13+ types)
- Handles both new writes and existing database records
- Tested against actual database with Presidio/Azure guardrails

Testing:
- 7 new cross-guardrail tests (all passing)
- 27 existing tool_permission tests (all passing)
- Verified fix works for real database records
2026-01-05 11:59:00 -08:00
Cesar Garcia
22ae1628e1
Add libsndfile to database Docker image for audio processing (#18612)
The litellm-database Docker image was missing the libsndfile system
library, which is required by the soundfile Python package for audio
file processing. This caused failures when using audio transcription
endpoints that attempt to calculate audio duration.

This adds libsndfile to the runtime dependencies in Dockerfile.database,
consistent with Dockerfile.alpine which already includes this library.
2026-01-06 01:23:30 +05:30
FlibbertyGibbitz
3f4a9d8d08
fix(router): Validate routing_strategy at startup to fail fast with helpful error. (#18624)
Invalid routing_strategy values (e.g., "simple" instead of "simple-shuffle") previously failed silently, causing confusing "No deployments available" errors downstream. This change adds upfront validation in routing_strategy_init() to:

- Check if the provided strategy matches valid string values or RoutingStrategy enum
- Raise a clear ValueError listing valid options if invalid
- Fail fast at startup instead of at request time

Fixes behavior reported in #11330 where users had to debug cryptic errors.

Valid strategies: simple-shuffle, least-busy, usage-based-routing, latency-based-routing, cost-based-routing, usage-based-routing-v2

Co-authored-by: Flibbert E. Gibbitz <flibbertygibbitz@runelabs.ai>
2026-01-06 01:22:09 +05:30
Shivam Rawat
8c21fcb957
added the option of adding langsmith tenant id in the env (#18623) 2026-01-06 01:19:27 +05:30
Krish Dholakia
b5aa7d1838
feat: Add api_key to GenericGuardrailAPI and set x-api-key header (#18647)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-06 01:05:51 +05:30