Commit Graph
4816 Commits
Author SHA1 Message Date
yuneng-jiangandGitHub 9faee8bba6 Merge pull request #17989 from Jetemple/non-root-ui-path-fix
fix: update UI path handling for non-root Docker and restructure HTML…
2025-12-16 21:57:31 -08:00
yuneng-jiangandGitHub f316caa088 Merge pull request #18033 from BerriAI/litellm_ui_logs_overhead
[Feature] Add LiteLLM Overhead to Logs
2025-12-16 14:51:50 -08:00
Jorge Yero SalazarandGitHub 48a3a741e5 Allow base_model for non Azure providers in proxy (#18038)
* Allow base_model for non Azure providers in proxy

* Add tests
2025-12-17 02:24:12 +04:00
Ishaan JaffandGitHub c727c8216f [Feat] New Endpoint - Google Interactions API - added on litellm SDK (#18079)
* init BaseInteractionsAPIConfig

* updated types for interactions API

* fix SDK level interactions API

* InteractionsAPIRequestUtils

* init base

* init interactions API

* init Interactions API Types

* init interactins API

* GoogleAIStudioInteractionsConfig

* init http handler

* remove file no longer needed

* test OPENAPI_SPEC_URL

* TestGoogleInteractionsCreate
2025-12-17 02:18:51 +04:00
yuneng-jiang c2f79681b6 Fixing test 2 2025-12-16 13:44:53 -08:00
yuneng-jiang 0e5b56eddf Fixing tests 2025-12-16 12:51:44 -08:00
Alexsander HamirandGitHub 80d445a96f feat: lazy load GuardrailItem following existing patterns (#18072)
- Add TYPES_NAMES tuple and _lazy_import_types function in _lazy_imports.py
- Remove direct import of GuardrailItem from __init__.py
- Add lazy loading handler in __getattr__ to dispatch type imports
- Add type stub for GuardrailItem in TYPE_CHECKING block
- Add test_types_lazy_imports test to verify lazy loading works
- Use from __future__ import annotations for forward reference support
- Follows same pattern as DOTPROMPT_NAMES and LLM_CONFIG_NAMES for consistency
2025-12-16 11:48:36 -08:00
Alexsander HamirandGitHub 014c74fd06 [Refactor] litellm/init.py: lazy-load AmazonConverseConfig (#18069)
- Add LLM_CONFIG_NAMES tuple and _lazy_import_llm_configs function in _lazy_imports.py
- Remove direct import of AmazonConverseConfig from __init__.py
- Add lazy loading handler in __getattr__ to dispatch LLM config imports
- Add type stub for AmazonConverseConfig in TYPE_CHECKING block
- Add test_llm_config_lazy_imports test to verify lazy loading works
- Follows same pattern as DOTPROMPT_NAMES for consistency
2025-12-16 10:48:11 -08:00
Sameer KankuteandGitHub 2b495f84ab Merge pull request #18025 from BerriAI/litellm_staging_12_16_2025
Litellm staging 12 16 2025
2025-12-16 22:31:39 +05:30
Sameer KankuteandGitHub 3661f8010f Revert "fix(proxy): extract model from vertex ai passthrough url pattern (#17…"
This reverts commit ae7c994526.
2025-12-16 21:44:10 +05:30
Sameer KankuteandGitHub 20bdada900 Merge pull request #18046 from BerriAI/litellm_fix_managed_files_endpoint
Fix managed files endpoint
2025-12-16 21:39:34 +05:30
Sameer KankuteandGitHub 8864c6937c Merge pull request #18031 from BerriAI/litellm_anthropic_claude_skills_int
Add support for agent skills in chat completion
2025-12-16 21:39:11 +05:30
Sameer KankuteandGitHub 215857cce3 Merge branch 'main' into litellm_staging_12_16_2025 2025-12-16 21:38:14 +05:30
Sameer KankuteandGitHub fc5c5d4dbe Merge pull request #18042 from BerriAI/litellm_embedding_default_omit
fix: Add none to encoding_format instead of omitting it
2025-12-16 21:35:29 +05:30
Sameer KankuteandGitHub abfa869030 Merge pull request #18049 from BerriAI/litellm_bedrock_ttl_issue
Remove ttl field when routing to bedrock
2025-12-16 21:34:57 +05:30
Sameer KankuteandGitHub 616417eaaa Merge pull request #18037 from BerriAI/litellm_fix_vertex_ai_headers
fix: skip adding beta headers for vertex ai as it is not suppported
2025-12-16 21:33:35 +05:30
Sameer KankuteandGitHub de5471e3cd Merge pull request #18036 from BerriAI/litellm_fix_responses_headers
Add custom headers in responses API
2025-12-16 21:30:59 +05:30
Alexsander HamirandGitHub f8168f5063 [Refactor] litellm/init.py: lazy load dotprompt integration (#18056) 2025-12-16 07:18:11 -08:00
Alexsander HamirandGitHub feb6924efe [Refactor] litellm/init.py: lazy load .types.utils (#18054) 2025-12-16 06:42:17 -08:00
Alexsander HamirandGitHub ea06fb70fb refactor: lazy load bedrock types (#18053) 2025-12-16 06:05:01 -08:00
Alexsander HamirandGitHub 6ca812130b [Refactor] litellm/init.py: lazy load LLMClientCache (#18008) 2025-12-16 05:44:06 -08:00
Sameer Kankute 6ccfb8b45e Remove ttl fiedl when routing to bedrock 2025-12-16 16:20:19 +05:30
Sameer Kankute 6a3f0a8baf Add output file id in managed objects for batches 2025-12-16 15:52:07 +05:30
Nicolai van der SmagtandGitHub 09ba89d4fe fix: add headers to metadata for guardrails on pass-through endpoints (#17992)
Fixes #17477

Guardrails couldn't access request headers (like User-Agent) on Bedrock
pass-through endpoints because headers were only stored in
data["proxy_server_request"]["headers"] but not in data["metadata"]["headers"]
where guardrails typically look for them.

This fix adds headers to metadata in add_litellm_data_to_request() so
guardrails can access User-Agent, API keys, and other header-based checks
on all endpoints including Bedrock pass-through.

Test added to verify headers are available in metadata for guardrails.
2025-12-16 13:41:34 +05:30
Sameer Kankute dbcae4aca5 fix: Add none to encoding_format instead of omitting it 2025-12-16 13:23:15 +05:30
Sameer Kankute 7a5e49a328 fix: skip adding beta headers for vertex ai as it is not suppported 2025-12-16 11:56:46 +05:30
Sameer Kankute 85907cebb5 Add custom headers in responses API 2025-12-16 11:31:15 +05:30
yuneng-jiang 66306f21b1 Add litellm overhead to spend logs metadata 2025-12-15 20:56:55 -08:00
Sameer Kankute 1222d9e376 Add doc and tests for agent skils 2025-12-16 10:20:21 +05:30
Igal BoxermanandGitHub 636efb7795 feat(pillar): add masking support and MCP call support (#17959)
- Add 'mask' action to SUPPORTED_ON_FLAGGED_ACTIONS
  - Automatically sanitizes sensitive content using masked_session_messages
  - Allows requests to proceed with masked content instead of blocking

- Add MCP call support
  - Add pre_mcp_call and during_mcp_call to supported_event_hooks
  - Verify mcp_call is supported in call_type Literal types

- Control exception details based on config
  - Conditionally include scanners/evidence in exceptions based on
    include_scanners and include_evidence settings
  - Reduces payload size when detailed exception info isn't needed

- Add comprehensive test coverage
  - Tests for masking functionality
  - Tests for conditional exception details
  - Tests for MCP call support

- Update documentation
  - Add Mask section explaining masking functionality
  - Clarify exception details control

All changes maintain backward compatibility.
2025-12-16 08:49:03 +05:30
Ishaan JaffGitHubCopilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
32c07113cf [Feat] New Provider - VertexAI Agent Engine (#18014)
* init A2AProviderConfigManager

* move file

* move file

* add pydnatic ai folder

* init providers

* test_pydantic_ai_non_streaming

* fix import

* INIT pydantic

* use_a2a_form_fields

* test_vertex_agent_engine_streaming

* add agent_engine

* init transform for agent engine

* init agent engine

* VertexAgentEngineSSEStreamIterator

* sample

* ui add new fields

* fix vertex_credentials

* working SSE iterator

* TestVertexAgentEngineTransformRequest

* fix code QA check

* Potential fix for code scanning alert no. 3923: Clear-text logging of sensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-12-15 19:14:49 -08:00
Kris XiaandGitHub ae7c994526 fix(proxy): extract model from vertex ai passthrough url pattern (#17970)
extract model id from vertex ai passthrough routes that follow the pattern:
/vertex_ai/*/models/{model_id}:*

the model extraction now handles vertex ai routes by regex matching the model
segment from the url path, which allows proper model identification for
authentication and authorization in proxy pass-through endpoints.

adds comprehensive test coverage for vertex ai model extraction including:
- various vertex api versions (v1, v1beta1)
- different locations (us-central1, asia-southeast1)
- model names with special suffixes (gemini-1.5-pro, gemini-2.0-flash)
- precedence verification (request body model over url)
- non-vertex route isolation
2025-12-16 08:42:57 +05:30
Krish DholakiaandGitHub f58b76aee8 Revert "Revert "Litellm bedrock guardrails block precedence over masking (#17…" (#18023)
This reverts commit 0abe5cdce9.
2025-12-16 08:42:10 +05:30
Krish DholakiaandGitHub 0abe5cdce9 Revert "Litellm bedrock guardrails block precedence over masking (#17968)" (#18022)
This reverts commit a0754f1c88.
2025-12-16 08:41:36 +05:30
kothamahandGitHub a0754f1c88 Litellm bedrock guardrails block precedence over masking (#17968)
* prioritized bedrock guardrail blocking by removing early return based on masking flags

When mask_request_content: true or mask_response_content: true, the method immediately returning False.

The Result: Even when Bedrock Guardrails returned action: "BLOCKED" for dangerous content, LiteLLM would not raise an exception and allowing the content through the response. 

So removed that early condition which will return true for the blocked actions based on guardrails.

* Added test case for bedrock guardrail block content precedence
2025-12-16 08:41:13 +05:30
Dmitrii KomarovandGitHub df9d3abf49 Propagate token usage when generating images with Gemini (#17987) 2025-12-16 08:20:09 +05:30
DamienandGitHub fc3f82b85a feat(gemini): support extra_headers in batch embeddings (#18004)
* feat(vertex_ai): support extra_headers in batch embeddings

* test(vertex_ai): add Gemini batch embeddings tests for custom api_base
2025-12-16 08:16:09 +05:30
Cesar GarciaandGitHub 999ffabc39 fix(gemini): use JSON instead of form-data for image edit requests (#18012)
* fix(gemini): use JSON instead of form-data for image edit requests

Gemini's image edit API expects JSON body, not multipart/form-data.
The handler was sending form-encoded data which caused 400 errors:
"Invalid JSON payload received. Unexpected token."

Changes:
- Add use_multipart_form_data() method to BaseImageEditConfig (default True)
- Modify image_edit_handler to use json= when use_multipart_form_data() is False
- Override use_multipart_form_data() in GeminiImageEditConfig to return False

* test(gemini): add test for use_multipart_form_data
2025-12-16 07:41:02 +05:30
Cesar GarciaandGitHub 4fdbbdfe6d fix(anthropic): correct claude-3-7-sonnet max_tokens to 64K default (#17979)
Claude 3.7 Sonnet's default max_output_tokens is 64000, not 128000.
The 128K output limit requires the beta header 'output-128k-2025-02-19'.

This fixes the integration test failure where requests with max_tokens=128000
were being rejected by the Anthropic API.

Fixes test_multiturn_tool_calls in test_anthropic_responses_api.py
2025-12-16 07:27:40 +05:30
Ishaan JaffandGitHub a4fb0df028 [Feat] New provider - Agent Gateway, add pydantic ai agents (#18013)
* init A2AProviderConfigManager

* move file

* move file

* add pydnatic ai folder

* init providers

* test_pydantic_ai_non_streaming

* fix import

* INIT pydantic

* use_a2a_form_fields

* TestPydanticAITransformation
2025-12-15 17:40:58 -08:00
YutaSaitoandGitHub 867ac17677 Merge pull request #18010 from BerriAI/litellm_fix_mcp_deepcopy_error
fix: mcp deepcopy error
2025-12-16 07:37:25 +09:00
Cesar GarciaandGitHub df19a747a2 feat(custom_llm): add image_edit and aimage_edit support (#17999)
* feat(custom_llm): add image_edit and aimage_edit support

Add support for image_edit and aimage_edit methods in CustomLLM class,
allowing users to implement custom image editing providers.

Changes:
- Add image_edit() and aimage_edit() methods to CustomLLM base class
- Add custom provider detection in litellm.image_edit() function
- Add tests for sync and async image_edit with custom handlers

* docs: add image_edit to CustomLLM documentation

- Add /v1/images/edits to supported routes
- Add Image Edit section with example
- Update Custom Handler Spec with image_edit methods
2025-12-15 14:16:36 -08:00
Yuta Saito defea8b887 fix: mcp deepcopy error 2025-12-16 07:02:07 +09:00
Alexsander HamirandGitHub 764a31f624 refactor: lazy load get_modified_max_tokens (#18002) 2025-12-15 12:33:01 -08:00
Alexsander HamirandGitHub 8f647dd25b [Refactor] litellm/init.py: lazy load caches (#18001) 2025-12-15 12:13:51 -08:00
Alexsander HamirandGitHub 0629dcfdd5 [Refactor] litellm/init.py: lazy load http handlers (#17997) 2025-12-15 11:50:22 -08:00
Alexsander HamirandGitHub 93b1da7911 [Refactor] lazy imports: Use per-attribute lazy imports and extract shared constants (#17994) 2025-12-15 10:38:54 -08:00
Sameer KankuteandGitHub 5a642c788a Merge pull request #17980 from BerriAI/litellm_add_provider_specific_tools_in_responses
Add provider specific tools support in responses api
2025-12-15 22:53:08 +05:30
Sameer KankuteandGitHub 174ab1fc66 Merge pull request #17967 from BerriAI/litellm_fireworks_ai_reasoning_param_support
Add support for reasoning param for fireworks AI models
2025-12-15 22:04:04 +05:30
Jack Temple 9d420265ef fix: update UI path handling for non-root Docker and restructure HTML files 2025-12-15 10:09:05 -06:00