Commit graph

8121 commits

Author SHA1 Message Date
Sameer Kankute
f3ca05112e
Merge pull request #19206 from BerriAI/main
merge main
2026-01-16 15:22:16 +05:30
Sameer Kankute
dcd66db4a8
Revert "fix: models loadbalancing billing issue by filter (#18891)"
This reverts commit 41d8f79929.
2026-01-16 15:21:10 +05:30
Sameer Kankute
b0c6a1b308
Merge pull request #19203 from BerriAI/main
merge main
2026-01-16 15:16:29 +05:30
Sameer Kankute
ac5a4df724 Fix: vertex ai doesn't support structured output 2026-01-16 14:54:31 +05:30
Sameer Kankute
f1bde3c549 Add sanititzation for anthropic messages 2026-01-16 12:47:56 +05:30
Sameer Kankute
c0e5637eae Fix: [Bug]: stream_timeout:The function of this parameter has been changed 2026-01-16 11:40:49 +05:30
Sameer Kankute
9ac490de62
Merge pull request #19179 from BerriAI/litellm_fix_streaming_chunk
Fix : test_stream_chunk_builder_litellm_mixed_calls
2026-01-16 10:52:25 +05:30
Sameer Kankute
d585b760c9 Add fallback endpoints support 2026-01-16 10:51:33 +05:30
Sameer Kankute
aec1990dc2 Fix : test_streaming_multiple_partial_tool_calls 2026-01-16 09:29:54 +05:30
YutaSaito
f123e08b16
Merge pull request #19178 from BerriAI/litellm_fix_ci_litellm_mapped_tests_llms
[tests] skip Azure SDK init check for acreate_skill
2026-01-16 12:17:55 +09:00
Yuta Saito
1c38847b17 tests: skip Azure SDK init check for acreate_skill 2026-01-16 12:03:38 +09:00
YutaSaito
bbf9a9e6e6
Revert "[Fix] /team/daily/activity Show Internal Users Their Spend Only" 2026-01-16 11:27:59 +09:00
Ishaan Jaff
117c7dd158
[Feat] Claude Code - Add End-user tracking with Claude Code (#19171)
* add claude code customer usage tracking

* fix get end user trackign claude code

* TestGetCustomerIdFromStandardHeaders
2026-01-15 17:57:10 -08:00
Yuta Saito
c03630d95e test: fix missing test 2026-01-16 10:33:53 +09:00
Yuta Saito
993742166d test: fix router_code_coverage test fail 2026-01-16 10:16:01 +09:00
yuneng-jiang
5ff768e5e0 Merge remote-tracking branch 'origin' into litellm_deleted_keys_team 2026-01-15 15:55:18 -08:00
yuneng-jiang
6a7edd8f2b
Merge pull request #18785 from BerriAI/litellm_user_promethus_metrics
[Feature] User Metrics for Promethus
2026-01-15 15:51:02 -08:00
yuneng-jiang
e07106244e
Merge pull request #19116 from BerriAI/litellm_org_admin_escalte
[Fix] /user/new Privilege Escalation
2026-01-15 15:50:43 -08:00
Emerson Gomes
f7726c8950 Fix wrong keys being used for model sticky entry 2026-01-15 17:42:29 -06:00
Emerson Gomes
059e75ad88 fix(router): scope deployment affinity by model_map_key
- Key affinity by (user_api_key_hash, model_map_key) -> model_id
- Ignore OpenAI 'user' param for affinity
- Avoid double hashing user_api_key_hash
- Add unit tests + docs clarifications
2026-01-15 16:28:36 -06:00
choigawoon
d76f3acb80
fix: video status/content credential injection for wildcard models (#18854)
* fix: video status/content credential injection for wildcard models

When using wildcard model patterns like `vertex_ai/*`, the video status
and content endpoints failed to resolve the model_name correctly,
causing credential injection to be skipped.

Changes:
- router.py: Added `custom_llm_provider` parameter to
  `resolve_model_name_from_model_id` method
- router.py: Added Strategy 2 (provider prefix matching) and
  Strategy 4 (wildcard pattern matching)
- endpoints.py: Pass `provider_from_id` to resolver in video_status,
  video_content, and video_remix endpoints

This allows video_id like `vertex_ai:veo-3.0-generate-preview:...` to
correctly match `vertex_ai/*` wildcard pattern and inject credentials
from the model config.

Fixes: Video status returns "Your default credentials were not found"
when using Vertex AI video generation with wildcard model patterns.

* pr18845-video기능버그픽스 (vibe-kanban e43e2d2d)

pr코멘트 대응

litellm fork해서 branch만들고 작업후 pull request를 올렸는데 피드백을줬어.

이 내용 파악해서 내가 올린 pr 브랜치에 해당 작업 이어서 해야할거같아.

https://github.com/BerriAI/litellm/pull/18854#discussion\_r2677026995

여기 내용 읽고 현황 파악해서 작업하자.

테스트코드 작성해달라는데 테스트코드작성후 로컬에서 테스트명령어 한번 돌리고 커밋 푸시하려고.

litellm에서 pull request를 위한 문서가 있어.

https://docs.litellm.ai/docs/extras/contributing\_code

CRA서명은 했어. 그다음거부터 양식에 맞게 해야할듯. 지금 버그만 바로 고쳐서 pr했거든.

* fix: resolve mypy type error in resolve_model_name_from_model_id

Rename loop variable to avoid type conflict between DeploymentTypedDict
and Dict[Any, Any] from pattern_router.route() return type.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 03:45:25 +05:30
Harshit Jain
41d8f79929
fix: models loadbalancing billing issue by filter (#18891)
* fix: models loadbalancing billing issue by filter

* fix: separate key and team access groups in metadata
2026-01-16 03:41:21 +05:30
Kris Xia
ccc0e342f2
Make keepalive_timeout parameter work for Gunicorn (#19087)
* [Fix] Containers API - Allow routing to regional endpoints (#19118)

* fix get_complete_url

* fix url resolution containers API

* TestContainerRegionalApiBase

* feat(proxy): add keepalive_timeout support for Gunicorn server

Add configurable keepalive timeout parameter for Gunicorn workers to
match existing Uvicorn functionality. This allows users to tune the
keep-alive connection timeout based on their deployment requirements.

Changes:
- Add keepalive_timeout parameter to _run_gunicorn_server method
- Configure Gunicorn's keepalive setting (defaults to 90s if not specified)
- Update --keepalive_timeout CLI help text to document both Uvicorn and Gunicorn behavior
- Pass keepalive_timeout from run_server to _run_gunicorn_server

Tests:
- Add test to verify keepalive_timeout flag is properly passed to Gunicorn
- Add test to verify default 90s timeout when flag is not specified

Co-Authored-By: lizhen921 <294474470@qq.com>
Signed-off-by: Kris Xia <xiajiayi0506@gmail.com>

---------

Signed-off-by: Kris Xia <xiajiayi0506@gmail.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: lizhen921 <294474470@qq.com>
2026-01-16 03:32:59 +05:30
Vikash
c619569604
Added ability to customize logfire base url through env var (#19148)
* Added ability to customize logfire base url through env var

* Added test to check if env var is used correctly for logfire

* Document the env var

* Documented env var in config_settings.md
2026-01-16 00:10:59 +05:30
Sameer Kankute
8c454eb74f Fix: mock test tests 2026-01-15 22:02:51 +05:30
Sameer Kankute
83e33944ef Fix: mock test tests 2026-01-15 22:02:42 +05:30
Sameer Kankute
890fa85a33 Fix: response enterprise tests 2026-01-15 21:25:22 +05:30
Emerson Gomes
e23bd21a28 Add deployment affinity routing 2026-01-15 08:53:31 -06:00
Sameer Kankute
b4ee1b2589 Fix: response enterprise tests 2026-01-15 19:53:04 +05:30
Sameer Kankute
4bdda9cc28 Fix: tests/test_litellm/proxy/test_proxy_server.py::test_embedding_input_array_of_tokens 2026-01-15 19:46:35 +05:30
Sameer Kankute
f28d951202 Fix: tests/test_litellm/proxy/test_litellm_pre_call_utils.py::test_embedding_header_forwarding_with_model_group 2026-01-15 19:41:16 +05:30
Sameer Kankute
3af994a32a Fix: test router 2026-01-15 19:21:31 +05:30
Sameer Kankute
83cdfd886a
Merge pull request #19059 from BerriAI/litellm_openrouter_image_gen
Add openrouter support for image/generation endpoints
2026-01-15 15:48:00 +05:30
YutaSaito
f541bc0261
Merge pull request #19129 from BerriAI/litellm_fix_mcp_chat_completions
[fix] mcp chat completions
2026-01-15 18:21:37 +09:00
Yuta Saito
ba43f742ab fix: event loop nesting issue in MCP chat completions with streaming
Problem: When using MCP tools with  and , the following error occurred:

RuntimeError: Timeout context manager should be used inside a task
2026-01-15 15:36:56 +09:00
yuneng-jiang
27bc5c1fca
Merge pull request #19120 from BerriAI/litellm_yj_triage_branch
[Fix] Azure Storage Circular Reference Error
2026-01-14 18:08:38 -08:00
Ishaan Jaff
e67e9e7054
[Fix] Containers API - Allow routing to regional endpoints (#19118)
* fix get_complete_url

* fix url resolution containers API

* TestContainerRegionalApiBase
2026-01-14 17:28:18 -08:00
yuneng-jiang
97c39dbb7a Fixing circular reference for azure storage 2026-01-14 16:11:55 -08:00
Ishaan Jaff
62187103b4
[Fix] Containers API - Container API routes return 401 for non-admin users - routes missing from openai_routes (#19115)
* test_containers_routes_are_llm_api_routes

* allow /containers/* API
2026-01-14 15:14:03 -08:00
yuneng-jiang
30859d763e Fix user escalation 2026-01-14 15:13:25 -08:00
yuneng-jiang
dcac090de0
Merge pull request #19053 from BerriAI/litellm_intern_user_usage
[Fix] /team/daily/activity Show Internal Users Their Spend Only
2026-01-14 13:47:34 -08:00
Ishaan Jaff
747829dadb
[Fix] Claude Code + Bedrock Converse Usage - ensure budget tokens are passed to converse api correctly (#19107)
* test_bedrock_converse_budget_tokens_preserved

* test_openai_model_with_thinking_converts_to_reasoning_effort

* fix translate_anthropic_thinking_to_reasoning_effort

* test_bedrock_converse_budget_tokens_preserved

* test_anthropic_messages_bedrock_converse_with_thinking
2026-01-14 12:02:27 -08:00
Rayan Pal
f880ea537f
fix(vertex): add type object to tool schemas missing type field (#19103)
Tools with no parameters (like EnterPlanMode from Anthropic Agents SDK)
send schemas with only $schema and no type field. Gemini rejects these
with "functionDeclaration parameters schema should be of type OBJECT".

Adds type: object when schema has no type and no anyOf/oneOf/allOf.
2026-01-15 00:43:35 +05:30
Rayan Pal
d92a0168cc
fix: keep type field in Gemini schema when properties is empty (#18979) 2026-01-14 22:58:05 +05:30
Peter Golm
c215b3a79f
fix: preserve llm_provider-* headers in error responses (#19020)
Extract and preserve provider-specific headers (llm_provider-*) when
handling error responses from LLM providers. This ensures that useful
debugging information from providers is available even when requests
fail with BadRequestError or similar exceptions.
2026-01-14 22:49:39 +05:30
Kris Xia
1391e41916
fix(vertex_ai): improve passthrough endpoint url parsing and construction (#17402) (#17526)
* fix(vertex_ai): improve passthrough endpoint url parsing and construction (#17402)

* test(proxy): add test for vertex passthrough load balancing

Add a test that verifies _base_vertex_proxy_route uses
get_available_deployment for proper load balancing instead of
get_model_list. This ensures the correct deployment is selected
from the router and vertex credentials are properly fetched.

Also refactor the implementation to:
- Use get_available_deployment instead of get_model_list
- Add error handling for deployment retrieval
- Improve code structure with try-except block

* feat(proxy): add pass-through deployment filtering methods

Add dedicated methods to filter and select deployments for pass-through endpoints:
- Implement get_available_deployment_for_pass_through() to ensure only deployments with use_in_pass_through=True are considered
- Implement async_get_available_deployment_for_pass_through() for async operations
- Add _filter_pass_through_deployments() helper method to filter by use_in_pass_through flag
- Update vertex pass-through route to use the new dedicated method

This ensures pass-through endpoints respect the use_in_pass_through configuration and apply proper load balancing strategy only to configured deployments.

Add comprehensive tests to verify filtering and load balancing behavior.
2026-01-14 22:17:43 +05:30
Harshit Jain
e8c4cad885
feat(proxy): cleanup spend logs cron verification, fix, and docs (#19085) 2026-01-14 22:14:48 +05:30
Sameer Kankute
cd2d381dd4
Merge pull request #19042 from BerriAI/litellm_staging_01_13_2026
Staging 01/13/2026
2026-01-14 21:29:09 +05:30
Sameer Kankute
26d8ef734c
Merge pull request #19070 from BerriAI/litellm_19066-bug-gemini-image-generation-returns-incorrect-prompt_tokens_details
Fix: [Bug]: Gemini Image Generation Returns Incorrect prompt_tokens_d…
2026-01-14 17:55:09 +05:30
Sameer Kankute
49d873e894
Merge pull request #19067 from BerriAI/litellm_caching_fix
Fix: anthropic token counter with thinking
2026-01-14 17:52:56 +05:30