Commit graph

2435 commits

Author SHA1 Message Date
YutaSaito
12bc66aa5b
Merge pull request #19623 from BerriAI/litellm_fix_completions_mcp_output_ordering
[fix] completions mcp output ordering
2026-01-23 15:56:02 +09:00
Yuta Saito
6a60b3d848 test: completions mcp output test 2026-01-23 15:17:14 +09:00
John Greek
26a2c90818
[Fix] Anthropic models on Azure AI cache pricing (#19532) (#19614) 2026-01-22 20:00:40 -08:00
Ishaan Jaff
c23e4b87dc
[Feat] New LiteLLM Policy engine - create policies to manage guardrails, conditions - permissions per Key, Team (#19612)
* init PolicyMatcher

* TestPolicyMatcherGetMatchingPolicies

* TestPolicyMatcherGetMatchingPolicies

* feat: init PolicyResolver

* init resolver types

* init policy from config

* inint PolicyValidator

* validate policy

* init Architecture Diagram

* test_add_guardrails_from_policy_engine

* init _init_policy_engine

* test updates

* test fixws

* new attachment config

* simplify types

* TestPolicyResolverInheritance

* fix policy resolver

* fix policies

* fix applied policy

* docs fix

* docs fix

* fix linting + QA checks

* fix linting + QA fixes

* test fixes
2026-01-22 19:49:53 -08:00
mpcusack-altos
88f8f49e1d
fix(websearch_interception): filter internal kwargs before follow-up request (#19577)
The websearch interception handler was passing internal flags like
`_websearch_interception_converted_stream` to the follow-up LLM request.
This caused "Extra inputs are not permitted" errors from providers like
Bedrock that use strict Pydantic validation.

Fix: Filter out all kwargs starting with `_websearch_interception` prefix
before making the follow-up anthropic_messages.acreate() call.
2026-01-22 10:42:20 -08:00
Eric Cao
a51835dfcc
Metrics prometheus user team count (#19520)
* add user count and team count prometheus metrics

* rebase

* revert mistaken deletion
2026-01-22 08:17:15 -08:00
Sameer Kankute
842e5b3ad6
Merge pull request #19560 from BerriAI/litellm_bedrock_invoke_structured_output
[Feat] Add support for output formatfor bedrock invoke via v1/messages
2026-01-22 19:44:48 +05:30
Sameer Kankute
c78c878822
Merge pull request #19558 from BerriAI/litellm_gemini_vertexai_mapping
Add custom vertex ai mapping to the output
2026-01-22 19:44:32 +05:30
Sameer Kankute
73715ab417
Merge pull request #19556 from BerriAI/litellm_fix_gemini_batch_jan22
Fix: generation config empty for batch
2026-01-22 19:44:26 +05:30
Sameer Kankute
f312bf23d0 Fix:test_multiple_function_call 2026-01-22 19:34:54 +05:30
Sameer Kankute
991fee056f Fix batch tests 2026-01-22 19:23:32 +05:30
Yuta Saito
8a622c51f5 feat: Add MCP tools response to chat completions 2026-01-22 19:23:32 +05:30
Sameer Kankute
ad1edd38d5
Merge branch 'main' into litellm_staging_01_21_2026 2026-01-22 17:56:40 +05:30
Sameer Kankute
24faca9bcf Add support for output formatfor bedrock invoke via v1/messages 2026-01-22 16:36:03 +05:30
Sameer Kankute
18240662db Add custom vertex ai mapping to the output 2026-01-22 15:18:24 +05:30
Yuta Saito
ed67bf2705 feat: Add MCP tools response to chat completions 2026-01-22 15:32:04 +09:00
Harshit Jain
746414eb9b
Fix/per service ssl override v2 (#19538)
* refactor(ssl): support per-service SSL verification overrides

* add test cases for ssl
2026-01-21 20:10:04 -08:00
davida-ps
7777aeb695
fixing prompt-security's guardrail implementation (#19374)
* Consolidated change

* fix(prompt_security): update message processing to persist sanitized files and filter for API calls

* fix per krrishdholakia suggestion
2026-01-21 20:09:40 -08:00
jay prajapati
363b0cc132
fix(azure): preserve content_policy_violation details for images (#19328) (#19372)
Azure OpenAI Images (DALL·E 3) returns policy violations as a structured payload under body["error"], including inner_error.content_filter_results and revised_prompt.

LiteLLM previously:
- Failed to extract nested error messages (get_error_message only handled body["message"])
- Missed policy violation detection when error strings were generic
- Dropped inner_error details when raising ContentPolicyViolationError

This change:
- Extracts nested Azure error fields (code/type/message + inner_error)
- Detects policy violations via structured error codes
- Passes an OpenAI-style error body + provider_specific_fields to preserve details

Tests:
- python3 -m pytest tests/test_litellm/llms/azure/test_azure_exception_mapping.py
- python3 -m pytest tests/test_litellm/litellm_core_utils/test_exception_mapping_utils.py

Fixes #19328
2026-01-21 20:06:51 -08:00
Ishaan Jaff
d5e912322f
[Fix] VertexAI Pass through - Ensure only anthropic betas are forwarded down to LLM API (#19542)
* fix ALLOWED_VERTEX_AI_PASSTHROUGH_HEADERS

* test_vertex_passthrough_forwards_anthropic_beta_header

* fix test_vertex_passthrough_forwards_anthropic_beta_header

* test_vertex_passthrough_does_not_forward_litellm_auth_token

* fix utils

* Using Anthropic Beta Features on Vertex AI

* test_forward_headers_from_request_x_pass_prefix
2026-01-21 19:12:04 -08:00
yuneng-jiang
6b6785bc4f
Merge pull request #19539 from BerriAI/litellm_models_scope
[Feature] Adding Optional scope Param to /models
2026-01-21 17:41:22 -08:00
yuneng-jiang
c6b157832b
Merge pull request #19296 from BerriAI/litellm_esca_reissue
[Reissue: Fix] /user/new Privilege Escalation
2026-01-21 16:46:34 -08:00
yuneng-jiang
6723b30d03 Adding scope to /models 2026-01-21 16:40:31 -08:00
YutaSaito
4a14a53ae8
Merge pull request #19469 from BerriAI/litellm_feat_mcp_spendlogs
[feat] mcp spendlogs
2026-01-22 05:29:21 +09:00
Ishaan Jaff
5cb5969a26
[Fix] LiteLLM VertexAI Pass through - ensuring incoming headers are forwarded down to target (#19524)
* test_vertex_passthrough_forwards_anthropic_beta_header

* add_incoming_headers
2026-01-21 12:01:33 -08:00
yuneng-jiang
d0e35751a1 Fixing tests and linting 2026-01-21 11:02:39 -08:00
yuneng-jiang
b5a7d2ab34 Paginating model/info endpoint 2026-01-21 10:44:18 -08:00
John Greek
aa4b0e0149
Fix duplicate test_handler.py filenames causing pytest collection errors (#19385) 2026-01-21 08:47:50 -08:00
Sameer Kankute
e758dd0a59
Merge pull request #19472 from BerriAI/litellm_fix_chat_completion_responses_streaming
Fix: tool call streaming in chat completion bridge
2026-01-21 19:15:53 +05:30
Sameer Kankute
b6691baf24
Merge pull request #19482 from BerriAI/litellm_anthropic_max_length
Filter out unsupported fields from JSON schema for Anthropic's output_format API.
2026-01-21 18:57:16 +05:30
Sameer Kankute
d879dcdcef
Revert "Fix/prisma schema permission (#19391)"
This reverts commit 75ee0d126c.
2026-01-21 17:19:32 +05:30
Sameer Kankute
a1aba2ed8d
Merge pull request #19491 from BerriAI/main
merge main 20 1 25
2026-01-21 16:40:48 +05:30
Sameer Kankute
c571a02f3b Filter out unsupported fields from JSON schema for Anthropic's output_format API. 2026-01-21 15:48:22 +05:30
Sameer Kankute
3a0d166eb0 Fix: tool call streaming in chat completino brigde 2026-01-21 12:14:02 +05:30
Yuta Saito
caf5f7f8ae test: add test 2026-01-21 14:51:56 +09:00
Ryne Carbone
15013cec4b
feat(gemini): add file content support in tool results (#19416)
Add support for 'file' and 'input_file' content types in
convert_to_gemini_tool_call_result(). File content in tool
results was previously silently dropped.

Supports base64 data URIs and HTTP URLs, matching the existing
image handling pattern. Enables PDF, audio, video, and other
file types as inline_data for Gemini.
2026-01-20 19:54:12 -08:00
Cesar Garcia
b4ed387d24
fix(vertex_ai): handle reasoning_effort as dict from OpenAI Agents SDK (#19419)
The OpenAI Agents SDK (v0.6.9+) now passes reasoning_effort as a dict
when summary is specified: {"effort": "high", "summary": "auto"}

This change extracts the "effort" value from the dict for Vertex AI,
which only supports thinkingLevel (not summary).

Before: reasoning_effort={"effort": "high"} was silently ignored
After: reasoning_effort={"effort": "high"} correctly maps to thinkingLevel

Fixes #19411
2026-01-20 19:31:25 -08:00
Kamil Jopek
ce722ab763
Make grpc dependency optional (#19447)
* Make grpc optional and document gRPC OTEL setup

* Add tests for missing OTLP gRPC imports
2026-01-20 19:03:52 -08:00
Harshit Jain
b36e704e06
fix: ensure auto-rotation updates existing AWS secret instead of creating new one (#19455) 2026-01-20 18:30:36 -08:00
Ishaan Jaff
ddebdd47bc
[Feat] Add Support for Claude Code Max/OAuth 2 on LiteLLM AI Gateway (#19453)
* fix count_tokens_with_anthropic_api

* remove outdated file

* fix ANTHROPIC_TOKEN_COUNTING_BETA_VERSION

* refactor: get_token_counter

* init test suite for token counter

* init token counters

* fix: fix pyrightI

* fix Code QA issues

* feat: add OAUTH handling ant

* feat: Oauth handling Ant

* test anthopic common utils

* fix code QA

* docs
2026-01-20 17:21:17 -08:00
yuneng-jiang
232ae52b94 attempt test_route_checks fix 2026-01-20 15:55:44 -08:00
Harshit Jain
20323feecc
fix(prompts): fix prompt info lookup and delete using correct IDs (#19358)
* fix(prompts): fix prompt info lookup and delete using correct IDs

* add regression tests cases
2026-01-20 12:28:34 -08:00
Kris Xia
56bf6001e9
Supports setting media_resolution and fps parameters on each video file, when using Gemini video understanding. (#19273)
* feat: add gemini video metadata and detail support

Implement support for video_metadata and enhanced detail parameter
for Gemini 3.0+ models:

- Add video_metadata field to ChatCompletionFileObjectFile type
  - Supports fps, start_offset, and end_offset parameters
  - Properly converts snake_case to camelCase for Gemini API
- Extend detail parameter to support medium and ultra_high levels
  - Maps to MEDIA_RESOLUTION_MEDIUM and MEDIA_RESOLUTION_ULTRA_HIGH
- Update _process_gemini_image to handle video metadata transformation
- Add version gating to only apply features for Gemini 3+ models
- Add comprehensive test coverage (6 new test cases)
  - Test detail parameter with file objects
  - Test video_metadata fields (fps, start_offset, end_offset)
  - Test combined detail + video_metadata usage
  - Test new detail levels (medium, ultra_high)
  - Test version gating (Gemini 1.5 vs 3.0)

Note: video_metadata is only supported for video files but error
handling is delegated to Vertex AI for other media types.

* refactor: rename _process_gemini_image to _process_gemini_media

The function handles multiple media types (images, audio, video, PDF),
not just images. Renamed to better reflect its actual purpose.

- Update function name in transformation.py
- Update all function calls and references
- Update test names and imports to match
- Improve docstring to clarify it handles all media types

* docs: add video metadata and media resolution control documentation

Add comprehensive documentation for Gemini 3+ video processing features:
- Document media resolution control (detail parameter) for images and videos
- Add video_metadata field documentation (fps, start_offset, end_offset)
- Include usage examples with tabs for basic, combined, and proxy scenarios
- Update both Gemini and Vertex AI provider documentation
- Clarify snake_case to camelCase field conversion for Gemini API

Signed-off-by: Kris Xia <xiajiayi0506@gmail.com>

* refactor(gemini): extract metadata application into helper function

Extract duplicated Gemini 3+ media_resolution and video_metadata
application logic from _process_gemini_media into a dedicated
_apply_gemini_3_metadata helper function to improve code maintainability.

---------

Signed-off-by: Kris Xia <xiajiayi0506@gmail.com>
2026-01-20 11:36:55 -08:00
Harshit Jain
75ee0d126c
Fix/prisma schema permission (#19391)
* fix: add prisma permission issue

* Add test case for prisma generate
2026-01-20 09:53:16 -08:00
Sameer Kankute
11dbae85d1
Merge pull request #19390 from BerriAI/litellm_consistent_id_streaming_responses
Fix: ID mismatch between text-start and text-delta
2026-01-20 20:46:34 +05:30
Sameer Kankute
9e1275b76c
Merge branch 'main' into litellm_staging_01_19_2026 2026-01-20 19:19:36 +05:30
Sameer Kankute
a3c1f4758d
Merge branch 'main' into litellm_consistent_id_streaming_responses 2026-01-20 19:02:23 +05:30
Sameer Kankute
e69c12b6db
Merge pull request #19396 from BerriAI/litellm_responses_route_fix
Fix for Prometheus Metric Cardinality Issue with /responses Endpoint
2026-01-20 19:01:18 +05:30
Sameer Kankute
2153db5e64 fix: test_convert_to_bedrock_format_post_call_streaming_hook 2026-01-20 18:27:36 +05:30
Sameer Kankute
f0785d5a51 Fix:test_supported_params_limited_to_docs 2026-01-20 17:26:40 +05:30