Commit Graph
22603 Commits
Author SHA1 Message Date
Ishaan JaffandGitHub d4107dfd68 [Bug Fix] Ensure /redis/info works on GCP Redis (#11732)
* fix cache_redis_info

* mock_redis_client_list_restricted
2025-06-14 15:35:09 -07:00
Jason DaiandGitHub 4100d1f97d fix: re-export get_valid_models utils in init file (#11721)
* fix: re-export get_valid_models utils in init file

* move it to the correct utils
2025-06-14 15:13:38 -07:00
Ishaan Jaff 6a6ea33ca8 get_custom_url 2025-06-14 14:29:24 -07:00
Cole McIntoshandGitHub 5f34ceea1a Implement health check backend API and storage functionality (#11678)
* feat: Add health check functionality and endpoints

- Introduced methods for saving health check results to the database, including validation and cleaning of data.
- Added new health check endpoints to retrieve health check history and latest health statuses for models.
- Updated model prices and context window configuration for new Azure transcription models.

* test: Add unit tests for health check functionality

- Introduced tests for PrismaClient health check methods, including saving results and retrieving health check history.
- Added tests for the _save_health_check_to_db function to ensure proper handling of healthy and unhealthy endpoints.
- Implemented mock objects to simulate database interactions and validate method behaviors.

* Refactor health endpoint model ID handling and improve logging

- Updated health endpoint to use `get_deployment` for retrieving model names based on model IDs, enhancing error handling for missing models.
- Changed health check result saving to the database to be non-blocking by using `asyncio.create_task`.
- Cleaned up code for better readability and maintainability.

* Refactor utility functions in proxy module for improved readability and error handling

- Removed unused imports and simplified exception handling in `_get_redoc_url` and `_get_docs_url` functions to manage circular imports.
- Cleaned up logging statements for consistency and clarity.
- Streamlined error message formatting in `handle_exception_on_proxy` function.

* Enhance type hinting and default values in ProxyUpdateSpend class for improved clarity and robustness

- Added type hints for `_end_user_list_transactions` to specify it as a dictionary mapping end user IDs to spend amounts.
- Updated default values for optional fields in `SpendLogsPayload` to ensure they are initialized properly, enhancing error handling.
- Refactored `_premium_user_check` function to improve model validation logic and error handling.

* Fix disable_spend_updates method to handle None return value gracefully

- Updated the disable_spend_updates method to return False if the environment variable DISABLE_SPEND_UPDATES is not set or is None, improving robustness in configuration handling.

* Refactor join_paths function in utils.py for improved path handling

- Enhanced the join_paths function to better manage leading and trailing slashes, ensuring correct path concatenation.
- Added logic to handle cases where either base_path or route is empty, improving robustness and usability.

* Enhance health check functionality and improve error handling

- Introduced a new method `_save_health_check_to_db` for saving health check results to the database, utilizing safe JSON functions for data integrity.
- Refactored existing health check methods to streamline the process and improve error logging.
- Updated email sending logic to ensure secure connections and better error handling.
- Improved spend update logic with batch processing and retry mechanisms for database operations.
- Added utility functions for projected spend calculations and enhanced validation for team configurations.

* Add health check methods for database interaction

- Introduced `save_health_check_result` method to save health check results with detailed logging and validation.
- Added `get_health_check_history` method for retrieving health check records with optional filtering.
- Implemented `get_all_latest_health_checks` method to fetch the latest health checks for each model.
- Enhanced error handling and logging for all new methods to improve reliability and traceability.

* Refactor health check result saving to use typed arguments

- Updated the `_save_health_check_to_db` function to call `save_health_check_result` with explicitly typed arguments instead of a dictionary spread, enhancing code clarity and type safety.
- Removed unused method bindings in the mock Prisma client tests to streamline the test setup.

* Remove unused `_save_health_check_to_db` function from utils.py to streamline code and improve maintainability.

* Implement response time validation and details cleaning in health check result saving

- Added `_validate_response_time` method to ensure response time values are valid and handle exceptions gracefully.
- Introduced `_clean_details` method to validate and clean details JSON, improving data integrity.
- Refactored `save_health_check_result` to utilize these new methods for optional fields, enhancing code clarity and maintainability.
- Updated tests to bind new methods to the mock Prisma client for comprehensive testing.

* Add health check utility functions and refactor existing endpoints

- Introduced `_convert_health_check_to_dict` to standardize health check record conversion to dictionary format for JSON responses.
- Added `_check_prisma_client` helper function to streamline database availability checks and improve error handling.
- Refactored health check endpoints to utilize the new utility functions, enhancing code clarity and maintainability.

* Refactor health check tests for improved clarity and coverage

- Simplified the mock PrismaClient setup by consolidating method bindings.
- Updated health check result saving tests to use parameterized scenarios for better coverage.
- Added tests for health check history retrieval and graceful handling when no database client is provided.
- Removed redundant mock functions to streamline the test suite.

* Implement helper function for health check and database saving

- Added `_perform_health_check_and_save` to encapsulate health check execution and optional database saving.
- Refactored health endpoint logic to utilize the new helper function, improving code clarity and reducing redundancy.
- Enhanced error handling and streamlined the process of saving health check results to the database.
2025-06-14 14:27:11 -07:00
nevinandGitHub b7cb66ee8f Fixed grok-3-mini to not use stop tokens (#11563)
* fixed grok-3-mini to not use stop tokens

* added xai config test
2025-06-14 14:26:43 -07:00
Cole McIntoshandGitHub d1bd68155e Add Langfuse OpenTelemetry Integration (#11607)
* feat(langfuse_otel): add Langfuse OpenTelemetry integration for observability

- Introduced a new integration for Langfuse OpenTelemetry, allowing users to send LiteLLM traces and observability data.
- Updated sidebars to include documentation for the new integration.
- Added example usage and configuration details in the documentation.
- Implemented necessary classes and methods to handle OpenTelemetry attributes and configuration.
- Included tests to validate the integration functionality and environment variable handling.

Still WIP

* Remove example script for Langfuse OpenTelemetry integration with LiteLLM
2025-06-14 14:18:38 -07:00
Ishaan Jaff f79737ad90 docs SCIM enterprise only 2025-06-14 14:03:59 -07:00
Ishaan JaffandGitHub b091c1ac4d [Feat] Prometheus - Allow controlling exposed metrics and labels (#11489)
* feat: init prometheus_metrics_config

* feat: add prometheus_metrics_config

* test prometheus

* feat: use factor to init metrics

* fix - pretty print allowed metrics controls

* fix config

* fix - working get_labels_for_metric

* test_no_prometheus_config

* docs update prometheus
2025-06-14 13:56:40 -07:00
Ishaan Jaff 318ad52896 test_anthropic_basic_completion_with_headers 2025-06-14 13:56:06 -07:00
Ishaan Jaff 5a051cb264 test_async_embedding_azure_caching - flaky test 2025-06-14 13:55:29 -07:00
Ishaan Jaff e3094c2249 set flaky tests as flaky 2025-06-14 13:51:52 -07:00
Krish DholakiaandGitHub 84999ddef3 UI - Fix remaining users activity if no limit + allow filtering by model access groups (#11730)
* feat(enterprise/): fix remaining users check on license

* fix(usage_indicator.tsx): if no max user set, don't render remaining user info card

only for users with user limits on their license

* fix(leftnav.tsx): only show remaining users to admin

* feat(columns.tsx): don't allow sorting on model access groups

it's a list[str]

* feat(model_dashboard.tsx): add model access group filters
2025-06-14 13:38:58 -07:00
Gustavo BrianandGitHub 22460a73f9 Time taken column logs (#11723)
* Time taken column logs

* Reanme and details

* Add detail row
2025-06-14 12:29:52 -07:00
Ishaan Jaff 16a5f36441 ci/cd run again v1.72.6-nightly 2025-06-14 11:28:18 -07:00
Ishaan JaffandGitHub 6c8ff3f2c2 [Feat] UI - Add back favicon (#11728)
* add favicon on ui

* fix live check
2025-06-14 11:13:42 -07:00
Ishaan Jaff 24df849c25 ui - fix auto refresh icon 2025-06-14 10:06:09 -07:00
Ishaan Jaff df31c3efe9 ui new build 2025-06-14 09:29:24 -07:00
Ishaan Jaff 82a03fd163 fixes build from pip 2025-06-14 09:03:50 -07:00
Ishaan Jaff 9ebe47bee9 fix build from pip 2025-06-14 08:58:01 -07:00
Ishaan Jaff a32b372293 fix build from pip 2025-06-14 08:50:14 -07:00
Ishaan Jaff 95bf272832 fix build from pip 2025-06-14 08:46:44 -07:00
Ishaan Jaff 690513994b security - add back grype scans 1.72.6.rc-draft 2025-06-14 08:42:58 -07:00
Krrish Dholakia f5aa24c3eb test: update unit testing 2025-06-14 08:41:34 -07:00
Krrish Dholakia eb272f0784 fix(responses/): filter metadata to be openai-compatible
prevents optional params for responses api from including invalid args / litellm internal information

 Closes https://github.com/BerriAI/litellm/pull/11632#issuecomment-2971076684
2025-06-14 08:41:34 -07:00
Krrish Dholakia 0e10e73f31 fix(anthropic/chat/transformation.py): ignore user mapping if email given (e.g. from openwebui)
Closes https://github.com/BerriAI/litellm/issues/10106
2025-06-14 08:41:34 -07:00
Ishaan Jaff b1e00b3724 build from pip RUN prisma generate 2025-06-14 08:37:47 -07:00
Ishaan Jaff 098fb0307a Revert "Enable System Proxy Support for aiohttp Transport (#11616)"
This reverts commit 33c134c6ac.
2025-06-14 08:32:51 -07:00
Krish DholakiaandGitHub afe8abc768 Add anthropic 'none' tool choice param support (#11695)
* docs(index.md): add stable pip package

* fix(anthropic/chat/transformation.py): add 'none' tool choice mapping

Allows disabling anthropic tool calling

Maintain parity

* fix(transformation.py): if tool_choice="none" ignore 'disable_parallel_Tool_use'

unsupported param from anthropic - makes sense as the 'none' implies no tool calls are being made
2025-06-13 21:22:03 -07:00
Krish DholakiaandGitHub 8579332f44 Add model access groups on UI (#11719)
* fix(anthropic/chat/transformation.py): append prefix to start of assistant response, if set

ensures assistant response contains complete response

* fix(anthropic/chat/transformation.py): add flag to allow user to opt out of enabling prefix in prompt

* fix(anthropic/chat/transformation.py): working e2e support for prefix prompt in assistant response

* feat(networking.tsx): always include model access groups on UI

show admin created access groups when giving key/user/team model permissions

* feat(add_model_tab.tsx): initial ui component for adding to an existing model access group

allows user to add model to an access group (simplify giving users/keys/teams model access)

* feat(proxy_server.py): add 'only_model_access_groups' flag support to `/v1/models`

simplifies listing available access groups on UI

* test: add e2e test for new only_model_access_groups param

* feat(add_model_tab.tsx): allow adding+viewing model access groups on models tab

make feature functional on UI

* feat(view_users.tsx): route edit user to user info page

more detailed user edit

* feat(columns.tsx): route edit user to user info page

more detailed user edit

* fix(columns.tsx): fix linting error

* build(ui/): fix linting errors
2025-06-13 21:20:25 -07:00
Krrish Dholakia 31a73be03f fix(litellm_logging.py): skip should_run_logging check on streaming 2025-06-13 21:19:24 -07:00
Ishaan Jaff e5893f8904 bump: version 1.72.5 → 1.72.6 2025-06-13 19:05:50 -07:00
Ishaan Jaff 5b451bf483 test_openai_azure_embedding_simple 2025-06-13 19:00:25 -07:00
Ishaan Jaff b1e609be3f fix mcp servers 2025-06-13 18:45:00 -07:00
Ishaan Jaff 7afbd897b8 docs mcp permissions 2025-06-13 18:32:08 -07:00
Krish DholakiaandGitHub 7df76175b4 fix(prometheus.py): fix total token increment + add semantic tests for prometheus metrics (#11718)
fixes regression where total requests was incremented by token value
2025-06-13 16:43:00 -07:00
tanjiroandGitHub 42d1fa8509 correct alignment (#11717) 2025-06-13 15:55:58 -07:00
Ishaan Jaff 4b03bf92df ui new build v1.72.2.devMCP 2025-06-13 15:02:36 -07:00
Ishaan Jaff 18a5f2bb10 fixes MCP litellm 2025-06-13 15:01:34 -07:00
Ishaan Jaff aefba7395f ui new build 2025-06-13 14:55:58 -07:00
Ishaan Jaff 31dde89f15 fix render mcp logo 2025-06-13 14:48:22 -07:00
tanjiroandGitHub 54b14ac631 enterprise feature preview improvement (#11715) 2025-06-13 14:43:06 -07:00
Ishaan JaffandGitHub 119663e6ce [Feat] Add Connect to MCP Page (#11716)
* add mcp connect page

* use tremor tabs

* fix - ensure ui consistency

* fix MCP servers alignment

* fix spacing

* show litellm url

* fix connector

* fix MCP transports
2025-06-13 14:36:36 -07:00
tanjiroandGitHub 6ee1376673 Add Live Tail Feature to Logs View (#11712)
* add live tail feature

* improve time interval

* auto-refresh every 15 seconds

* remove last 1 minute option
2025-06-13 14:31:49 -07:00
Ishaan Jaff d012b5facf fix leftnav 2025-06-13 10:57:52 -07:00
Krrish Dholakia 5007ef868f docs: doc updates 2025-06-13 10:21:54 -07:00
Krrish Dholakia b6714cfd4f docs(index.md): add stable pip package 2025-06-13 10:21:54 -07:00
19a8b23644 [Feat] Add Authentication + Permission Management for MCP List, Call Tool Ops (#11682)
* add basic auth checks for MCP

* working MCP auth

* fix MCP

* add get_allowed_mcp_servers for key, team

* add get_allowed_mcp_servers

* TOOLS FROM MCP SERVERS

* fix - working context vars for handling auth to MCPs

* fix imports

* working _get_allowed_mcp_servers_for_key

* TestUserAPIKeyAuthMCP

* test_user_api_key_auth_mcp

* fix code qa check

* fix imports

* test_mcp_server.py

* fix: fix - working permission mgmt

* Update litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-13 10:13:51 -07:00
Ishaan JaffandGitHub 4b107e0c70 [Feat] UI - Allow setting MCP servers when creating keys, teams (#11711)
* Add PremiumMCPSelector

* add PremiumMCPSelector

* Fix CTA enterprise
2025-06-13 10:10:01 -07:00
Ishaan JaffandGitHub 891a71b7a0 [Feat] UI Allow editing mcp servers (#11693)
* ui - clean up MCP server table

* ui - clean up table

* fix mb-4

* ui fix

* add support for editing MCP servers
2025-06-13 09:56:58 -07:00
Alvaro SevillaandGitHub 196a7269f6 fix(vertex_ai): support global location in vertex ai passthrough (#11661)
* Support global location in vertex ai passthrough

* refactor
2025-06-13 09:51:04 -07:00