Commit Graph
5764 Commits
Author SHA1 Message Date
Sameer Kankute d76fb5932a Add xai websearch params support 2026-01-28 09:54:43 +05:30
mubashir1osmaniandGitHub 9a245031bd feat(hosted_vllm): support thinking parameter in anthropic_messages() and .completion()
feat(hosted_vllm): support `thinking` parameter in `anthropic_messages()` and `.completion()`
2026-01-27 22:13:53 -05:00
yuneng-jiangandGitHub 7109aafe4c Merge pull request #19903 from BerriAI/litellm_ui_model_table_adjustable_col
[Feature] Add sortBy and sortOrder params for /v2/model/info
2026-01-27 17:16:22 -08:00
yuneng-jiang 1581bcf985 add sortBy and sortOrder params for /v2/model/info 2026-01-27 16:54:52 -08:00
Ishaan JaffandGitHub 51339f5ef1 [Feat] RAG API - Add s3_vectors as provider on /vector_store/search API + UI for creating + PDF support for /rag/ingest (#19895)
* init S3VectorsRAGIngestion as a supported ingestion provider for RAG API

* test: TestRAGS3Vectors

* init S3VectorsVectorStoreOptions

* init s3 vectors

* code clean up + QA

* fix: get_credentials

* S3VectorsRAGIngestion

* TestRAGS3Vectors

* docs: AWS S3 Vectors

* add asyncio QA checks

* fix: S3_VECTORS_DEFAULT_DIMENSION

* init ui for bedrock s3 vectors

* fix add /search support for s3_vectors

* init atransform_search_vector_store_request

* feat: S3VectorsVectorStoreConfig

* TestS3VectorsVectorStoreConfig

* atransform_search_vector_store_request

* fix: S3VectorsVectorStoreConfig

* add validation for bucket name etd

* fix UI validation for s3 vector store

* init extract_text_from_pdf

* add pypdf

* fix code QA checks

* fix navbar

* init s3_vector.png

* fix QA code
2026-01-27 16:30:59 -08:00
Ishaan JaffandGitHub fe444f3ed5 [Feat] RAG API - Add support for using s3 Vectors as Vector Store Provider for /rag/ingest (#19888)
* init S3VectorsRAGIngestion as a supported ingestion provider for RAG API

* test: TestRAGS3Vectors

* init S3VectorsVectorStoreOptions

* init s3 vectors

* code clean up + QA

* fix: get_credentials

* S3VectorsRAGIngestion

* TestRAGS3Vectors

* docs: AWS S3 Vectors

* add asyncio QA checks

* fix: S3_VECTORS_DEFAULT_DIMENSION
2026-01-27 14:45:26 -08:00
michelligabrieleandGitHub 7d5439adda fix(bedrock): support tool search header translation for Sonnet 4.5 (#19871)
Extend advanced-tool-use header translation to include Claude Sonnet 4.5
in addition to Opus 4.5 on Bedrock Invoke API.

When Claude Code sends the advanced-tool-use-2025-11-20 header, it now
gets correctly translated to Bedrock-specific headers for both:
- Claude Opus 4.5
- Claude Sonnet 4.5

Headers translated:
- tool-search-tool-2025-10-19
- tool-examples-2025-10-29

Fixes defer_loading validation error on Bedrock with Sonnet 4.5.

Ref: https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool
2026-01-27 12:17:09 -08:00
yuneng-jiangandGitHub 45954155d7 Merge pull request #19799 from BerriAI/litellm_sso_email_casing
[Fix] SSO Email Case Sensitivity
2026-01-27 09:52:03 -08:00
yuneng-jiangandGitHub 50612715a5 Merge pull request #19814 from BerriAI/litellm_team_member_add_fix
[Fix] /team/member_add User Email and ID Verifications
2026-01-27 09:49:01 -08:00
michelligabrieleandGitHub 388b4c90b6 fix(proxy): handle agent parameter in /interactions endpoint (#19866) 2026-01-27 09:34:58 -08:00
michelligabrieleandGitHub fc7a9b4cb0 fix(enterprise): correct error message for DISABLE_ADMIN_ENDPOINTS (#19861)
The error message for DISABLE_ADMIN_ENDPOINTS incorrectly said
"DISABLING LLM API ENDPOINTS is an Enterprise feature" instead of
"DISABLING ADMIN ENDPOINTS is an Enterprise feature".

This was a copy-paste bug from the is_llm_api_route_disabled() function.

Added regression tests to verify both error messages are correct.
2026-01-27 09:34:30 -08:00
Harshit JainandGitHub 0f0b71e6d9 feat: add feature to make silent calls (#19544)
* feat: add feature to make silent calls

* add test or silent feat

* add docs for silent feat

* fix lint issues and  UI logs

* add docs of ab testing and deep copy
2026-01-27 09:16:53 -08:00
Sameer KankuteandGitHub 5c1588e3b7 Merge pull request #19841 from BerriAI/litellm_bedrock_tool_search_header
Translate advanced-tool-use to Bedrock-specific headers for Claude Opus 4.5
2026-01-27 17:48:51 +05:30
Sameer KankuteandGitHub 8565a9f5a2 Merge pull request #19847 from BerriAI/litellm_image_streaming_download
Fix: Stream the download in chunks for image handling
2026-01-27 17:47:35 +05:30
Sameer KankuteandGitHub 29fc4f8f61 Merge pull request #19850 from BerriAI/litellm_grok_reasonnig_support
Add grok reasoning content
2026-01-27 17:46:07 +05:30
Sameer KankuteandGitHub 0214cb04cd Merge branch 'main' into litellm_oss_staging_01_26_2026 2026-01-27 17:00:58 +05:30
Sameer KankuteandGitHub adf6d7e1db Merge pull request #19692 from BerriAI/litellm_oss_staging_01_24_2026
Litellm oss staging 01 24 2026
2026-01-27 16:59:28 +05:30
Sameer KankuteandGitHub 9a2750f8ec Merge pull request #19617 from BerriAI/litellm_oss_staging_01_23_2026
Litellm oss staging 01 23 2026
2026-01-27 16:55:32 +05:30
Sameer Kankute e695cb5367 Add grok reasoning content 2026-01-27 16:34:57 +05:30
Sameer Kankute 988dd2a911 Fix: Stream the download in chunks 2026-01-27 14:35:54 +05:30
Sameer Kankute 3f32562587 Translate advanced-tool-use to Bedrock-specific headers for Claude Opus 4.5 2026-01-27 11:20:16 +05:30
yuneng-jiang 7307992cea fixing tests 2026-01-26 20:17:53 -08:00
yuneng-jiang ef7261d0eb Fixing tests 2026-01-26 20:07:30 -08:00
yuneng-jiang b10f71d583 fixing breaking change: just user_id provided should upsert still 2026-01-26 18:10:51 -08:00
Alexsander HamirandGitHub f95572e3ed Fix broken mocks in 6 flaky tests to prevent real API calls (#19829)
* Fix broken mocks in 6 flaky tests to prevent real API calls

Added network-level HTTP blocking using respx to prevent tests from making real API calls when Python-level mocks fail. This makes tests more reliable and retryable in CI.

Changes:

- Azure OIDC test: Added Azure Identity SDK mock to prevent real Azure calls

- Vector store test: Added @respx.mock decorator to block HTTP requests

- Resend email tests (3): Added @respx.mock decorator for all 3 test functions

- SendGrid email test: Added @respx.mock decorator

All test assertions and verification logic remain unchanged - only added safety nets to catch leaked API calls.

* Fix failing OIDC secret manager tests

Fixed two test failures in test_secret_managers_main.py:

1. test_oidc_azure_ad_token_success: Corrected the patch path for get_bearer_token_provider from 'litellm.secret_managers.get_azure_ad_token_provider.get_bearer_token_provider' to 'azure.identity.get_bearer_token_provider' since the function is imported from azure.identity.

2. test_oidc_google_success: Added @patch('httpx.Client') decorator to prevent any real HTTP connections during test execution, resolving httpx.ConnectError issues.

Both tests now pass successfully.
2026-01-26 17:39:40 -08:00
c442fcd922 CI/CD: Increase retries and stabilize litellm_mapped_tests_core (#19826)
* Fix PLR0915: Extract system message handling to reduce statement count

* fix mypy

* fix: add host_progress_callback parameter to mock_call_tool in test

The test_call_tool_without_broken_pipe_error was failing because the mock function did not accept the host_progress_callback keyword argument that the actual implementation passes to client.call_tool(). Updated the mock to accept this parameter to match the real implementation signature.

* fixing flaky tests around oidc and email

* Add documentation comment to test file

* add retry

* add dependency

* increase retry

---------

Co-authored-by: yuneng-jiang <yuneng.jiang@gmail.com>
2026-01-26 17:00:18 -08:00
mubashir1osmaniandGitHub 8908eff7b1 Fix(#19781): Unable to reset user max budget to unlimited
Fix(#19781): Unable to reset user max budget to unlimited
2026-01-26 18:37:49 -05:00
yuneng-jiangandGitHub 801e0a6ce6 Merge pull request #19819 from BerriAI/litellm_cd_fix_yj_10
[Infra] CI/CD - Fixing Flaky Tests in OIDC and Email
2026-01-26 15:29:55 -08:00
yuneng-jiang 33b4b444ac fixing flaky tests around oidc and email 2026-01-26 15:23:17 -08:00
Ishaan JaffandGitHub cec1a3c858 [Feat] CLI Auth - Add configurable CLI JWT expiration via environment variable (#19780)
* fix: add CLI_JWT_EXPIRATION_HOURS

* docs: CLI_JWT_EXPIRATION_HOURS

* fix: get_cli_jwt_auth_token

* test_get_cli_jwt_auth_token_custom_expiration
2026-01-26 14:56:17 -08:00
houdataaliandGitHub 29ee5aab5c [Feat] enable progress notifications for MCP tool calls (#19809)
* enable progress notifications for MCP tool calls

* adjust mcp test
2026-01-26 14:48:22 -08:00
yuneng-jiang f879b8b1cb fixing team member add 2026-01-26 14:35:35 -08:00
colinlin-stripeandGitHub 7605062e94 Messages api bedrock converse caching and pdf support (#19785)
* cache control for user messages and system messages

* add cache createion tokens in reponse

* cache controls in tool calls and assistant turns

* refactor with _should_preserve_cache_control

* add cache control unit tests

* use simpler cache creation token count logic

* use helper function

* remove unused function

* fix unit tests
2026-01-26 13:19:56 -08:00
Alexsander HamirandGitHub f2c3a01a57 fix: make HTTPHandler mockable in OIDC secret manager tests (#19803)
* fix: make HTTPHandler mockable in OIDC secret manager tests

- Add _get_oidc_http_handler() factory function to make HTTPHandler
  easily mockable in tests
- Update test_oidc_github_success to patch factory function instead
  of HTTPHandler directly
- Update Google OIDC tests for consistency
- Fixes test_oidc_github_success failure where mock was bypassed

This change allows tests to properly mock HTTPHandler instances used
for OIDC token requests, fixing the test failure where the mock was
not being used.

* fix: patch base_llm_http_handler method directly in container tests

- Use patch.object to patch container_create_handler method directly
  on the base_llm_http_handler instance instead of patching the module
- Fixes test_provider_support[openai] failure where mock wasn't applied
- Also fixes test_error_handling_integration with same approach

The issue was that patching 'litellm.containers.main.base_llm_http_handler'
didn't work because the module imports it with 'from litellm.main import',
creating a local reference. Using patch.object patches the method on the
actual object instance, which works regardless of import style.

* fix: resolve flaky test_openai_env_base by clearing cache

- Add cache clearing at start of test_openai_env_base to prevent cache pollution
- Ensures no cached clients from previous tests interfere with respx mocks
- Fixes intermittent failures where aiohttp transport was used instead of httpx
- Test-only change with low risk, no production code modifications

Resolves flaky test marked with @pytest.mark.flaky(retries=3, delay=1)
Both parametrized versions (OPENAI_API_BASE and OPENAI_BASE_URL) now pass consistently

* test: add explicit mock verification in test_provider_support

- Capture mock handler with 'as mock_handler' for explicit validation
- Add assert_called_once() to verify mock was actually used
- Ensures test verifies no real API calls are made
- Follows same pattern as test_openai_env_base validation
2026-01-26 11:00:42 -08:00
Alexsander HamirandGitHub a8e72950db Fix test_mcp_server_manager_config_integration_with_database cancellation error (#19801)
Mock _create_mcp_client to avoid network calls in health checks.
This prevents asyncio.CancelledError when the test teardown closes
the event loop while health checks are still pending.

The test focuses on conversion logic (access_groups, description)
not health check functionality, so mocking the network call is appropriate.
2026-01-26 10:52:49 -08:00
yuneng-jiang 4ee00cfda5 fix sso email case sensitivity 2026-01-26 10:33:57 -08:00
Alexsander HamirandGitHub 4a6dcf3012 Add test for Router.get_valid_args, fix router code coverage encoding (#19797)
- Add test_get_valid_args in test_router_helper_utils.py to cover get_valid_args
- Use encoding='utf-8' in router_code_coverage.py for cross-platform file reads
2026-01-26 10:14:58 -08:00
Alexsander HamirandGitHub c0d6998384 Make test_get_users_key_count deterministic by creating dedicated test user (#19795)
- Create a test user with auto_create_key=False to ensure known starting state
- Filter get_users by user_ids to target only the test user
- Verify initial key count is 0 before creating a key
- Clean up test user after test completes
- This ensures consistent behavior across CI and local environments
2026-01-26 10:13:15 -08:00
yogeshwaran10 228aff9b9f Fix user max budget reset to unlimited
- Added a Pydantic validator to convert empty string inputs for max_budget to None, preventing float parsing errors from the frontend.
- Modified the internal user update logic to explicitly allow max_budget to be None, ensuring the value isn't filtered out and can be reset to unlimited in the database.
- Added unit tests for validation and logic.

 Closes #19781
2026-01-26 23:30:36 +05:30
Harshit JainandGitHub b920be3ee7 fix: server rooth path (#19790) 2026-01-26 09:48:06 -08:00
Chesars e382351d4a feat(hosted_vllm): support thinking parameter for /v1/messages endpoint
Adds support for Anthropic-style 'thinking' parameter in hosted_vllm,
converting it to OpenAI-style 'reasoning_effort' since vLLM is
OpenAI-compatible.

This enables users to use Claude Code CLI with hosted vLLM models
like GLM-4.6/4.7 through the /v1/messages endpoint.

Mapping (same as Anthropic adapter):
- budget_tokens >= 10000 -> "high"
- budget_tokens >= 5000  -> "medium"
- budget_tokens >= 2000  -> "low"
- budget_tokens < 2000   -> "minimal"

Fixes #19761
2026-01-26 13:49:55 -03:00
558f01e848 fix(proxy): use return value from CustomLogger.async_post_call_success_hook (#19670)
* fix(proxy): use return value from CustomLogger.async_post_call_success_hook

Previously the return value was ignored for CustomLogger callbacks,
preventing users from modifying responses. Now the return value is
captured and used to replace the response (if not None), consistent
with CustomGuardrail and streaming iterator hook behavior.

Fixes issue with custom_callbacks not being able to inject data into
LLM responses.

* fix(proxy): also fix async_post_call_streaming_hook to use return value

Previously the streaming hook only used return values that started with
"data: " (SSE format). Now any non-None return value is used, consistent
with async_post_call_success_hook and streaming iterator hook behavior.

Added tests for streaming hook transformation.

---------

Co-authored-by: Gabriele Michelli <michelligabriele0@gmail.com>
2026-01-26 08:48:22 -08:00
Tamir KivitiandGitHub aa8134fee9 add timeout to onyx guardrail (#19731)
* add timeout to onyx guardrail

* add tests
2026-01-25 23:13:46 -08:00
Harshit JainandGitHub 79603b9c3a fix: optimize logo fetching and resolve mcp import blockers (#19719) 2026-01-25 23:08:16 -08:00
344ea3d9f2 feat: add clientip and user agent in metrics (#19717)
* feat: add clientip and user agent in metrics

* fix: lint errors

* Add model id and other req labels

---------

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2026-01-25 23:07:19 -08:00
Harshit JainandGitHub a65ac2af13 add callbacks and labels to prometheus (#19708) 2026-01-25 23:03:23 -08:00
5666c725ce Fix/non standard mcp url pattern (#19738)
* fix(mcp): Add standard MCP URL pattern support for OAuth discovery (#17272)

  OAuth discovery endpoints now support both URL patterns:
  - Standard MCP pattern: /mcp/{server_name} (new)
  - Legacy LiteLLM pattern: /{server_name}/mcp (backward compatible)

  The standard pattern is required by MCP-compliant clients like
  mcp-inspector and VSCode Copilot, which expect resource URLs
  following the /mcp/{server_name} convention per RFC 9728.

  Changes:
  - Add _build_oauth_protected_resource_response() helper
  - Add oauth_protected_resource_mcp_standard() endpoint
  - Add oauth_authorization_server_mcp_standard() endpoint
  - Keep legacy endpoints for backward compatibility
  - Add tests for both URL patterns

  Fixes #17272

* fix(mcp): Add standard MCP URL pattern support for OAuth discovery (#17272)

  OAuth discovery endpoints now support both URL patterns:
  - Standard MCP pattern: /mcp/{server_name} (new)
  - Legacy LiteLLM pattern: /{server_name}/mcp (backward compatible)

  The standard pattern is required by MCP-compliant clients like
  mcp-inspector and VSCode Copilot, which expect resource URLs
  following the /mcp/{server_name} convention per RFC 9728.

  Changes:
  - Add _build_oauth_protected_resource_response() helper
  - Add oauth_protected_resource_mcp_standard() endpoint
  - Add oauth_authorization_server_mcp_standard() endpoint
  - Keep legacy endpoints for backward compatibility
  - Add tests for both URL patterns

  Fixes #17272

* Test was relocated

* refactor(mcp): Extract helper methods from run_with_session to fix PLR0915

Split the large run_with_session method (55 statements) into smaller
helper methods to satisfy ruff's PLR0915 rule (max 50 statements):

- _create_transport_context(): Creates transport based on type
- _execute_session_operation(): Handles session lifecycle

Also changed cleanup exception handling from Exception to BaseException
to properly catch asyncio.CancelledError (which is a BaseException subclass
in Python 3.8+).

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

* test(mcp): Fix flaky test by mocking health_check_server

The test_mcp_server_manager_config_integration_with_database test was
making real network calls to fake URLs which caused timeouts and
CancelledError exceptions.

Fixed by mocking health_check_server to return a proper
LiteLLM_MCPServerTable object instead of making network calls.

* test(mcp): Fix skip condition to properly detect claude model names

The skip condition for missing API keys was checking for "anthropic" in
the model name, but the test uses "claude-haiku-4-5" which doesn't match.
Updated to check for both "anthropic" and "claude" model patterns.

Also added skip condition for OpenAI models when OPENAI_API_KEY is not set.

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

* test(mcp): Fix skip condition to properly detect claude model names

The skip condition for missing API keys was checking for "anthropic" in
the model name, but the test uses "claude-haiku-4-5" which doesn't match.
Updated to check for both "anthropic" and "claude" model patterns.

Also added skip condition for OpenAI models when OPENAI_API_KEY is not set.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 23:00:53 -08:00
Jay PrajapatiandGitHub 582d324a76 fix(proxy): support slashes in google generateContent model names (#19737)
* fix(proxy): support slashes in google route params

* fix(proxy): extract google model ids with slashes

* test(proxy): cover google model ids with slashes
2026-01-25 22:59:50 -08:00
Harshit Jain 6df0406cf6 fix: args issue & refactor into helper function to reduce bloat for both(#19441) 2026-01-25 10:21:20 +05:30
Ishaan Jaffer f148207b11 fix patch reliability mock tests 2026-01-24 17:37:17 -08:00