Commit graph

13596 commits

Author SHA1 Message Date
Jugal D. Bhatt
8d35a00974
[LLM Translation] Added model name formats (#12745)
* Added model supports

* invert logic

* Added gpt 35 turbo check

* add test check

* fix ruff check
2025-07-18 17:08:35 -07:00
Jugal D. Bhatt
be60d12ff7
[LLM Translation - Redis] fix: redis caching for embedding response models (#12750)
* fix: redis caching for embedding responses

* add helper

* add mypy fixes

* lint fix

* review changes

* remove file

* fix ruff

* add if check

* add if check
2025-07-18 16:31:10 -07:00
Jugal D. Bhatt
c3c6255689
[LLM Translation] Change System prompts to assistant prompts as a workaround for GH Copilot (#12742)
* add changes for copilot

* Add test

* reverse flag settings

* add settings

* utils changes

* fix tests
2025-07-18 15:48:27 -07:00
Cole McIntosh
d4f5180212
fix(lowest_latency.py): Handle ZeroDivisionError with zero completion tokens (#12734)
* fix(lowest_latency.py): Handle ZeroDivisionError with zero completion tokens (#12641)

Fixes ZeroDivisionError when LLM responses have zero completion tokens, which can
occur with Gemini models on very long contexts that only use tool calls.

Changes:
- Add check for completion_tokens > 0 before division in log_success_event
- Handle both timedelta and float types for response times (supporting both time.time() and datetime)
- Apply fix to both occurrences of the division operation in the file
- Add comprehensive tests for zero completion token scenarios

This ensures the lowest latency routing continues to work properly even when
models return responses with no completion tokens.

* test: Move lowest_latency zero tokens test to test_litellm for CI execution

* refactor: Use safe_divide helper to eliminate code duplication

- Added safe_divide utility function to litellm_core_utils.core_helpers
- Handles both timedelta and float types for numerator
- Prevents ZeroDivisionError and negative denominator issues
- Replaced duplicated division logic in lowest_latency.py
- Added comprehensive unit tests for safe_divide function

This improves code quality by reducing duplication and centralizing the
division safety logic in a reusable helper function.

* refactor: Rename to safe_divide_seconds for clarity

- Renamed safe_divide to safe_divide_seconds to better indicate it handles time durations
- Simplified implementation with single-line ternary for seconds conversion
- Updated all references and tests accordingly

The function name now clearly indicates it's specifically for dividing
time durations (in seconds) by a denominator.

* refactor: Simplify safe_divide_seconds to only accept float arguments

- Changed safe_divide_seconds to accept only float parameters for consistency
- Callers now handle timedelta to seconds conversion explicitly
- Removed timedelta-specific test cases

* fix: Remove unused timedelta import

* fix: Remove Union[timedelta, float] type annotations

Since safe_divide_seconds now only accepts floats, we handle the
timedelta conversion explicitly in the code. The type annotations
are no longer needed and can be simplified.

* Revert "fix: Remove Union[timedelta, float] type annotations"

This reverts commit 19c6c62154.

* fix: Clean up implementation

- Remove unnecessary type annotations
- Use safe_divide_seconds utility for zero-division protection
- Handle both timedelta and float types explicitly
- Maintain compatibility with both datetime and time.time() usage
2025-07-18 15:19:47 -07:00
Ryan Richard
474ac2dd6a
add project_id from auth metadata to credentials cache if a user does not specify a project_id (#12661)
add unit tests for new cached credentials with project_id

Co-authored-by: Ryan Richard <ryanirichard07@gmail.com>
2025-07-18 13:33:09 -07:00
Cole McIntosh
506dc80b15
feat: integrate Google Cloud Model Armor guardrails (#12492)
* feat: integrate Google Cloud Model Armor guardrails (LIT-298)

- Add ModelArmorGuardrail class that extends CustomGuardrail and VertexBase
- Support for both pre-call (sanitizeUserPrompt) and post-call (sanitizeModelResponse) sanitization
- Integrate with existing Vertex AI authentication using VertexBase
- Add configuration model for Model Armor in guardrail types
- Register Model Armor in guardrail initializers and registry
- Include comprehensive test suite for Model Armor functionality
- Support content masking for both requests and responses
- Handle streaming responses with content sanitization

This integration allows LiteLLM to use Google Cloud Model Armor API for
content moderation and sanitization, providing similar functionality to
Bedrock Guards but using Google Cloud's security infrastructure.

* fix: remove unused imports flagged by ruff linter

- Remove unused asyncio import at top level (moved to local import where needed)
- Remove unused TextCompletionResponse import

* fix: remove additional unused imports

- Remove unused TextChoices import from line 34
- Remove duplicate asyncio import from line 384
- Replace asyncio.iscoroutine() with hasattr check for __await__

* fix: remove final unused imports

- Remove unused 'import sys' from line 9
- Remove unused 'StreamingChoices' from imports

* fix: remove unused import from model_armor.py

- Remove unused 'import os' from the top of the file

* fix: remove commented-out header from model_armor.py

- Eliminate unnecessary comments at the top of the file to improve code clarity.

* feat(guardrails): Add Model Armor UI support

- Convert model_armor.py to a directory structure with __init__.py for dynamic discovery
- Add get_config_model() method to ModelArmorGuardrail class for UI integration
- Add ui_friendly_name() to ModelArmorConfigModel returning "Google Cloud Model Armor"
- Remove manual registration from guardrail_registry.py to use dynamic discovery
- Model Armor now appears in the UI guardrails dropdown with proper configuration fields

This enables users to configure Model Armor guardrails through the LiteLLM UI interface.

* fix(guardrails): Fix undefined name 'GuardrailConfigModel' in Model Armor

- Import TYPE_CHECKING and GuardrailConfigModel from base module
- Fixes F821 linting error for undefined name in type annotation
- Follows same pattern as other guardrail implementations

* fix(guardrails): Fix Model Armor type errors and config model inheritance

- Create ModelArmorGuardrailConfigModel that properly inherits from GuardrailConfigModel base class
- Move config model to litellm/types/proxy/guardrails/guardrail_hooks/model_armor.py following convention
- Update get_config_model() to return the properly typed config model
- Remove ModelArmorConfigModel from LitellmParams inheritance chain
- Add template_id field to BaseLitellmParams instead

This fixes the mypy type errors and follows the same pattern as other guardrail implementations.

* fix(guardrails): Add missing Model Armor fields to BaseLitellmParams

- Add location, credentials, api_endpoint, and fail_on_error fields
- Fixes mypy errors about missing attributes in LitellmParams
- All Model Armor configuration parameters are now properly defined

* fix: Apply PR review feedback for Model Armor guardrail

- Move test file to tests/test_litellm/ for GitHub Actions
- Extract only last consecutive user messages to avoid context limits
- Use get_content_from_model_response helper for response extraction
- Handle non-ModelResponse types (e.g., TTS) gracefully
- Maintain newline separation for multi-part content

* refactor: Simplify message content extraction in ModelArmorGuardrail

- Removed the custom _extract_content_from_messages method.
- Integrated get_last_user_message helper for improved content extraction.
- Updated test to reflect changes in content formatting.

* refactor: Remove unused import in model_armor.py

- Deleted the unused import of AllMessageValues to clean up the codebase.

* Add unit tests for Model Armor guardrail functionality

- Implement tests for pre-call and post-call hooks, including content sanitization and blocking behavior.
- Validate error handling for API responses and credential management.
- Test streaming responses and handling of list content in user messages.
- Ensure proper assertions for API interactions and response sanitization.

* Add comprehensive test coverage for Model Armor guardrail

- Add test for requests with no messages field
- Add test for empty message content handling
- Add test for system/assistant-only messages
- Add test for fail_on_error=False behavior
- Add test for custom API endpoint configuration
- Add test for dictionary credentials (non-file path)
- Add test for action=NONE response handling
- Add test for missing sanitized_text field fallback
- Add test for non-text response types (TTS/image)
- Add test for auth token refresh behavior

All tests ensure robust edge case handling and proper error management.

* feat: improve Model Armor handling of non-ModelResponse types

- Add debug logging when skipping non-text responses (TTS, images, etc.)
- Improve docstring to clarify behavior for non-text responses
- Add test coverage for non-ModelResponse handling
- Ensure guardrail gracefully skips processing for response types it cannot handle
2025-07-18 12:51:09 -07:00
Jugal D. Bhatt
a46b9d376f
[Prometheus] Move Prometheus to enterprise folder (#12659)
* fix tools fetch for keys

* add promethues to enterprise

* remove old prom

* remove old prom

* fix tests

* safe imports

* add if

* fix enterprise test

* rename imports

* added label import

* added label import

* move tests to enterprise

* fix tests

* add log

* build: update versions

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
2025-07-18 11:54:47 -07:00
Krish Dholakia
5004b915d1
Guardrails AI - support llmOutput based guardrails as pre-call hooks (#12674)
* build: move build_and_test to use prisma migrate

* fix(guardrails_ai.py): default to guardrail accepting 'llmOutput' as the input param

enables same guardrail to work for pre call and post call

* fix(__init__.py): set default value

* fix(guardrails_ai.py): updates

* fix: fix linting error
2025-07-18 11:31:30 -07:00
Jugal D. Bhatt
a112ec5b02
Health check app on separate port (#12718)
* add separate health app

* add new docs

* refactor

* fix colons

* Update config_settings.md

* refactor

* docs

* add unit test

* added supervisord

* remove app

* add supervisor conf

* Add markdown

* add video to md

* remove test

* docs build failure

* add to all docker files, change prod.md and add tests

* change dockerfiles

* remove extra file

* remove extra file

* remove extra file

* change apt->apk

* remove rdb file

* add fixed file
2025-07-18 11:17:15 -07:00
Krish Dholakia
f6f3f151f1
Anthropic - add tool cache control support (#12668)
* fix(prompt_templates/factory.py): handle anthropic cache control on individual tool results

Fixes issue where cache control on individual tool result was being ignored

* test(test_vertex_And_google_ai_studio_gemini.py): initial unit test covering translation for grounding metadata on streaming chunk
2025-07-18 11:14:03 -07:00
Krish Dholakia
60c7537cc7
/streamGenerateContent - non-gemini model support (#12647)
* fix(google_genai/adapters/transformation.py): enable calling non-googlegenai models via streaming

Fixes https://github.com/BerriAI/litellm/issues/12562

* test(test_openai.py): add unit test asserting streaming works as expected
2025-07-18 10:56:29 -07:00
Jugal D. Bhatt
7c49197f29
Add Hosted VLLM rerank provider integration (#12738)
* Vllm rerank (#12737)

* Add Hosted VLLM rerank provider integration

This commit implements the Hosted VLLM rerank provider integration for LiteLLM. The integration includes:
Adding Hosted VLLM as a supported rerank provider in the main rerank function
Implementing the HostedVLLMRerank handler class for making API requests
Creating a transformation class to convert Hosted VLLM responses to LiteLLM's standardized format
The integration supports both synchronous and asynchronous rerank operations. API credentials can be provided directly or through environment variables (HOSTED_VLLM_API_KEY and HOSTED_VLLM_API_BASE).
Notable features:
Proper error handling for missing credentials
Standard response transformation
Support for common rerank parameters (top_n, return_documents, etc.)
Proper token usage tracking
This expands LiteLLM's rerank provider ecosystem to include Hosted VLLM alongside existing providers like Cohere, Together AI, Azure AI, and Bedrock.

* refactor(rerank): use base_llm_http_handler for hosted_vllm rerank

- Replace custom HostedVLLMRerank handler with base_llm_http_handler
- Implement proper HostedVLLMRerankConfig inheriting from BaseRerankConfig
- Follow Cohere-compatible implementation pattern
- Clean up unnecessary comments

* Fix lint errors in hosted_vllm rerank transformer: remove unused imports

* Fix linting errors in rerank transformation modules

* fix: resolve type errors in Hosted VLLM rerank module

---------

Co-authored-by: Philip D'Souza <philip.dsouza@macro4.com>
Co-authored-by: Philip D'Souza <philip.a.dsouza@gmail.com>

* added a few tests

---------

Co-authored-by: Philip D'Souza <philip.dsouza@macro4.com>
Co-authored-by: Philip D'Souza <philip.a.dsouza@gmail.com>
2025-07-18 10:55:50 -07:00
Ishaan Jaff
d227085e03
[Bug fix] s3 v2 log uploader crashes when using with guardrails (#12733)
* fix - use safe dumps for s3 v2

* TestS3V2UnitTests

* fix code qa check
2025-07-18 08:57:07 -07:00
Ishaan Jaff
3051a9c68a
[Bug Fix] QA - Use PG Vector Vector Store with LiteLLM (#12716)
* store in generic litellm params

* handle storing litellm_params_json

* add litellm_params

* update file loc

* fix startup issue

* ui fix litellm_params

* fix typing

* fix adding PG Vector

* use litellm params

* fix transform_search_vector_store_request

* fix transform

* fix URL

* test fix

* test_pg_vector_search_request_construction
2025-07-18 08:41:18 -07:00
Cole McIntosh
491555d32d
fix(test_team_endpoints.py): fix AsyncMock error in test_new_team_with_object_permission (#12730)
Replace MagicMock with AsyncMock for litellm_teamtable.update to fix:
TypeError: object MagicMock can't be used in 'await' expression

The test was failing because it tried to await a MagicMock object.
Added AsyncMock for the update method to properly handle async operations.
2025-07-18 07:25:16 -07:00
Krish Dholakia
b77c9f5de2
fix(team_endpoints.py): ensure user id correctly added when new team … (#12719)
* fix(team_endpoints.py): ensure user id correctly added when new team created with user email as member

Fixes issue where user not correctly added to team on /team/new

* fix(internal_user_endpoints.py): make user email validation check case insensitive

Fixes issue where uppercase email was added even when lowercase email existed

* test: update test
2025-07-17 22:31:44 -07:00
Krish Dholakia
b515d051ff
Litellm encrypt admin UI values (#12675)
* build: move build_and_test to use prisma migrate

* feat(proxy_setting_endpoints.py): encrypt env var before storing in db

Ensures env var can be read when loaded in from DB

Fixes issue when trying to add SSO from admin UI

* test: update tests
2025-07-17 22:24:58 -07:00
Ishaan Jaff
33c84846e9
[Refactor] Vector Stores - Use class VectorStorePreCallHook for all Vector Store Integrations (#12715)
* add VectorStorePreCallHook

* vector_store_pre_call_hook

* add pop_vector_stores_to_run

* async_get_chat_completion_prompt

* working e2e tests

* test_e2e_bedrock_knowledgebase_retrieval_with_completion

* delete old files

* fix logging test

* VectorStorePreCallHook

* fix ruff check

* vector_store_pre_call_hook

* linting error fixes
2025-07-17 16:31:58 -07:00
Robert Gambee
52b2984792
[Bug Fix] Always include tool calls in output of trim_messages (#11517)
* Check content and order of trimmed messages

* Assert tool calls are preserved if below max_tokens

* Unreverse order of tool calls

* Return tool calls alongside other messages

* Write test for trimming untokenizable field

* Return original messages in case of exception
2025-07-17 16:01:59 -07:00
Ishaan Jaff
37b6814400
[Refactor] Use Existing config structure for bedrock vector stores (#12672)
* add transform_search_vector_store_request

* add BedrockVectorStoreConfig

* unit tests

* TestBedrockVectorStore
2025-07-17 11:55:11 -07:00
Ishaan Jaff
52a525ab9c
[Feat] Bedrock Guardrails - Allow disabling exception on 'BLOCKED' action (#12693)
* flag: disable_exception_on_block

* allow setting disable_exception_on_block

* test_bedrock_guardrail_disable_exception_on_block_non_streaming

* docs Disabling Exceptions on Bedrock BLOCK

* fix recognition_metadata test
2025-07-17 08:46:33 -07:00
Jugal D. Bhatt
4b09d0d517
[Liveness/Liveliness probe] add separate health app for liveness probes in files (#12669)
* add separate health app

* add new docs

* refactor

* fix colons

* Update config_settings.md

* refactor

* docs

* add unit test
2025-07-16 20:35:09 -07:00
Ishaan Jaff
e5f0a8477b
[Feat] New Vector Store - PG Vector (#12667)
* add PGVectorStoreConfig

* add PGVectorStoreConfig

* test_environment_variable_support

* fix code QA check

* rename test

* add PG vector img

* allow adding vector stores

* add pg vector

* add vector store

* TestPGVectorStoreConfig

* TestPGVectorStoreConfig
2025-07-16 18:17:05 -07:00
Cole McIntosh
b2080ec9af
feat: add input_fidelity parameter for OpenAI image generation (#12662)
* feat: add input_fidelity parameter for OpenAI image generation

- Add input_fidelity to OpenAIImageGenerationOptionalParams type
- Update image_generation function signature to accept input_fidelity
- Add input_fidelity to default_params in get_optional_params_image_gen
- Include input_fidelity in openai_params list for proper handling
- Update documentation with input_fidelity parameter description
- Add test for input_fidelity parameter functionality

This enables control over how closely the model follows the input prompt
for gpt-image-1 model, improving prompt adherence and image quality.

* feat: add input_fidelity to optional parameters for image generation

- Include input_fidelity in the list of OpenAIImageGenerationOptionalParams
- This addition enhances the flexibility of image generation by allowing control over input fidelity.

* test: enhance test for gpt-image-1 with input_fidelity parameter

- Update test_gpt_image_1_with_input_fidelity to include mocking of OpenAI response
- Validate that the OpenAI client is called with correct parameters, including input_fidelity
- Improve response validation to ensure expected output structure and values
2025-07-16 16:56:05 -07:00
Ishaan Jaff
d9943f9812 fix cohere InternalServerError error mapping 2025-07-16 16:13:34 -07:00
Ishaan Jaff
0141ef924f test_create_mcp_server_invalid_alias 2025-07-16 15:58:34 -07:00
Ishaan Jaff
43e7d5288f
[Bug Fix] SCIM - add GET /ServiceProviderConfig (#12664)
* add scimv2 config endpoint

* test_get_service_provider_config
2025-07-16 15:43:25 -07:00
Ishaan Jaff
6a7aab7b84
[Bug Fix] StandardLoggingPayload on cache_hits should track custom llm provider + DD LLM Obs span type (#12652)
* bug fix - ensure custom llm provider is tracked on cache hit

* fix config.yaml

* test_cache_hit_includes_custom_llm_provider

* fix _get_datadog_span_kind

* test_datadog_span_kind_mapping

* fix ruff check

* test_datadog_span_kind_mapping
2025-07-16 15:43:15 -07:00
Ishaan Jaff
9b817b511e
[Feat] Allow reading custom logger python scripts from s3 (#12623)
* add _load_instance_from_remote_storage

* load from s3

* fix download_python_file_from_s3

* fix download_python_file_from_s3

* add _load_instance_from_remote_storage

* tests

* Step 2b - Loading Custom Callbacks

* docs

* fix code qa check
2025-07-16 15:07:01 -07:00
Jugal D. Bhatt
83b0c4cba7
[MCP Gateway] Allow MCP sse and http to have namespaced url for better segregation LIT-304 (#12658)
* fix tools fetch for keys

* Add namespacing in url

* add test for namespacing url

* helper method

* fix test
2025-07-16 14:47:45 -07:00
Jugal D. Bhatt
a7d0b122b9
[MCP Gateway] List tools from access list for keys (#12657)
* fix tools fetch for keys

* add unit test
2025-07-16 14:28:53 -07:00
Jugal D. Bhatt
b3a214bce7
[MCP Gateway] Allow MCP access groups to be added via the config LIT-312 (#12654)
* allow mcp access groups to be added via the config

* fix code and doc quality

* fix mypy

* create helpers:
2025-07-16 13:57:43 -07:00
Krrish Dholakia
8a1a90bc7a test: update test 2025-07-16 10:28:08 -07:00
Krrish Dholakia
f4131b023e fix: don't fail request if unmapped item in responses list
not every responses item has a 1:1 mapping with chat completions
2025-07-16 09:25:26 -07:00
Ishaan Jaff
e8a748161f
[Bug Fix] grok-4 does not support the stop param (#12646)
* bug fix - using stop reason with grok 4

* fixes for XAI stop params

* test_xai_grok_4_stop_not_supported

* test_xai_grok_4_stop_not_supported
2025-07-16 09:19:25 -07:00
Krrish Dholakia
604075a36c test: update test 2025-07-16 09:15:05 -07:00
Krrish Dholakia
9cac629ca6 test: update test 2025-07-16 09:13:16 -07:00
Krrish Dholakia
5a8762b6a1 test: update tests 2025-07-16 08:56:41 -07:00
Cole McIntosh
79e4d77bcf
fix: Handle circular references in spend tracking metadata JSON serialization (#12643)
* fix: Handle circular references in spend tracking metadata JSON serialization

- Fixes issue #12634 where circular references in metadata caused
  ValueError: Circular reference detected when logging spend data
- Adds _safe_json_dumps() function that detects and handles circular
  references by replacing them with placeholder strings
- Maintains full functionality for normal objects while preventing
  crashes from circular references
- Adds comprehensive tests for circular reference handling
- Critical fix for v1.74.3 stable release

* fix: Replace bare except clauses with specific Exception handling

- Fixes E722 linting errors in _safe_json_dumps function
- Maintains same error handling behavior while following best practices
- All tests continue to pass

* refactor: Use existing safe_dumps utility instead of custom implementation

- Replace custom _safe_json_dumps() with existing safe_dumps() from litellm_core_utils
- Remove duplicate code and leverage existing circular reference handling
- Update tests to use safe_dumps function
- Maintains same functionality while reducing code duplication
- All tests continue to pass
2025-07-16 07:24:41 -07:00
Krish Dholakia
1ce3558f96
fix(transformation.py): allows passing native responses api tools like web_search_preview, and mcp via .completion() (#12627)
Closes https://github.com/BerriAI/litellm/issues/12105
2025-07-15 22:45:42 -07:00
Krish Dholakia
955b504f7b
fix(proxy_server.py): fixes for handling team only models via `/v2/mo… (#12632)
* fix(proxy_server.py): fixes for handling team only models via `/v2/model/info`

ensures team only models show up on the correct team on `Models + Endpoints`

* test: update tests
2025-07-15 22:36:05 -07:00
Krish Dholakia
3ad4d9fc3e
fix(router.py): use more descriptive error message (#12629)
* fix(router.py): use more descriptive error message

* fix(proxy/_types.py): note `/team/member_update` is a self-managed route

route has it's own logic for rbac - enables team admins to update member permissions

Fixes issue where team admins on UI could not update member permissions

* fix(token_counter.py): move log line to being '.debug' instead of '.error'

Fixes https://github.com/BerriAI/litellm/issues/12269
2025-07-15 22:34:20 -07:00
Krrish Dholakia
85fe1d35e1 test: update test, remove old gemini models 2025-07-15 22:31:49 -07:00
Ishaan Jaff
84261f3ac8 test_create_delete_assistants 2025-07-15 21:35:25 -07:00
Ishaan Jaff
d8327b4740
[Bug Fix] [Bug]: Knowledge Base Call returning error (#12628)
* bug fix using vector stores as tools

* test_e2e_bedrock_knowledgebase_retrieval_with_llm_api_call_with_tools
2025-07-15 21:33:49 -07:00
yeahyung
782969bb05
(#11794) use upsert for managed object table rather than create to avoid UniqueViolationError (#11795)
* (#11794) use upsert for managed object table rather than create to avoid UniqueViolationError

* (#11794) use upsert for managed object table rather than create to avoid UniqueViolationError
2025-07-15 20:20:01 -07:00
Richard Tweed
197e7efa8f
fix: role chaining with webauthentication for aws bedrock (#12607)
* fix(bedrock): auto-generate session name when only aws_role_name is provided

Fixes #12583 - AWS role assumption not working correctly when aws_role_name
is provided without aws_session_name.

Previously, if only aws_role_name was provided in the config without
aws_session_name, the code would fall back to using environment credentials
instead of assuming the specified role. This was problematic in EKS/IRSA
environments where users want to assume a different role.

The fix:
- When aws_role_name is provided without aws_session_name, we now
  auto-generate a session name with format 'litellm-session-{timestamp}'
- This ensures role assumption happens as expected
- Added comprehensive test coverage for this scenario

* style: format test file with black

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2025-07-15 20:17:09 -07:00
Marc Abramowitz
40ccd2b70f
Add "keys import" command to CLI (#12620)
* Add "keys import" command to CLI

E.g.:

```
litellm-proxy keys import \
  --source-base-url=https://old-litellm.company.com \
  --source-api-key=$LITELLM_KEY \
  --dry-run
```

* Add --created-since option

* Add tests

* Fix lint errors

* Fix lint issues

* Fix lint errors

* Fix response.raise_for_status not being a thing

* Fix a mypy error
2025-07-15 20:14:43 -07:00
Ishaan Jaff
2d6751a396
[Feat] MCP Gateway - allow using MCPs with all LLM APIs when using /responses with LiteLLM (#12546)
* add MCPResponsesAPIHelper

* rename LiteLLM_Proxy_MCP_Handler

* aresponses_api_with_mcp

* mock_responses_api_response

* test response with litellm proxy MCP

* add _should_use_litellm_mcp_gateway

* fix transform_mcp_tool_to_openai_responses_api_tool

* use correct _transform_mcp_tools_to_openai

* fix config.yaml

* fixes for native MCP handling

* docs MCP with litellm proxy

* aresponses_api_with_mcp

* fix linting

* fix mypy

* fix linting

* test_aresponses_api_with_mcp_mock_integration

* docs How it works when server_url="litellm_proxy"
2025-07-15 14:06:31 -07:00
Ishaan Jaff
46c950b17b
[Bug Fix] Add swagger docs for LiteLLM /chat/completions, /embeddings, /responses (#12618)
* update ProxyChatCompletionRequest

* use custom OpenAPI schema

* use customize_openapi_schema

* add_llm_api_request_schema_body

* add embeddings and response spec

* fix add_llm_api_request_schema_body

* TestCustomOpenAPISpec

* fixes linting

* fix linting

* bump timeout
2025-07-15 13:37:22 -07:00