Commit Graph
22674 Commits
Author SHA1 Message Date
Cole McIntoshandGitHub e1fbdde289 Fix boto3 tracer wrapping for observability (#11869)
* feat: add summarize parameter to /spend/logs endpoint for individual transaction logs

- Introduced a new `summarize` parameter to control data format when querying spend logs.
- `summarize=true` (default) returns aggregated data, while `summarize=false` provides individual transaction logs.
- Updated documentation and added tests to validate the new functionality.

* fix: wrap boto3.Session() with tracer for observability - Add tracer.trace wrapper around boto3.Session() call in _get_aws_region_name method - Ensures all boto3 initializations in base_aws_llm.py are properly instrumented - Fixes test_boto3_init_tracer_wrapping test failure - Maintains consistency with other boto3 calls in the same file
2025-06-18 15:47:55 -07:00
Krrish Dholakia 0e1ff45065 fix: fix linting error 2025-06-18 14:14:55 -07:00
Krish DholakiaandGitHub 7f8b2579a2 Minor Fixes (#11868)
* fix(litellm_pre_call_utils.py): add user agent tags to spend logs in standard logging payload logic

avoid clash when tag based routing is enabled

* test: remove redundant test

* test: rename oidc test to run earlier

quicker debuging

* fix(azure.py): return more detailed error message

* fix(azure/common_utils.py): use default scope, if scope is none

fixes oidc test

* fix: always default to cognitiveservices.azure.com

* test: update test
2025-06-18 14:12:59 -07:00
ShankygandGitHub 58dce17414 fix #11857 (#11859) 2025-06-18 14:05:12 -07:00
Cole McIntoshandGitHub ae74eb833b Implement health check frontend UI components and dashboard integration (#11679)
* feat: Implement health check functionality for models

- Added individual model health check API call and integrated it into the dashboard.
- Introduced health check history and latest health checks retrieval.
- Enhanced model dashboard to display health status, last check time, and error details.
- Created a new health check columns component for better organization of health data.
- Added error pattern handling for meaningful error messages.
- Updated UI components to support health check actions and display loading states.

* refactor: extract health check functionality into a new component

- Removed individual health check logic from ModelDashboard and encapsulated it within HealthCheckComponent for better modularity and maintainability.
- Updated ModelDashboard to utilize the new HealthCheckComponent, streamlining the health check process and improving code organization.
- Cleaned up unused state variables and imports related to health checks in ModelDashboard.
- Enhanced error handling and status management within the new component, ensuring a more robust health check experience.

* fix: add access token check in HealthCheckComponent to prevent unauthorized API calls

- Implemented a check for the presence of an access token before making API calls to fetch the latest health checks, enhancing security and preventing potential errors when the token is missing.
2025-06-18 13:46:40 -07:00
Krish DholakiaandGitHub e5fd313a48 Completion-To-Responses Bridge: Support passing image url's (#11833)
* fix(completion_to_responses_bridge_transformation.py): support passing image urls' to responses api models

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

* fix(base_aws_llm.py): if boto3 present, try and get the configured region name

Closes https://github.com/BerriAI/litellm/issues/8847

* fix: fix imports

* fix: fix linting error s
2025-06-18 12:48:17 -07:00
Krish DholakiaandGitHub 0319adbf5d feat(speech/): working gemini tts support via openai's /v1/speech endpoint (#11832)
* feat(speech/): working gemini tts support via openai's `/v1/speech` endpoint

Enables calling gemini models via `/v1/speech`

* feat(speech_to_completion_bridge/): voice param support

enables passing voice param to gemini models

* fix: fix ruff checks

* fix: fix checks
2025-06-18 10:36:25 -07:00
Ishaan JaffandGitHub ef336dcb38 [SCIM] Add Error handling for existing user on SCIM (#11862)
* fix handling existing user on SCIM

* test scim v2 fixes
2025-06-18 09:49:13 -07:00
Cole McIntoshandGitHub c39b8f2178 feat: add LiteLLM_HealthCheckTable model to schema for health monitoring (#11677) 2025-06-18 08:37:40 -07:00
karen-veigasandGitHub 5848056c49 Fix #11856: Update billing.md docs to call the new GPT-4o model (#11858)
* Fix: #11853
Updated alerting.md to call the latest model for adding metadata.

* Fix: #11856
Updated billing docs to call newer GPT model for Langchain and CURL
2025-06-18 08:19:36 -07:00
Ishaan JaffandGitHub 6ffebe7394 [Fix] v1/messages endpoint always uses us-central1 with vertex_ai-anthropic models (#11831)
* fix - vertex location

* test_validate_environment_uses_vertex_ai_location
2025-06-18 07:00:04 -07:00
Cole McIntoshandGitHub 7d1e0651d8 Implement health check backend API and storage functionality - fix ci/cd (#11852)
* 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.

* refactor: rename target_model parameter to model in health check function
2025-06-18 06:57:08 -07:00
Krrish Dholakia 01af7fe1a8 docs(index.md): update release note with rc patch 2025-06-17 22:55:50 -07:00
2740c8d77d Fix vertex ai claude thinking params (#11796)
* fix:  vertex_ai/claude-sonnet-4 thinking params can not be accepted

* CHORE: add unit test

---------

Co-authored-by: wick.hu <wick.hu@momenta.ai>
2025-06-17 22:35:31 -07:00
Ishaan Jaff 84c4c8027f ui new build 2025-06-17 21:02:33 -07:00
Ishaan Jaff 5a5c34c469 MCP docs fix 2025-06-17 20:59:12 -07:00
Ishaan JaffandGitHub 0eb8a3de10 [Feat] v2 Pass through endpoints - Add support for subroutes for pass through endpoints + Cleaned up UI (#11827)
* fix: add construct_target_url_with_subpath

* add InitPassThroughEndpointHelpers

* added debugging for pass through routes

* add PassThroughGenericEndpoint to include subpath and input_cost_per_request

* polish page

* Add Pass-Through Endpoint

* polish pass through ui

* fixes for initialize_pass_through_endpoints

* PassThroughGenericEndpoint

* test_add_subpath_route

* test_initialize_pass_through_endpoints_with_include_subpath

* fix code QA check
2025-06-17 20:52:28 -07:00
Nicholas CoutureandGitHub 8bcf163b83 Update bedrock guardrail docs (#11826)
Added the `aws_region_name` and `aws_role_name` keys to the definition of a guardrail config. 

Without these you will get the error `{\"message\":\"The guardrail identifier or version provided in the request does not exist.\"}`
2025-06-17 17:41:41 -07:00
Krrish Dholakia 3c7399e7ec docs(document_understanding.md): clarify support for openai models 2025-06-17 17:40:49 -07:00
salah alzubiandGitHub d7e53edc26 Update model_prices_and_context_window.json (#11803)
-- Updated pricing for Gemini Flash
-- Updated a few Openrouter models
-- Updated pricing for Gemini Flash Lite
2025-06-17 17:12:08 -07:00
Ishaan JaffandGitHub a8196159b9 [Bug Fixes] MCP - using MCPs defined on config.yaml + fix for MCP error Team doesn't exist in cache (#11824)
* fix - dont allow missing team to block MCP list response

* use HTTP as default transport

* _generate_stable_server_id

* fix list MCP servers

* ui fix

* test_list_mcp_servers_empty_result

* test_generate_stable_server_id

* _generate_stable_server_id

* fix code QA

* fix code QA
2025-06-17 16:25:12 -07:00
Ishaan JaffandGitHub bcdb53920a [Fix] Bug Fix for using prom metrics config (#11779)
* fixes for using config for prom metrics

* test_set_llm_deployment_success_metrics_with_label_filtering

* fixes for deployment failure

* fix code qa checks

* test_async_post_call_success_hook
2025-06-17 14:44:24 -07:00
Cole McIntoshandGitHub 36d964a758 Fix JSX syntax error in documentation - Fixed unclosed <token> tag in config_settings.md that was causing Vercel deployment to fail (#11818) 2025-06-17 11:39:57 -07:00
Krrish Dholakia 6fe335ea94 bump: version 1.72.6 → 1.72.7 2025-06-16 22:12:39 -07:00
Krish DholakiaandGitHub cb90f8e613 Allow /models to return correct models for custom wildcard prefixes (#11784)
* fix(model_checks.py): cleanup logic

support wildcard models with non-provider prefix's for model discovery

Closes https://github.com/BerriAI/litellm/pull/10358

* feat(model_checks.py): delegate wildcard prefix appending to the get_known_models_from_wildcard function

remove from the 'get_provider_models' function

* fix(model_checks.py): don't double add the wildcard prefix

* test: update tests
2025-06-16 22:11:36 -07:00
Krish DholakiaandGitHub 30b431681e JWT Auth - correctly return user email + UI Model Update - Allow editing model access group for existing model (#11783)
* fix(handle_jwt.py): check user object, if jwt user is proxy admin

correctly return user role - if jwt user has role updated in UI

* test(test_handle_jwt.py): add unit test for passing correct user role

* feat(model_info_view.tsx): separate UI component for updating edit model component

* feat(model_info_view.tsx): allow updating model access group on UI

show all available access groups in ui component

* docs: minor fixes
2025-06-16 22:11:04 -07:00
Krish DholakiaandGitHub 87ae2cf3d7 SSO - Allow passing additional headers + Spend Tags - automatically track spend by user agent (allows cost tracking for claude code) (#11781)
* feat(ui_sso.py): allow admin to specify additional headers for sso provider

some sso providers require special headers to return a json response

* test(test_ui_sso.py): add unit tests to ensure custom headers are respect3ed

* docs(config_settings.md): document new header param

* fix(litellm_pre_call_utils.py): add spend tag tracking by user agent

allows checking spend for cli tools like claude code

* feat(litellm_pre_call_utils.py): track spend by user agent part if user agent contains "/"

allows tracking spend across user agent versions

Better cost tracking for claude cod

* test(test_litellm_pre_call_utils.py): add testing for pre call utils, user agent parsing

* fix: fix linting check
2025-06-16 21:53:40 -07:00
Ishaan JaffandGitHub 80501b8268 [Feat] Day-0 Support for OpenAI Re-usable prompts Responses API (#11782)
* add prompt to responses params

* add OpenAI PromptObject

* add prompt param to responses api

* test_get_optional_params_responses_api

* test_openai_responses_litellm_router_with_prompt

* docs Reusable Prompts
2025-06-16 21:28:50 -07:00
Abinand PandGitHub 99c2a7fb70 feat: update the feature of ollama_embeddings to work on a sync api (#11746)
* feat: update the feature of ollama_embeddings to work on a sync api

Signed-off-by: Abinand P <abinand0911@gmail.com>

* lint:fixing of the lint file

Signed-off-by: Abinand P <abinand0911@gmail.com>

* fix:test

Signed-off-by: Abinand P <abinand0911@gmail.com>

* chore: added test for ollama embedding and refactored handler

Signed-off-by: Abinand P <abinand0911@gmail.com>

* fix:lint error

Signed-off-by: Abinand P <abinand0911@gmail.com>

---------

Signed-off-by: Abinand P <abinand0911@gmail.com>
2025-06-16 19:07:33 -07:00
Krrish Dholakia bb907b5ecc test: fix test 2025-06-16 18:49:41 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4e313e517b build(deps): bump next from 14.2.26 to 14.2.30 in /ui/litellm-dashboard (#11720)
Bumps [next](https://github.com/vercel/next.js) from 14.2.26 to 14.2.30.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.2.26...v14.2.30)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 14.2.30
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 17:33:11 -07:00
MadsRCandGitHub 2224fd96be AWS credentials no longer mandatory (#11765) 2025-06-16 17:32:10 -07:00
Ishaan JaffandGitHub 49b957d14c fix aiohttp version (#11777) 2025-06-16 17:31:14 -07:00
35d74af5a0 [Fix] Pass through - Langfuse don't log request to Langfuse passthrough on Langfuse (#11768)
* dont log lf pass through request

* test_is_langfuse_route

* Update litellm/proxy/pass_through_endpoints/success_handler.py

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-16 17:30:23 -07:00
Ishaan JaffandGitHub 7f11b5b76c [Security] - Add Trivy Security Scan for UI + Docs folder - remove all vulnerabilities (#11778)
* docs - sec scan

* ui - fix 0 security issues

* fix - 0 medium vuln on docs

* add MEDIUM scan for Docs

* Run Trivy scan on LiteLLM UI
2025-06-16 17:13:19 -07:00
Ishaan JaffandGitHub 261d56b214 [Security] Fixes for docs (#11776)
* fix - docs

* docs fixes

* fixes for docs

* fixes docs
2025-06-16 16:20:55 -07:00
Ishaan Jaff 2f322237ca docs - mcp with litellm config.yaml 2025-06-16 12:35:51 -07:00
shagunb-acnandGitHub 441d579d1b #11748: Added Mistral Small to BEDROCK_CONVERSE_MODELS for Converse API support as it supports natively (#11760) 2025-06-16 12:27:26 -07:00
tanjiroandGitHub bc9f111ee8 move buttons to the left (#11771) 2025-06-16 12:27:04 -07:00
Emerson GomesandGitHub b21f4a3f74 Add Vertex Imagen-4 models (#11767) 2025-06-16 10:08:51 -07:00
Cole McIntoshandGitHub 6d373876d2 fix(prometheus.py): always initialize label_filters for PrometheusLogger (#11764) 2025-06-16 09:20:57 -07:00
Krrish Dholakia 06519e3f03 docs: specify when users can expect prod version 2025-06-15 01:39:14 -07:00
Krrish Dholakia 48845065f5 docs: specify rc docker version on release notes 2025-06-15 01:38:25 -07:00
Krrish Dholakia 48ac5a940f docs: cleanup 2025-06-15 01:33:49 -07:00
Krrish Dholakia 30827d0522 docs: cleanup docs 2025-06-15 01:33:06 -07:00
Krish DholakiaandGitHub 7a128e2017 VertexAI Anthropic - streaming passthrough cost tracking (#11734)
* feat(vertex_passthrough_logging_handler.py): initial anthropic passthrough streaming cost tracking support

* fix: fix linting errors

* test: update test
2025-06-15 01:16:43 -07:00
Krish DholakiaandGitHub bb256c6d83 Release note updates + Responses API Bridge improvements (#11740)
* docs: track which items need docs

* docs(anthropic.md): add tool_choice="none" to docs

* docs: add docs for new anthropic + perplexity features

* docs: cleanup mistral reasoning docs

* docs: add links to docs

* docs(index.md): update docs

* docs: refactor to add a new 'integrations' tab to docs

* refactor(docs/): create separate tab for integrations

make it easier to highlight new integrations

* docs: sort sidebar

* docs: update

* feat: working claude code with openai codex mini

* docs: add responses api to docs

* feat(index.md): update docs

* fix: fix linting error
2025-06-15 01:13:10 -07:00
Krish DholakiaandGitHub d15664c8e6 Litellm stable docs 06 14 2025 p2 (#11738)
* docs: track which items need docs

* docs(anthropic.md): add tool_choice="none" to docs

* docs: add docs for new anthropic + perplexity features

* docs: cleanup mistral reasoning docs

* docs: add links to docs

* docs(index.md): update docs

* docs: refactor to add a new 'integrations' tab to docs

* refactor(docs/): create separate tab for integrations

make it easier to highlight new integrations

* docs: sort sidebar

* docs: update
2025-06-14 19:38:46 -07:00
Ishaan Jaff 4efdfc00ab docs MCP 2025-06-14 18:13:29 -07:00
Ishaan Jaff 55af010d26 docs mcp 2025-06-14 18:10:37 -07:00