Commit Graph
23118 Commits
Author SHA1 Message Date
Cole McIntosh e4bc213bfe fix(proxy): Add managed_files hook to test_mock_create_audio_file
The test was failing because the managed_files hook was not configured.
This fix adds a DummyManagedFiles class and mocks the create_file
function as an AsyncMock to ensure proper test execution.
2025-06-26 10:42:25 -06:00
Cole McIntosh c4f3cc6de2 Enhance CircleCI integration in LLM translation testing workflow. Updated commit SHA retrieval method, improved pipeline search logic, and refined artifact downloading process. Added checks for test workflows and job statuses, with placeholder results creation if no artifacts are found. Updated artifact upload step for clarity. 2025-06-26 10:06:30 -06:00
Cole McIntosh d5d0dfc26f Add GitHub Actions workflow for LLM translation testing artifacts 2025-06-26 10:05:33 -06:00
Ishaan JaffandGitHub 22ff3da3cf [Fix] Allow using HTTP_ Proxy settings with trust_env (#12066)
* allow using trust_env

* add docs on how to use HTTP_PROXY

* docs AIOHTTP_TRUST_ENV

* test_aiohttp_transport_trust_env_setting

* docs fix
v1.73.2-nightly
2025-06-26 08:37:22 -07:00
Cole McIntoshandGitHub 327405ffae Merge pull request #12050 from colesmcintosh/docs/elasticsearch-logging-tutorial
Fix Elasticsearch tutorial image rendering
2025-06-26 09:00:00 -06:00
Krrish Dholakia 23018bd0a2 build(pyproject.toml): bump version 2025-06-26 07:58:29 -07:00
Ishaan Jaff f8f9e2299b docs latency headers 2025-06-26 07:58:23 -07:00
Ishaan Jaff bb86619605 Revert "Revert "add google generate content to call types""
This reverts commit b2d4462ab5.
2025-06-25 22:43:07 -07:00
Krrish Dholakia c3857e60f2 Store batch output file id in DB + Store batch file status in DB + (experimental) BATCH API COST TRACKING 2025-06-25 22:41:22 -07:00
Ishaan Jaff 329f8ec7a6 docs gemini cli 2025-06-25 22:39:50 -07:00
Ishaan Jaff bca94535da docs gemini cli 2025-06-25 22:31:47 -07:00
Ishaan Jaff 5ebdb58115 bump: version 1.73.2 → 1.73.3 2025-06-25 22:26:59 -07:00
Ishaan Jaff b2d4462ab5 Revert "add google generate content to call types"
This reverts commit 6f57dde293e50674c8fca0feac6e01c27d9e1c96.
2025-06-25 22:26:34 -07:00
Ishaan JaffandGitHub 5b8e300150 [Feat] gemini-cli integration - Add Logging + Cost tracking for stream + non-stream Vertex / Google AI Studio routes (#12058)
* add google generate content to call types

* Revert "add google generate content to call types"

This reverts commit 6f57dde293e50674c8fca0feac6e01c27d9e1c96.

* add CallTypesLiteral for gemini

* allow passing model to vertexpass through logging handler

* update logging handler

* fix checking if stream

* add async streaming logging for vtx

* refactor _transform_google_generate_content_to_openai_model_response

* fix logging_obj

* fixes _handle_non_streaming_google_genai_generate_content_response_logging

* logging callback tests

* ruff check fixes

* test _is_streaming_request

* test_ensure_initialize_azure_sdk_client_always_used

* fix BaseGoogleGenAIGenerateContentStreamingIterator

* fix - linting errors

* req - add google-genai
2025-06-25 22:26:20 -07:00
Krish DholakiaandGitHub 1a7fd1d1c7 Litellm dev 06 25 2025 p2 (#12049)
* test(test_router.py): initial unit test confirming router.afile_content uses dynamic api key / api base

* fix(managed_files.py): filter deployments for only those within file id mapping

ensure call works - only route to models where the file was written

* fix(proxy_server.py): fix loading in model ids from config, if config id is int

* fix(router.py): return all model file id mappings on create_file

if multiple deployments - this ensures all the file id mappings are bubbled up

Fixes issue when trying to use loadbalanced deployments - only 1 file id mapping was being stored

* feat(router_utils/common_utils.py): filter models by team id when selecting for routing

Prevents team only models from being used by other teams

* fix(common_utils.py): additional fixes around filtering team-based models

* fix(batches_endpoints/endpoints): support list batches with target model names specified

* fix(common_utils.py): more testing for team deployment filters
2025-06-25 21:54:13 -07:00
Krish DholakiaandGitHub e2f6fb2d7c Managed Files + Batches - filter deployments to only those where file was written + save all model file id mappings in DB (prev just 1st one) (#12048)
* test(test_router.py): initial unit test confirming router.afile_content uses dynamic api key / api base

* fix(managed_files.py): filter deployments for only those within file id mapping

ensure call works - only route to models where the file was written

* fix(proxy_server.py): fix loading in model ids from config, if config id is int

* fix(router.py): return all model file id mappings on create_file

if multiple deployments - this ensures all the file id mappings are bubbled up

Fixes issue when trying to use loadbalanced deployments - only 1 file id mapping was being stored
2025-06-25 21:27:06 -07:00
Ishaan Jaff de86246e14 test fixes 2025-06-25 18:42:06 -07:00
Ishaan JaffandGitHub 14d05fe422 [Feat] Add gemini-cli support - call VertexAI models through LiteLLM Native gemini routes (#12053)
* init litellm google gen ai methods

* feat init structure of functions for generate content

* add init

* add BaseGoogleGenAIGenerateContentConfig

* add generate_content_handler

* add get_provider_google_genai_generate_content_config

* fixes for generate content

* add get_vertex_ai_project etc to base

* use VertexBase

* fixes for BaseGoogleGenAIGenerateContentConfig

* working validate env for google gemini

* feat - add transform google response

* fixes for transform_generate_content_request

* fix get_supported_generate_content_optional_params

* add BaseGoogleGenAITest

* working e2e test

* fixes init config

* use correct types

* fix test for google gen ai

* fix types

* add sync_get_auth_token_and_url

* fixes for transform

* add llm http handler for google

* working non-streaming google endpoints

* add BaseGoogleGenAIGenerateContentStreamingIterator

* add GoogleGenAIGenerateContentStreamingIterator

* fix working sync stream

* fixes for litellm logging obj

* working async streaming

* add google gen ai types

* fix - required imports

* fix readme

* fix deps

* fix deps

* fix ruff code QA checks

* fix linting

* fixes TYPE_CHECKING

* fixes for typing

* add google gemini methods to litellm router

* [Feat] Add initial endpoints for using Gemini SDK (gemini-cli) with LiteLLM (#12040)

* init with google endpoints

* add Depends

* feat - add gemini endpoints

* google_generate_content

* fix init

* fixes import

* fixes for streaming

* fixes for sync/async

* working streaming with google gemini cli

* add google endpoints to llm api routes

* add VertexAIGoogleGenAIConfig

* use aiter_bytes

* use common request for streaming data

* re-use logic for anthropic streaming

* add GoogleAIStudioDataGenerator
2025-06-25 18:39:25 -07:00
Ishaan JaffandGitHub 35e46784d3 [Feat] Add Support for calling Gemini/Vertex models in their native format (#12046)
* init litellm google gen ai methods

* feat init structure of functions for generate content

* add init

* add BaseGoogleGenAIGenerateContentConfig

* add generate_content_handler

* add get_provider_google_genai_generate_content_config

* fixes for generate content

* add get_vertex_ai_project etc to base

* use VertexBase

* fixes for BaseGoogleGenAIGenerateContentConfig

* working validate env for google gemini

* feat - add transform google response

* fixes for transform_generate_content_request

* fix get_supported_generate_content_optional_params

* add BaseGoogleGenAITest

* working e2e test

* fixes init config

* use correct types

* fix test for google gen ai

* fix types

* add sync_get_auth_token_and_url

* fixes for transform

* add llm http handler for google

* working non-streaming google endpoints

* add BaseGoogleGenAIGenerateContentStreamingIterator

* add GoogleGenAIGenerateContentStreamingIterator

* fix working sync stream

* fixes for litellm logging obj

* working async streaming

* add google gen ai types

* fix - required imports

* fix readme

* fix deps

* fix deps

* fix ruff code QA checks

* fix linting

* fixes TYPE_CHECKING

* fixes for typing
2025-06-25 18:37:03 -07:00
Cole McIntosh f9ef45474b Fix Elasticsearch tutorial image rendering
- Replace markdown image syntax with React Image component
- Import @theme/IdealImage for proper image rendering in Docusaurus
- Addresses PR feedback to fix image display issues
2025-06-25 16:27:14 -06:00
Cole McIntoshandGitHub 7809b07dd6 Merge branch 'BerriAI:main' into docs/elasticsearch-logging-tutorial 2025-06-25 16:20:05 -06:00
Cole McIntoshandGitHub 51c1c7bd36 Add Elasticsearch Logging Tutorial (#11761)
* docs: add Elasticsearch logging tutorial and update sidebar

* docs: update Elasticsearch logging tutorial to include OpenTelemetry setup and configuration

* docs: remove sections from Elasticsearch logging tutorial

* docs: remove analytics examples from Elasticsearch logging tutorial

* Update Elasticsearch version and logging exporter configuration in the Elasticsearch logging tutorial

* Add visualization instructions for LLM telemetry data in Kibana to Elasticsearch logging tutorial

* Add Elasticsearch demo image to documentation

* Move demo image for Elasticsearch logging tutorial
2025-06-25 15:17:37 -07:00
Cole McIntosh 9111b67950 Move demo image for Elasticsearch logging tutorial 2025-06-25 16:14:27 -06:00
Ishaan JaffandGitHub 8d78519adb [Feat] Add initial endpoints for using Gemini SDK (gemini-cli) with LiteLLM (#12040)
* init with google endpoints

* add Depends
2025-06-25 15:12:25 -07:00
Cole McIntosh b3aa8c980e Add Elasticsearch demo image to documentation 2025-06-25 16:11:41 -06:00
Cole McIntosh c218b62822 Add visualization instructions for LLM telemetry data in Kibana to Elasticsearch logging tutorial 2025-06-25 16:11:32 -06:00
Cole McIntoshandGitHub d7568a37f0 Merge branch 'BerriAI:main' into docs/elasticsearch-logging-tutorial 2025-06-25 15:42:18 -06:00
Cole McIntosh cdf95f5f2c Enhance UsageDatePicker component by adding time range display and improving timezone handling for date selections. Default time range visibility is set to true, ensuring better user experience in usage dashboards. 2025-06-25 11:28:35 -06:00
Cole McIntosh 102680d0ed Refactor date handling in ModelDashboard to use startTime and endTime directly, improving clarity and consistency in metric data retrieval. 2025-06-25 11:28:24 -06:00
Cole McIntosh 3f644602fb Refactor date range selection in dashboards to use UsageDatePicker component, simplifying date handling logic and improving consistency across components. 2025-06-25 11:16:01 -06:00
Cole McIntosh 52e51ead03 Add UsageDatePicker component for usage dashboards 2025-06-25 11:14:48 -06:00
tanjiroandGitHub 2a6dab0d23 aggregate the data across all pages (#12033) 2025-06-25 09:54:41 -07:00
Cole McIntoshandGitHub 445227371a Merge branch 'BerriAI:main' into fix-today-selector-date-mutation-bug 2025-06-25 10:51:53 -06:00
Ishaan JaffandGitHub d98a9ae424 [Fix] Router - cooldown time, allow using dynamic cooldown time for a specific deployment (#12037)
* fixes header_cooldown

* test_deployment_callback_respects_cooldown_time
2025-06-25 08:46:27 -07:00
Cole McIntosh f8e162a084 docs(GEMINI.md): add development guidelines and architecture overview for Gemini project 2025-06-25 08:22:15 -06:00
Krish DholakiaandGitHub 1a4ad8bf18 Update mistral 'supports_response_schema' field + Fix ollama embedding (#12024)
* build(model_prices_and_context_window.json): update all mistral models (besides codestral-mamba) to indicate support for response schema

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

* fix(route_llm_request.py): if llm router is not initialized, go straight through to litellm sdk

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

* test: add unit test

* fix(ollama_embeddings): fix unecessary await

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

* test: update ollama embedding tests
2025-06-25 07:20:13 -07:00
Krish DholakiaandGitHub 24c2cd1bd9 Anthropic /v1/messages - Custom LLM Server support (#12016)
* fix(handler.py): support routing custom llm's to chat completion handler

Adds custom llm support for anthropic

* test(test_anthropic_experimental_pass_through_messages_handler.py): add unit test confirming custom llm respected

* docs(custom_llm_server.md): document anthropic custom llm translation

* test(volcengine.py): map thinking in extra body

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

* feat(main.py): support `azure/responses/<deployment-name>` model string

this allows us to route the model correctly

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

* docs(azure_responses.md): document calling azure responses api models via chat completions bridge

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

* fix: fix custom provider check

* test: update tests
2025-06-24 22:00:44 -07:00
Krish DholakiaandGitHub ac15ca3014 Teams - Support default key expiry + UI - support enforcing access for members of specific SSO Group (#12023)
* fix(team_endpoints.py): support setting default key expiry

allows admin to set key expiry on all team member keys

makes it easier to setup default team for experimentation

* feat(key_management_endpoints.py): allows admin to set duration for keys created by team members

* feat(team_endpoints.py): support team_member_key_duration on `/team/update`

allows setting max time team member keys are valid for

* fix(team_info.tsx): ui component to update team member key duration

* fix(team_info.tsx): support updating team member key duration, if set

* feat(teams.tsx): add team member key duration param ui component

allow admin to set this on UI

* feat(ui_sso.py): support restricting ui access by sso group

allows controlling who can/can't access the UI

* feat(ssomodals.tsx): add initial commit adding sso group access to admin ui

* feat(proxy_server.py): support reading + writing ui_access_mode from db

allows admin to configure allowed sso groups from UI

* feat(ui_sso.py): support enforcing all teams on sso jwt handler

if ui access mode set via ui, support reading the value and enforcing it

* feat(ui/): ui component for controlling sso access group

allow admin to only allow users within specific sso group to log into UI

* fix(uiaccesscontrolform.tsx): fix field names

* feat(ui_sso.py): return received sso response in the clientside error message - enables easier debugging

* test: add unit tests

* fix: minor fixes
2025-06-24 21:58:07 -07:00
Cole McIntoshandGitHub 15dabf6573 docs(CLAUDE.md): add development guidance and architecture overview for Claude Code (#12011) 2025-06-24 20:48:08 -07:00
Ishaan JaffandGitHub d6cc384780 [Feat] OpenAI/Azure OpenAI - Add support for creating vector stores on LiteLLM (#12021)
* add create/acreate vector store

* add azure config

* add _base_validate_azure_environment

* fix base test

* add get_base_create_vector_store_args

* use base llm for headers responses api

* add _get_base_azure_url

* fix AzureOpenAIVectorStoreConfig

* TestAzureOpenAIVectorStore

* fix azure openai vector store

* fix test comment

* fix unused imports

* test_validate_environment_azure_api_key_within_secret_str

* test_azure_transformation.py
2025-06-24 20:46:48 -07:00
Ishaan JaffandGitHub 2bb8048864 [Feat] Add OpenAI Search Vector Store Operation (#12018)
* add BaseVectorStoreTransformation

* fix BaseVectorStoreTransformation

* add OpenAIVectorStoreTransformation

* fix transform

* add search, asearch vector stores

* add skeleton for vector store searching

* fix VectorStoreSearchOptionalRequestParams

* fix VectorStoreRequestUtils

* fix litellm.asearch/litellm.search

* fix BaseVectorStoreConfig

* add vector_store_search_handler to llm http handler

* use llm http handler for searching vector stores

* fix base vector store config

* fix vector_store_search_handler

* async_vector_store_search_handler

* add conftest

* add BaseVectorStoreTest

* move litellm.integrations.vector_store_integrations

* fix working OAI OpenAIVectorStoreConfig

* add Search vector store

* add OpenAI Vector Stores
2025-06-24 15:52:43 -07:00
Cole McIntoshandGitHub 97da33494a Refactor unpack_defs to use iterative approach instead of recursion (#12017)
* Refactor unpack_defs to use iterative approach instead of recursion

- Replace recursive depth-first traversal with iterative queue-based approach
- Add collections.deque import for efficient queue operations
- Avoid potential stack overflow issues with deeply nested schemas
- Maintain same functionality while improving performance and safety

* Remove unused import of Set in common_utils.py

* Enhance type hinting for queue in unpack_defs function in common_utils.py

* Enhance unpack_defs function to handle key validation for parent structures in common_utils.py

- Added checks to ensure that the parent is a dictionary or list and that the key is of the appropriate type (string for dicts, integer for lists) before assigning the resolved schema.
- This improves the robustness of the unpack_defs function when dealing with various schema structures.
2025-06-24 15:38:48 -07:00
Ishaan JaffandGitHub 1467a99aab [Fix] Magistral small system prompt diverges too much from the official recommendation (#12007)
* fix mistral _get_mistral_reasoning_system_prompt

* fix test_get_mistral_reasoning_system_prompt
2025-06-24 13:45:58 -07:00
Cole McIntosh ca96e39229 Update package-lock.json to include @anthropic-ai/sdk version 0.54.0 2025-06-24 14:29:14 -06:00
Cole McIntosh c42a876735 Fix date mutation bug causing 'Today' selector to return no data
- Create new Date objects instead of mutating original DateRangePicker dates
- Fixes issue where first API call would mutate dateValue.from/to causing
  subsequent calls to use corrupted date ranges
- Updated usage.tsx, cache_dashboard.tsx, and model_dashboard.tsx
- Minimal change preserving original timezone logic
2025-06-24 14:28:52 -06:00
Krrish Dholakia 8da22be199 docs(self_serve.md): update doc 2025-06-24 13:25:17 -07:00
Krrish Dholakia c9a8198d12 docs(self_serve.md): clarify team must be created before setting as default team 2025-06-24 13:24:23 -07:00
Ishaan JaffandGitHub b9feb43dac [Bug Fix] SCIM - Ensure new user roles are applied (#12015)
* SCIM fix new user roles

* test_create_user_defaults_to_viewer

* test_create_user_uses_default_internal_user_params_role

* fix default user for SCIM

* fix linting error
2025-06-24 13:22:56 -07:00
Marty SullivanandGitHub a5ce1cd49b add azure o3-pro pricing (#11990) 2025-06-24 10:57:24 -07:00
shagunb-acnandGitHub dd38e80471 #response_format NVIDIA-NIM add response_format to OpenAI parameters mapping (#12003) 2025-06-24 09:44:35 -07:00