Commit graph

29986 commits

Author SHA1 Message Date
Ishaan Jaffer
676e362d43 bump extrs 2026-01-07 14:40:30 +05:30
Ishaan Jaffer
ee2b51b2d0 test_openai_image_edit_cost_tracking 2026-01-07 14:36:50 +05:30
Ishaan Jaffer
bab43ee9dd fix list keys 2026-01-07 14:34:37 +05:30
Sameer Kankute
fdb9679657 Add annotations to completions responses API bridge 2026-01-07 14:30:31 +05:30
Ishaan Jaffer
38ccfb4234 test_completion_claude_3_function_call_with_otel 2026-01-07 14:22:54 +05:30
Ishaan Jaffer
fa1b387237 test_routing_strategy_init 2026-01-07 14:21:03 +05:30
Ishaan Jaffer
3530218930 fix aupload_container_file 2026-01-07 14:19:36 +05:30
Ishaan Jaffer
b7798b7f7c fix metadata.cost_breakdown 2026-01-07 14:17:08 +05:30
Ishaan Jaff
b5d74722ba
Revert "Litellm fixes a2a sdk (#18748)" (#18752)
This reverts commit 1661707492.
2026-01-07 14:04:10 +05:30
Ishaan Jaff
1f141f0dbb
[Feat] Litellm new endpoint add container file upload (#18743)
* init upload_container_file

* init upload_container_file

* _prepare_multipart_file_upload

* fix upload_container_file

* aupload_container_file, upload_container_file

* register_container_file_endpoints
2026-01-07 13:36:55 +05:30
Ishaan Jaff
861dac1c8d
[Fix] A2a endpoint - fix timeout (#18747)
* fix DEFAULT_A2A_AGENT_TIMEOUT

* use DEFAULT_A2A_AGENT_TIMEOUT

* grpcio
2026-01-07 13:31:53 +05:30
Ishaan Jaff
1661707492
Litellm fixes a2a sdk (#18748)
* add a2a SDK to req

* fix
2026-01-07 13:31:45 +05:30
Sameer Kankute
d3e24ab9cd Fix: Gemini generate content request with audio file id 2026-01-07 12:58:54 +05:30
yuneng-jiang
a912665a86
Merge pull request #18682 from BerriAI/litellm_ui_e2e_admin_settings
[Infra] UI - E2E Test: Can View Admin Setting Page
2026-01-06 23:25:28 -08:00
yuneng-jiang
f143a16e9b
Merge pull request #18742 from BerriAI/litellm_ui_unit_test_coverage_05
[Infra] UI - Adding Unit Test for Coverage
2026-01-06 23:18:29 -08:00
yuneng-jiang
6fd7b1cf56 Adding unit tests for coverage 2026-01-06 22:46:06 -08:00
YutaSaito
9dd9f9fc43
Merge pull request #18738 from BerriAI/litellm_feat_allow_arize_project_name
[feat] allow configuring arize project name for OpenTelemetry service name
2026-01-07 15:01:28 +09:00
Sameer Kankute
bf506378b8 Fix: tool content should be str 2026-01-07 11:01:31 +05:30
Yuta Saito
e5be160ae0 docs: sets ARIZE_PROJECT_NAME 2026-01-07 14:27:16 +09:00
Yuta Saito
1d16a8526e feat: allow configuring project name for OpenTelemetry service name 2026-01-07 14:20:10 +09:00
Sameer Kankute
cc45423294 Fix: Nonetype object has no method .get() for call tool 2026-01-07 10:42:02 +05:30
yuneng-jiang
7dca991a5f
Merge pull request #18736 from BerriAI/litellm_ui_team_settings_budget_duration
[Feature] UI - Reusable Duration Select + Team Update Member Budget Duration
2026-01-06 18:24:45 -08:00
yuneng-jiang
4d7ed62456
Merge pull request #18735 from BerriAI/litellm_fs_team_member_budget_duration
[Feature] Allow editing team_member_budget_duration in /team/update
2026-01-06 18:24:34 -08:00
yuneng-jiang
8b3782b06a Reusable Duration Select and update team member budget UI 2026-01-06 18:15:16 -08:00
Stephen Matta
b40a6a0f6c
[Fix] Nova model detection for Bedrock provider (#17910)
Resolves issue #17910 where Amazon Nova models (like amazon.nova-pro-v1:0)
were incorrectly identified as Amazon Titan models, causing requests to
use textGenerationConfig instead of inferenceConfig.

The fix moves the "nova" check before the initial provider check on the
split model name. This ensures that models containing "nova" (like
amazon.nova-pro-v1:0 or amazon.nova-2-lite-v1:0) are correctly identified
as Nova models, rather than matching "amazon" first.
2026-01-06 21:12:30 -05:00
yuneng-jiang
2a6f2a3fb8 add team member budget duration in team/update 2026-01-06 17:43:17 -08:00
yuneng-jiang
6078f4687e
Merge pull request #18732 from BerriAI/litellm_ui_build_fix_3
[Infra] Fixing UI Build
2026-01-06 17:22:34 -08:00
yuneng-jiang
ae7df51e69 Fixing e2e 2026-01-06 17:06:48 -08:00
yuneng-jiang
8878b43466 Adding timeout for flaky test 2026-01-06 16:56:54 -08:00
YutaSaito
c6b1e0512f
Merge pull request #18726 from gkarthi-signoz/main
[Docs]: Adding SigNoz integration to observability docs
2026-01-07 09:47:18 +09:00
yuneng-jiang
874e8d1a6e Fixing build 2026-01-06 16:33:08 -08:00
yuneng-jiang
1466f38122 Adding dist build files 2026-01-06 16:29:47 -08:00
yuneng-jiang
1f16b8c093 cz bump and migration 2026-01-06 16:02:08 -08:00
yuneng-jiang
ccfffc5de9 Add endpoint to aggregate activity tables 2026-01-06 15:54:03 -08:00
Goutham Karthi
2865b17988 adding signoz integration to observability docs 2026-01-06 15:29:44 -08:00
Alexsander Hamir
bb4c01ffa0
Add LITELLM_DISABLE_LAZY_LOADING env var to fix VCR cassette creation issue (#18725) 2026-01-06 14:49:11 -08:00
Otavio Brito
18ca6b2add
Handle not supported region for vertex ai count tokens - v1/messages/count_tokens (#18665)
* Handle not supported region for vertex ai count tokens

* add unit test
2026-01-07 00:05:00 +05:30
Felipe Peter
0756b48963
Add Anthropic cache control option to image tool call results (#18674) 2026-01-07 00:03:25 +05:30
Lundin Matthews
762345172c
Add LlamaGate as a new provider (#18673)
Adds LlamaGate (https://llamagate.dev) as an OpenAI-compatible provider with:
- Provider configuration in providers.json
- Documentation page with usage examples
- Model pricing for 17 models across categories:
  - General purpose (Llama 3.1/3.2, Mistral, Qwen, Dolphin)
  - Reasoning (DeepSeek R1, OpenThinker)
  - Code (Qwen Coder, DeepSeek Coder, CodeLlama)
  - Vision (Qwen VL, LLaVA, Gemma 3)
  - Embeddings (Nomic, Qwen3 Embedding)

Provider details:
- Base URL: https://api.llamagate.dev/v1
- Auth: Bearer token via LLAMAGATE_API_KEY
- Pricing: $0.02-$0.55 per 1M tokens
- All models are open-weights
2026-01-07 00:00:30 +05:30
Lize Cai
fe9b05e23e
Add header for SAP AI Core Tracking (#18714)
Signed-off-by: Lize Cai <lize.cai@sap.com>
2026-01-06 23:59:02 +05:30
Rohit Ravikant Rane
a7c39ccc12
fix(router): correct num_retries tracking in retry logic (#18712)
* fix(router): correct num_retries tracking in retry logic

- Fix off-by-one error in num_retries attribute when retries exhausted
- Correct remaining_retries calculation
- Add comprehensive tests for retry tracking edge cases

Fixes incorrect retry count in error messages and logging

* chore: trigger CI re-run

* chore: trigger CI tests again
2026-01-06 23:58:41 +05:30
Kazuki Matsumaru
26bdf7b7a8
Remove redundant comments about setting litellm.callbacks (#18711)
- Removed duplicate comment in test_router_endpoints.py
- Removed duplicate comment in logging.md
- Kept clearer comment: 'Set litellm.callbacks = [proxy_handler_instance] on the proxy'
2026-01-06 23:58:01 +05:30
Isaac Reis
a17757159c
add amazon.nova-2-multimodal-embeddings-v1:0 to model_prices_and_context_window.json (#18710) 2026-01-06 23:57:35 +05:30
Krish Dholakia
7004734528
Revert "feat: Add built-in migration lock to prevent concurrent Prisma migrat…" (#18719)
This reverts commit 9f68081f6d.
2026-01-06 23:56:02 +05:30
Hamza Qureshi
9c544949f8
feat: Add Prometheus metrics for request queue time and guardrails (#17973)
* feat: Add Prometheus metrics for request queue time and guardrails

- Add litellm_request_queue_time_seconds metric to track time from request arrival to processing start
- Add guardrail metrics: latency, errors_total, and requests_total counters
- Track arrival time in litellm_pre_call_utils.py
- Calculate queue time in common_request_processing.py
- Record guardrail metrics in pre_call_hook and during_call_hook
- Add comprehensive unit tests for all new metrics

Fixes #17863

* perf: optimize timing calls for queue time and guardrail metrics

* fix: resolve conflicts in utils.py - integrate Prometheus metrics with guardrail load balancing
2026-01-06 23:50:11 +05:30
Pascal Bro
cac2a8d158
Fix/gcs cache docs missing for proxy mode (#13328)
* fixed issues with gcs cache to verify functionality

* restore changes

* Fix capitalization of 'S3 Bucket Cache'

---------

Co-authored-by: Nelson Alfonso <45660392+Dashing-Nelson@users.noreply.github.com>
2026-01-06 23:49:08 +05:30
minijeong-log
9f68081f6d
feat: Add built-in migration lock to prevent concurrent Prisma migrate deploy (#14440)
* feat: prisma migrate deploy with lock
Author: Mini Jeong <mini.jeong@navercorp.com>

* fix: use redis cache from proxy server
Author: Mini Jeong <mini.jeong@navercorp.com>

* fix: add type checks and fix unit tests for migration lock

- Add DATABASE_URL validation in _create_baseline_migration() and _resolve_all_migrations()
- Fix MyPy type errors by adding None checks before using database_url in subprocess calls
- Add _resolve_all_migrations mock to failing unit tests to prevent filesystem errors
- Apply Black formatting to modified files

Fixes:
- MyPy type errors: database_url could be None when passed to subprocess
- Unit test failures: _resolve_all_migrations tried to create directories in read-only /test path

* fix: resolve MyPy type error in vertex_ai vertex_llm_base

Fix MyPy type checking error where vertex_api_version parameter type
was incompatible with function signature expectation.

* fix: Return 403 exception when calling GET responses api

* fix: added new step into rotate master key function for processing credentials table

* Add redisvl in requirements.txt

* fix: fixed the issue of handling root paths when processing Discovery protected resource metadata and authorization server metadata URLs.

* fix: added additional grant type into oauth_authorization_server response for fixing mcp auth register bad request issue

* fix: added RFC RECOMMENDED property(scopes_supported) to protected resource and authorization server metadata

* fix: removed initialize the tool name to MCP server name mapping(oauth2) on startup for avoiding 401 error

* fix: upgraded mcp sdk depency version for fixing ClosedResourceError

* Use already configured opentelemetry providers

Users that instrument using opentelemetry-instrument can now setup exporters as per their environment.

* Handle all protocols for all telemetry

* Add more tests

* feat(mcp): parallelize tool fetching from multiple MCP servers (#18627)

* feat(mcp): parallelize tool fetching from multiple MCP servers

Replace sequential tool fetching with asyncio.gather() to reduce
client timeouts when using multiple MCP servers.

Changes:
- mcp_server_manager.py: list_tools() now fetches tools in parallel
- server.py: _get_tools_from_mcp_servers() now fetches tools in parallel

Real-world impact (7 MCP servers example):
- Sequential: ~4.5+ seconds (exceeds typical 5-second client timeouts)
- Parallel: ~1.2 seconds (max of all servers)

Fixes #18626

* fix: copy oauth2_headers to avoid shared dict mutation in parallel tasks

* feat: add display_name, model_vendor, and model_version metadata

* added the option of adding langsmith tenant id in the env (#18623)

* 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>

* 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.

* 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)

* Adding Role Mappings

* Fixing Edit SSO Settings Modal

* feat: add user_mcp_management_mode for view_all visibility

* Fixing tests

* fix: missing mcp_allow_all_ui.png

* docs: add user_mcp_management_mode

* Align responses API streaming hooks with chat pipeline

* Clarify responses API streaming context

* Address review comments

* 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

* Revert "Add redisvl in requirements.txt"

* Put reasoning summary behind feat flag

* fix: model eol

* fix: anthropic claude-3-opus-20240229 EOL

* Revert "fix: model eol"

This reverts commit 5aa1665d79.

* Fix: ImportError: qualifire package is required for QualifireGuardrail. Install it with: pip install qualifire

* fix: test_secret_manager_failure_does_not_block_email

* fix: test_update_ui_settings_allowlisted_value

* fix: test_aaamodel_prices_and_context_window_json_is_valid

* fix: test_all_models_have_display_name

* fix: async def test_bedrock_apply_guardrail_blocked()

* fix: test_databricks_embeddings[True]

* fix:test_anthropic_beta_header

* fix:test_api_error_handling

* fix:mypy mcp management

* Revert "feat(model_cost): add display_name, model_vendor, and model_version metadata to model entries"

* [Feat] New API Endpoint - Responses API (v1/responses/compact) (#18697)

* init transform_compact_response_api_request

* init acompact_responses

* init async_compact_response_api_handler in llm http handler

* init transform_compact_response_api_request for openai

* init acompact_responses

* fix acompact_responses

* add OAI Compact API

* docs responses API Compact

* code qa checks

* test_openai_compact_responses_api

* fix mypy linting

* fix: remove display name

* Add the LITELLM_REASONING_AUTO_SUMMARY in doc

* fix model map

* [UI] - Feat add request provider form on UI (#18704)

* add request provider form

* fix link to github

* add button

* fix link

* fix(streaming): normalize status code extraction to prevent 4xx errors from triggering mid-stream fallback (#18698)

在流式处理错误时,添加状态码标准化逻辑,确保 4xx 客户端错误直接抛出而不是被包装成 MidStreamFallbackError。

- 新增 _normalize_status_code 函数用于从异常对象提取状态码
- 优先从异常的 status_code 属性获取,其次从 response.status_code 获取
- 当映射异常或原始异常的状态码在 400-499 范围内时,直接抛出映射异常
- 添加单元测试验证 Vertex AI 400 错误正确抛出为 BadRequestError
- 确保流式处理中的客户端错误能够正确传播,而不会触发回退机制

---------

Co-authored-by: Eric84626 <lixiannan@gmail.com>
Co-authored-by: Eric84626 <97266539+Eric84626@users.noreply.github.com>
Co-authored-by: Sameer Kankute <sameer@berri.ai>
Co-authored-by: mangabits <1457532+mangabits@users.noreply.github.com>
Co-authored-by: Costa Tsaousis <costa@tsaousis.gr>
Co-authored-by: Nik <nikolas.garza5@gmail.com>
Co-authored-by: Shivam Rawat <161387515+shivamrawat1@users.noreply.github.com>
Co-authored-by: FlibbertyGibbitz <seth@evenkeelconsultingllc.com>
Co-authored-by: Flibbert E. Gibbitz <flibbertygibbitz@runelabs.ai>
Co-authored-by: Cesar Garcia <128240629+Chesars@users.noreply.github.com>
Co-authored-by: yuneng-jiang <yuneng.jiang@gmail.com>
Co-authored-by: Yuta Saito <uc4w6c@bma.biglobe.ne.jp>
Co-authored-by: LingXuanYin <3546599908@qq.com>
Co-authored-by: YutaSaito <36355491+uc4w6c@users.noreply.github.com>
Co-authored-by: 0717376 <103773680+0717376@users.noreply.github.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Kris Xia <xiajiayi0506@gmail.com>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2026-01-06 23:46:24 +05:30
Kris Xia
5e00a49e7f
fix(streaming): normalize status code extraction to prevent 4xx errors from triggering mid-stream fallback (#18698)
在流式处理错误时,添加状态码标准化逻辑,确保 4xx 客户端错误直接抛出而不是被包装成 MidStreamFallbackError。

- 新增 _normalize_status_code 函数用于从异常对象提取状态码
- 优先从异常的 status_code 属性获取,其次从 response.status_code 获取
- 当映射异常或原始异常的状态码在 400-499 范围内时,直接抛出映射异常
- 添加单元测试验证 Vertex AI 400 错误正确抛出为 BadRequestError
- 确保流式处理中的客户端错误能够正确传播,而不会触发回退机制
2026-01-06 23:41:23 +05:30
Cesar Garcia
01b6925610
Merge branch 'main' into litellm_ui_custom_proxy_base_url 2026-01-06 12:34:25 -03:00
Chesars
cd38e1c9de Scope custom proxy base to Playground 2026-01-06 12:17:22 -03:00