Commit Graph
24008 Commits
Author SHA1 Message Date
Krrish Dholakia 41f7901cfa docs(readme.md): add note, saying poetry is required 2025-08-14 17:15:29 -07:00
Krrish Dholakia 817b8408fa docs(readme.md): fix readme 2025-08-14 17:13:04 -07:00
Ishaan JaffandGitHub b78495d398 [Fix] Ensure /messages works when using `bedrock/converse/<model> with LiteLLM (#13627)
* get_bedrock_provider_config_for_messages_api

* fixes for get_bedrock_provider_config_for_messages_api

* test_anthropic_messages_litellm_router_bedrock

* fix merge conflicts

* fix - refactor based on jugal's comment
2025-08-14 16:50:05 -07:00
Jugal D. BhattandGitHub b8fe5f7b17 [MCP Gateway] LiteLLM Fix MCP gateway key auth (#13630)
* Fix - add safe divide by 0 for most places to prevent crash

* Enhance MCPRequestHandler to support permission inheritance and intersection logic for access groups. Added integration tests to verify behavior when keys have no permissions and when both keys and teams have overlapping permissions.

* Remove redundant assertions for permission checks in test_user_api_key_auth_mcp.py to streamline test logic.

* Refactor integration tests for MCPRequestHandler to simplify mocking. Replace complex database mocks with direct function mocks for permission inheritance and intersection scenarios, improving test clarity and maintainability.

* Revert "Fix - add safe divide by 0 for most places to prevent crash"

This reverts commit 265d40e39051e148996b9fb7f354730c57ff23ac.
2025-08-14 16:32:18 -07:00
aea0605eed [LLM Translation] Fix Realtime API endpoint for no intent (#13476)
* fix intent params

* Add responses

* fix unrelated test

* test fix - fireworks API endpoint is down

* test fix fireworks ai is having an active outage

* test_completion_cost_databricks

* dbrx fix test API currently not responding

* Update OpenAI Realtime handler to use the correct endpoint and include all query parameters. Adjusted error messages for missing API base and key. Updated health check URL construction to pass model as a query parameter.

* Enhance OpenAI Realtime handler tests to ensure model parameter inclusion in WebSocket URL. Added new tests to verify correct URL construction with model and additional parameters, preventing 'missing_model' errors. Updated existing tests for consistency.

* Remove debug print statements for API base and key in OpenAIRealtime handler to clean up the code.

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
2025-08-14 16:24:14 -07:00
Jugal D. BhattandGitHub 40550e5b88 [Proxy] Litellm add DB metrics to prometheus (#13626)
* Fix - add safe divide by 0 for most places to prevent crash

* feat(prometheus): add new metrics for monitoring pod lock manager and spend update queues

* fix(prometheus): specify type for buffer monitoring metrics in PrometheusMetricLabels

* Revert "Fix - add safe divide by 0 for most places to prevent crash"

This reverts commit 265d40e39051e148996b9fb7f354730c57ff23ac.
2025-08-14 16:16:48 -07:00
Krish DholakiaandGitHub ab8bd70c5e Merge pull request #13635 from BerriAI/litellm_mock_test_fix
[Proxy] LiteLLM mock test fix
2025-08-14 15:47:41 -07:00
Jugal Bhatt 936c36bd5f Increase timeout for test-litellm workflow from 20 to 25 minutes to accommodate longer test execution times. 2025-08-14 15:41:58 -07:00
Ishaan Jaff 025ce17564 bump: version 1.75.5 → 1.75.6 v1.75.6-nightly 2025-08-14 15:30:45 -07:00
TomuHirataandGitHub f6e53deacd Update mlflow logger usage span attributes (#13561)
* test: sync mlflow request tags

* fix test
2025-08-14 15:20:50 -07:00
Jugal Bhatt f53599825d Merge branch 'main' into litellm_mock_test_fix 2025-08-14 15:17:31 -07:00
Jugal Bhatt 45f188b041 Add mock user API key authentication in tag management tests
This update integrates mock user API key authentication into the tag management endpoint tests, ensuring accurate simulation of user roles for creating, updating, and deleting tags. The changes enhance the reliability of the tests by properly setting up user authentication before executing test cases.
2025-08-14 15:03:21 -07:00
Krrish Dholakia aaf9c38a10 test: skip test - ran out of credits 2025-08-14 15:01:26 -07:00
Jugal Bhatt d21f467264 Revert "Add mock user API key authentication in tag management tests"
This reverts commit 5fc0803b94.
2025-08-14 14:58:49 -07:00
Jugal Bhatt 5fc0803b94 Add mock user API key authentication in tag management tests
This update introduces a helper function to create a mock user API key authentication object, which is utilized in the tag management endpoint tests. The mock authentication is integrated into the test cases for creating, updating, and deleting tags, enhancing the reliability of the tests by simulating user roles accurately.
2025-08-14 14:40:49 -07:00
Jugal Bhatt a6e55c0447 Revert "Revert "Fix - add safe divide by 0 for most places to prevent crash""
This reverts commit 5ad698f2cc.
2025-08-14 14:23:06 -07:00
Jugal Bhatt bfb0a3854e Enhance logging in cost calculation tests to ensure DEBUG level captures are accurate. Updated tests to set logger level before assertions and restored original logger level after execution. This improves reliability of log level checks in both cost and batch cost calculation tests. 2025-08-14 14:21:22 -07:00
Jugal Bhatt 5ad698f2cc Revert "Fix - add safe divide by 0 for most places to prevent crash"
This reverts commit 265d40e39051e148996b9fb7f354730c57ff23ac.
2025-08-14 14:21:07 -07:00
Jugal D. BhattandGitHub 3a38912bce [Proxy] Litellm fix mapped tests (#13634)
* Fix - add safe divide by 0 for most places to prevent crash

* mock prisma client

* Revert "Fix - add safe divide by 0 for most places to prevent crash"

This reverts commit 265d40e39051e148996b9fb7f354730c57ff23ac.
2025-08-14 14:19:36 -07:00
Krish DholakiaandGitHub cedba81f4c Merge pull request #13588 from BerriAI/litellm_admin_viewer_updates
[Management/UI]Allow routes for admin viewer
2025-08-14 12:03:00 -07:00
Krish DholakiaandGitHub f360e0ead2 Merge pull request #13590 from BerriAI/litellm_bedrock_api_header
[LLM translation] Refactor Anthropic Configurations and Add Support for `anthropic_beta` Headers
2025-08-14 11:32:18 -07:00
Jugal D. BhattandGitHub 1beba93cc8 Fix - add safe divide by 0 for most places to prevent crash (#13624) 2025-08-14 11:17:49 -07:00
Krish DholakiaandGitHub 8d76935457 Merge pull request #13607 from huangyafei/update_price
Add deepseek-chat-v3-0324 to OpenRouter cost map
2025-08-14 11:05:53 -07:00
Krish DholakiaandGitHub fe2833817e Merge pull request #13625 from BerriAI/litellm_dev_08_13_2025_p1
perf(main.py): new 'EXPERIMENTAL_OPENAI_BASE_LLM_HTTP_HANDLER' flag
2025-08-14 11:04:35 -07:00
Ishaan JaffandGitHub 5bb96af818 [Feat] Add reasoning_effort param for hosted_vllm provider (#13620)
* add reasoning_effort to hosted_vllm

* test_hosted_vllm_supports_reasoning_effort

* Reasoning Effort
2025-08-14 10:10:30 -07:00
Cole McIntoshandGitHub dea98a315b fix(volcengine): handle thinking disabled parameter properly (#13598)
* fix(volcengine): handle thinking disabled parameter properly

When thinking is set to {"type": "disabled"} in volcengine provider config,
skip adding the parameter to extra_body entirely instead of passing it through.
This prevents "thinking: undefined" from appearing in request logs.

Fixes #13039

* test(volcengine): fix and enhance thinking parameter tests

- Fixed existing test that expected broken behavior
- Added comprehensive test coverage for all thinking parameter scenarios:
  * thinking disabled → omitted from extra_body
  * thinking enabled → included in extra_body
  * thinking None → included in extra_body as None
  * custom thinking values → included in extra_body
  * no thinking parameter → empty result

All tests passing, verifying the fix for issue #13039
2025-08-14 09:10:06 -07:00
tanjiroandGitHub b5d0a7eb95 adding missing imports + removing unused imports (#13610) 2025-08-14 08:26:15 -07:00
Krrish Dholakia 0288ed35da test: update tests 2025-08-13 23:33:32 -07:00
Krrish Dholakia b53962dee2 test: update test 2025-08-13 23:09:18 -07:00
huangyafei 2b89f95e37 Add deepseek-chat-v3-0324 to OpenRouter model list 2025-08-14 10:44:15 +08:00
Krrish Dholakia 5a7a889d93 perf(main.py): new 'EXPERIMENTAL_OPENAI_BASE_LLM_HTTP_HANDLER' flag
improves RPS for openai calls by 100 (100 users, 10 start-up)

 Moves to using litellm's asynchttphandler vs. openais's sdk for llm calling
2025-08-13 19:12:39 -07:00
Ishaan Jaff cd893134b7 test team endpoints 2025-08-13 18:43:50 -07:00
Ishaan Jaff ce4210a17a bump litellm proxy extras 2025-08-13 17:50:10 -07:00
Ishaan Jaff 086621e3d3 test_handle_jwt.py 2025-08-13 17:27:50 -07:00
Ishaan JaffandGitHub 8e76f8e7d0 [Feat] Team Member Rate Limits + Support for using with JWT Auth (#13601)
* fix - assign tpm/rpm limit onJWT

* add team member rpm/tpm limits

* update - rate limiter v3 with team member rate limits

* update utils

* fixes for LiteLLM_BudgetTable

* undo change

* add TeamMemberBudgetHandler

* add _process_team_member_budget_data

* add get_team_membership

* add safe_get_team_member_rpm_limit and safe_get_team_member_tpm_limit

* LiteLLM_TeamMembership

* add LiteLLM_TeamMembership rate limit for JWTs

* fix

* tests
2025-08-13 17:21:36 -07:00
Ishaan JaffandGitHub 76d25926d4 [Feat] New provider - Azure AI Flux Image Generation (#13592)
* init files

* add AzureFoundryModelInfo

* fix api_version property

* add azure_ai img gen

* use AzureFoundryModelInfo

* get_base_image_generation_call_args

* add azure_ai/FLUX-1.1-pro

* add util for route_image_generation_cost_calculator

* docs azure ai flux

* fixes for flux

* fixes for AzureFoundryFluxImageGenerationConfig

* ruff fix
2025-08-13 17:20:30 -07:00
Ishaan JaffandGitHub fb325cbb5e fix Build from litellm pip package (#13603) 2025-08-13 17:19:43 -07:00
Krrish Dholakia 2e21f1d07a fix(router.py): fix test 2025-08-13 16:27:13 -07:00
Jugal Bhatt 3b47355449 Enhance route access checks for PROXY_ADMIN_VIEW_ONLY role in RouteChecks class
- Added additional routes for key management operations to the access control logic.
- Improved handling of routes that start with "/key/" and end with "/regenerate" to ensure proper access restrictions.
2025-08-13 16:04:43 -07:00
Ishaan JaffandGitHub 75bcfbb76a [Feat] New model vertex_ai/deepseek-ai/deepseek-r1-0528-maas (#13594)
* add ertex_ai/deepseek-ai/deepseek-r1-0528-maas

* fix init

* test_model_info_for_vertex_ai_deepseek_model
2025-08-13 13:44:45 -07:00
Jugal Bhatt 4201f0aa79 Enhance Bedrock Provider Configuration and Header Management
- Added `forward_client_headers_to_llm_api` setting in the Bedrock documentation to facilitate client-side header forwarding.
- Updated `completion` function to use merged headers instead of original `extra_headers`.
- Improved request handling in `BedrockConverseLLM` and `AmazonInvokeConfig` to ensure proper header management for `anthropic-beta` parameters.
- Refactored request transformation logic to return the transformed request for better clarity and functionality.
2025-08-13 13:41:34 -07:00
Jugal Bhatt 26e62c9bd8 Update Test for Anthropic Messages Configuration
- Renamed `AmazonAnthropicClaude3MessagesConfig` to `AmazonAnthropicClaudeMessagesConfig` in the test file to align with recent refactoring.
- Adjusted the instantiation of the configuration class in the test to reflect the new naming convention.
2025-08-13 11:53:11 -07:00
Jugal Bhatt c2310bcccc Refactor Anthropic Configurations in Tests
- Updated test cases to use the renamed `AmazonAnthropicClaudeConfig` instead of `AmazonAnthropicClaude3Config` for consistency with recent changes.
- Adjusted imports and assertions in test files to reflect the new configuration class name.
2025-08-13 11:52:41 -07:00
Jugal Bhatt 3990f61bed Refactor Anthropic Configurations and Add Support for anthropic_beta Headers
- Renamed `AmazonAnthropicClaude3Config` and `AmazonAnthropicClaude3MessagesConfig` to `AmazonAnthropicClaudeConfig` and `AmazonAnthropicClaudeMessagesConfig` respectively for consistency.
- Implemented `get_anthropic_beta_from_headers` function to extract and handle `anthropic-beta` headers across various transformations.
- Updated request transformations in `AmazonConverseConfig` and `AmazonInvokeConfig` to include `anthropic_beta` parameters based on user headers.
- Added tests to ensure proper handling of `anthropic_beta` headers in different scenarios.
2025-08-13 11:47:59 -07:00
Jugal Bhatt a74056e707 Refactor access checks for PROXY_ADMIN_VIEW_ONLY role in RouteChecks class
- Consolidated access control logic into a new static method `_check_proxy_admin_viewer_access`.
- Improved readability and maintainability by reducing code duplication in route access checks.
- Ensured proper handling of write operations and parameter validation for management routes.
2025-08-13 11:00:32 -07:00
Krish DholakiaandGitHub ffd165c9b7 Merge pull request #13549 from BerriAI/litellm_mcp_config_fix
[fix] Enhance MCPServerManager with access groups and description support
2025-08-13 10:51:19 -07:00
Krish DholakiaandGitHub a1f6ade9f6 Merge pull request #13582 from BerriAI/remove-network-response-error
Remove ambiguous network response error
2025-08-13 10:50:05 -07:00
Jugal Bhatt 89a1150033 Allow routes for admin viewer 2025-08-13 10:49:02 -07:00
Michael VerunicaandGitHub 37e57a0e5f fix(azure): remove trailing semicolon in Content-Type header for image generation (#13584) 2025-08-13 09:43:02 -07:00
Krish DholakiaandGitHub 5e45fcdff0 Merge pull request #13375 from colesmcintosh/fix/ollama-gpt-oss-thinking-field 2025-08-13 07:58:57 -07:00