Commit Graph

1960 Commits

Author SHA1 Message Date
Krish Dholakia 1995c7aad5 fix(utils.py): support non default params for audio transcription (#11212)
* fix(utils.py): support non default params for audio transcription

allows passing provider specific params straight through on transcription calls

* fix(gpt_transformation.py): fix o_series model routing

call _transform_request on async event

* refactor: refactor tests

* test(test_azure_chat_o_series_transformation.py): add unit test for azure o series error

* test: update test

* test: update json

* fix: fix mutiple keyword error
2025-05-28 22:24:02 -07:00
Krish Dholakia ba39f9e360 Helicone base url support + fix for embedding cache hits on str input (#11211)
* fix(helicone.py): add helicone api base support

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

* test: add unit test for cache hit response on embedding calls

* fix(caching_handler.py): fix handling cache hit on embedding when input is string

Fixes LIT-197

* docs(helicone_integration.md): document new helicone api base param
2025-05-28 22:02:55 -07:00
Ishaan Jaff 711c931c71 test: fix test_key_generation_with_object_permission 2025-05-28 21:24:35 -07:00
Ishaan Jaff 4e6c4beef8 [Feat] Permission management vector stores on LiteLLM Key, Team, Orgs (#11213)
* fix: init commit for object permissions

* fix: init commit for object permissions

* fix: add vector_store_id to permissions

* fix vector store selector

* feat:add vector store permission mgmt

* feat: ui add allowed vector stores dropdown

* feat: add new vector store object permissions

* testing: key mgmt

* fix: stor vector store permissions on team

* ui select vector store for teams

* ui add vector store settings for orgs

* feat: allow setting org vector store permissions

* test: adding team permissions for vector stores
2025-05-28 16:58:53 -07:00
Vinnie-Singleton-NN 178a614d4a Add sentry sample rate (#10283)
* Add SENTRY_API_SAMPLE_RATE configuration option for Sentry SDK

* removed print line

* Update Sentry documentation with sample rate information

---------

Co-authored-by: Vinnie <vinnie@Vinnies-MacBook-Pro.local>
2025-05-28 16:44:10 -07:00
Ishaan Jaff 9a6d5c119e feat: Allow Adding MCP Servers Through LiteLLM UI (#11208)
* feat: MCP Servers with CRUD operations (#10699)

* feat: mcp CRUD operations with authn/authz

* feat: mcp server UI

* mcp server page with overview, mcp tools, and settings page

* Adding MCP Server flow

* prisma generate before test

* UI callbacks add/remove with api server refetch

* test fix: poetry run prisma

* feat: mcp server db and config connection

* fix: MCPTool filter on description when not present

* feat: mcp on UI and integrated with list tools

* feat: Update mcp server endpoint

* tests: Unit and integration tests for mcp management endpoints

* fix: docs and ensuring global_mcp_manage up to date

* ui: remove the mcp tools view

* fix: ruff lint

* fix: unit -> integration test area

* fix(ui): remove left nav menu of previous tools

---------

Co-authored-by: wagnerjt <wagnerjt@github.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>

* fix: sync DB MCP tools with in memory

* fix: sync DB MCP tools with in memory

* fix: stop using prisma.models

* fix: code qa check

* fix: import MCP

* fix: code QA checks

* fix: code QA checks

* fixes - only list tools for the specific MCP server

* fix: only list MCP tools for selected server

* fix linting error

---------

Co-authored-by: Tyler Wagner <wagnerjt@users.noreply.github.com>
Co-authored-by: wagnerjt <wagnerjt@github.com>
2025-05-28 16:29:27 -07:00
Niko Izsak 85525c5c6b Azure OIDC provider improvements + OIDC audience bug fix (#10054)
* added support for custom scope in get_azure_ad_token_provider

* if AZURE_FEDERATED_TOKEN_FILE not set, use azure_token_provider to retrive token with the oidc audiances as scope

* fix bug where oidc audience that contains "/" won't be extract correctly

* added tests for get_secret with oidc

* moved tests to litellm tests folder

* tes file naming aligned with source code

* renamed test_main because it caused issue in the test in github workflow

* updated docs

* moved docs to the end of file

* fix aws region in example config

* renamed test file

* added support for custom scope in get_azure_ad_token_provider

* if AZURE_FEDERATED_TOKEN_FILE not set, use azure_token_provider to retrive token with the oidc audiances as scope

* fix bug where oidc audience that contains "/" won't be extract correctly

* added tests for get_secret with oidc

* moved tests to litellm tests folder

* tes file naming aligned with source code

* renamed test_main because it caused issue in the test in github workflow

* updated docs

* moved docs to the end of file

* fix aws region in example config

* renamed test file

* fix merge conflict resolution error

* added support for custom scope in get_azure_ad_token_provider

* if AZURE_FEDERATED_TOKEN_FILE not set, use azure_token_provider to retrive token with the oidc audiances as scope

* fix bug where oidc audience that contains "/" won't be extract correctly

* added tests for get_secret with oidc

* moved tests to litellm tests folder

* tes file naming aligned with source code

* renamed test_main because it caused issue in the test in github workflow

* updated docs

* moved docs to the end of file

* fix aws region in example config

* renamed test file

* added tests for get_secret with oidc

* moved tests to litellm tests folder

* tes file naming aligned with source code

* renamed test_main because it caused issue in the test in github workflow

* updated docs

* moved docs to the end of file

* renamed test file

* fix merge conflict resolution error
2025-05-28 09:33:13 -07:00
Krish Dholakia 05e0a6d8d5 Return anthropic thinking blocks on streaming + VertexAI Minor Fixes & Improvements (Thinking, Global regions, Parallel tool calling) (#11194)
* fix(anthropic/chat/handler.py): Fixes https://github.com/BerriAI/litellm/issues/10328

Adopts changes from https://github.com/BerriAI/litellm/pull/10329

* fix(vertex_and_google_ai_studio.py): don't set 'include thoughts' if thinking budget = 0

VertexAI raises errors

* fix(vertex_llm_base.py): new function for deciding the api base, handles 'global' api base

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

* fix(vertex_ai/partner_models): fix instrumentation for custom api base check

* refactor(vertex_ai/partner): refactor function to keep below 50 LOC

* fix(vertex_ai/gemini): remove parallel tool calls error for >1 tool - just ignore (prevent call from failing)

* fix: fix linting error
2025-05-27 23:07:13 -07:00
RMeans d181138ad5 Add Pangea provider to Guardrails hook (#10775)
* added Pangea as a guardrail vendor

* Adding output recipe, cleaning up some imports

* Add Pangea guardrails tests

* Add docs and sidebar

* Move to use async_precall_hook instead of moderation hook

* Update to "new" format (accept mode)

Add response for redaction, support transforming request / response
based off the original type of call (/v1/completions,
/v1/chat/completions)

* Fix tests

* Fix unused imports

* Fix .md

---------

Co-authored-by: michael weinberger <michael.lee.weinberger@gmail.com>
2025-05-27 22:01:28 -07:00
Krish Dholakia 7072466775 VertexAI - codeExecution tool support + anyOf handling (#11195)
* fix(vertex_and_google_ai_studio_gemini.py): handle both camel case and underscores in the tool for vertex ai code execution

support vertex ai code execution

* docs(vertex.md): add code execution example to vertex ai

* fix(vertex_ai/common_utils.py): when anyof in field, just select anyof - don't include other k,v pairs - vertex throws error

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

* fix(common_utils.py): add title field inside anyof - to retain some description

Addresses https://github.com/BerriAI/litellm/issues/11164#issuecomment-2914728385
2025-05-27 21:23:14 -07:00
Krrish Dholakia 40a4e97d8e test: update test 2025-05-27 21:15:22 -07:00
Ishaan Jaff 1a17755c60 test: fix test_ensure_initialize_azure_sdk_client_always_used 2025-05-27 19:02:11 -07:00
Ishaan Jaff 6c36dc269b test: fix test_vertexai_model_garden_model_completion 2025-05-27 18:51:50 -07:00
Ishaan Jaff a76d991952 [Fix]: Add cost tracking for image edits endpoint [OpenAI, Azure] (#11186)
* fix: add cost tracking for image edits

* fix: add cost tracking for azure image edits

* fix: fix linting error

* fix: fixes for background param

* fix: image edit test fixes

* fix: openai image edit cost tracking
2025-05-27 17:52:15 -07:00
Krrish Dholakia 95de41d10c build: publish new litellm-proxy-extras file 2025-05-27 17:44:23 -07:00
Ishaan Jaff 0590b1eb3a [Fix] Prometheus Metrics - Do not track end_user by default + expose flag to enable tracking end_user on prometheus (#11192)
* fix: testing for disabling end user on metrics

* fix: fixes for test_prometheus_factory

* Delete litellm/model_prices_and_context_window_backup.json

* fix: issues with merge conflicts

* fix: test_get_end_user_id_for_cost_tracking_prometheus_only

* Update tests/test_litellm/integrations/test_prometheus.py

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-27 17:06:58 -07:00
Krish Dholakia 4c82dd9b27 Ollama Chat - parse tool calls on streaming (#11171)
* fix(user_api_key_auth.py): fix else block

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

* refactor(ollama/chat): refactor to base config pattern

easier to maintain fixes

* fix(ollama/chat): support tool call parsing on streaming

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

* test: update import location

* fix: cleanup unused import

* fix: fix ruff check error

* test: update import

* test: update test on ci

* ci: cleanup

* fix: fix chekc

* fix: fix api key check order

* test: fix import

* ci: fix script

* test: fix imports

* fix: fix tests
2025-05-27 16:14:49 -07:00
Krish Dholakia 64096aeb1e Codestral - return litellm latency overhead on /v1/completions + Add '__contains__' support for ChatCompletionDeltaToolCall (#10879)
* feat(codestral/completion): return litellm latency overhead for codestral

enables easier debugging of latency issues

* fix(types/utils.py): support _response_ms on hidden params model dump

Fixes issue where 'x-litellm-overhead-duration-ms' wasn't being returned on text c
ompletion calls

* fix(types/utils.py): add '__contains__' support for chatcompletiondeltatool call

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

* fix: fix linting error

* fix: fix linting error
2025-05-27 16:13:44 -07:00
Akim Tsvigun acaa80294c Integration with Nebius AI Studio added (#11143)
* integration with Nebius AI Studio added

* Merged with main

* Reviewer's comments resolved

* spelling error fixed

* accidental change reverted
2025-05-27 11:05:22 -07:00
Ishaan Jaff 215fa133d6 [Fix] - Duplicate maxTokens parameter being sent to Bedrock/Claude model with thinking (#11181)
* fix: using thinking with bedrock models

* fix: using thinking with bedrock models
2025-05-27 08:16:39 -07:00
Krrish Dholakia 54fe927da7 test: fix imports 2025-05-26 22:06:53 -07:00
Krrish Dholakia 0017d5f1db build(ui/): Allow empty values in daily agg table + reintroduce 'unassigned' teams in spend tracking 2025-05-26 22:03:34 -07:00
Krish Dholakia 066a502b89 Litellm dev 05 26 2025 p1 (#11165)
* fix(utils.py): prevent leaking sensitive keys to langfuse

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

* test(langfuse/): unit test preventing future bedrock key leaks

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

* test(test_langfuse_e2e_test.py): add unit test for vertex - make sure no key leaks occur

* ci(test-litellm.yml): add pytest retry to github workflow

* fix(proxy_server.py): support forwarding `/sso/key/generate` to the server root path url

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

* fix(proxy_server.py): don't rewrite absolute path (PROXY_BASE_URL) with relative path (SERVER_ROOT_PATH)

This causes issues when using a custom path with sso, when doing redirects

* fix(utils.py): ignore token - will mistakenly redact 'max_tokens' as well
2025-05-26 22:00:48 -07:00
Ishaan Jaff 4d2edc4e7a [Fixes] Aiohttp transport fixes - add handling for aiohttp.ClientPayloadError and ssl_verification settings (#11162)
* fix: AiohttpResponseStream transport

* fix: use AiohttpResponseStream transport by default

* fix: AiohttpResponseStream transport

* fixes: mapping aiohttp exceptions

* fixes: aiohttp rollout

* fixes: add support ssl_verify for aiohttp

* fixes: add support ssl_verify for aiohttp

* fixes: remove duplicates
2025-05-26 21:14:35 -07:00
Ishaan Jaff e606bfe31d [Feat - Contributor PR] Add Video support for Bedrock Converse (#11166)
* feat: add video support for bedrock converse api (#11043)

* fixes: bedrock add video support

* fixes: bedrock add video support

---------

Co-authored-by: yytdfc <fuchen@foxmail.com>
2025-05-26 20:17:07 -07:00
Krish Dholakia ef42461c1e Litellm fix GitHub action testing (#11163)
* test: add __init__.py files

* refactor: rename test folder to avoid naming conflict

* test: update workflows

* test: update tests

* test: update imports

* test: update tests

* test: remove unused import

* ci(test-litellm.yml): add pytest retry to github workflow

* test: fix test
2025-05-26 14:41:42 -07:00
Ishaan Jaff 1876b3ae35 [Fix] Rollback to httpx==0.27.0 (#11146)
* fix - fix - use old httpx version

* fix - fix - use old httpx version

* fix: test

* fix: comment
2025-05-26 10:44:11 -07:00
Ishaan Jaff 1009defbdc [Feat] Add /image/edits support for Azure (#11160)
* feat: add image edits on litellm router

* feat: add image edits endpoint

* fix: use pure async for image edits

* fix: base_process_llm_request

* fix: get_image_content_type

* feat: add image edits endpoint

* add image edits on UI

* test: image edits support

* fix: linting errors

* fix: linting errors

* test fix img gen

* feat: azure image edits

* fix: fix url construction of azure image edits

* fix: mock endpoints for azure images
2025-05-26 10:37:48 -07:00
Adam Holmberg c93a78cd6c feat: Make gemini accept the openai parameter parallel_tool_calls (#11125)
* feat: Make gemini accept the openai parameter parallel_tool_calls

When mapping, allow the parameter: True because that is the
intrinsic behavior of Gemini. Allow False, but reject if there
are multiple tools because there's no actual equivalent in Gemini.

fixes #9686

ref: issues/9686

* chore: cleanup and move test_vertex.py down to tests/litellm

as suggested in https://github.com/BerriAI/litellm/pull/11125#discussion_r2105905871
2025-05-26 07:51:27 -07:00
Krish Dholakia a78d121ef4 Litellm fix multi instance checks on teams (#11137)
* fix(auth_checks.py): set ttl on in-memory team objects

ensures objects expire

* fix(in_memory_cache.py): allow ttl override if existing ttl expired (no 'get_cache' ever called)
2025-05-24 20:33:06 -07:00
Ishaan Jaff cd3e01ea4a test fixes 2025-05-24 19:27:30 -07:00
Ishaan Jaff 59fd3d5fd9 test test fixes 2025-05-24 19:17:39 -07:00
Ishaan Jaff 16c92c2e61 test fix test_ssl_context_transport 2025-05-24 18:52:23 -07:00
Krish Dholakia 33d5f66387 Litellm revert redis changes (#11135)
* fix: revert user redis changes

* fix(in_memory_cache.py): don't reset ttl, if already set for object

Allows objects to expire and db checks to occur

* test: add unit test for change
2025-05-24 17:52:57 -07:00
Krrish Dholakia 1cd97e41e9 test: update tests 2025-05-24 12:26:31 -07:00
Krish Dholakia 010a4d44af Fix passing standard optional params (#11124)
* fix(main.py): use processed non-default-params as standard input params for langfuse

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

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

* fix(main.py): rename variable to be more accurate

* test(test_langfuse_e2e_test.py): add router unit test for langfuse e2e testing

Prevent https://github.com/BerriAI/litellm/issues/11072 from happening again

* build: update lock

* fix(utils.py): refactor optional params function

make it easier to get the standardized non default params

* fix(utils.py): improve process non default params function

* fix(main.py): include provider specific params in processed non default params used in logging

ensures user can see any provider specific params on langfuse

 ensures user can see any provider specific params on langfus e
2025-05-24 12:12:31 -07:00
Adam Holmberg c58a0bb124 fix: detect and return status codes in streaming responses (#10962)
For streaming requests, the remote request is triggered and
first chunk inspected for an error code as emitted by
async_data_generator.

Potential fix for #9035
2025-05-24 12:04:46 -07:00
Krish Dholakia d7985f36d7 Correctly delete team model alias when team only model is deleted (#… (#11121)
* Correctly delete team model alias when team only model is deleted  (#10933)

* fix(model_management_endpoints.py): if team model deleted - remove the alias routing

Fixes issue where alias would cause incorrect routing to occur

* fix(model_management_endpoints.py): remove model name from team on team model delete

prevents misrouting

* fix(vertex_llm_base.py): remove quota_project_id parameter from credential refresh request (#10915)

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

* Enable structured JSON schema outputs in LM Studio (for validated responses) (#10929)

- docs/my-website/docs/providers/lm_studio.md: add Structured Output section with JSON schema and Pydantic examples
- litellm/llms/lm_studio/chat/transformation.py: extend map_openai_params to handle `response_format` mappings (`json_schema`, `json_object`) and move them to optional_params
- litellm/utils.py: include `LM_STUDIO` in `supports_response_schema` list
- tests/litellm/llms/lm_studio/test_lm_studio_chat_transformation.py: add tests for Pydantic model and dict-based JSON schema handling

Co-authored-by: Earl St Sauver <estasuver@gmail.com>

* update sambanova models and parameters (#10900)

* add sambanova to completion input params table

* update sambanova supported args

* update sambanova supported models

* minor changes

* fix sambanova model list

* update sambanova models

* update sambanova models

* update sambanova docs

* minor chnage sambanova url

* update type to match OpenAIGPTConfig

* minor change

* fix cohere rerank provider (#10822)

* add skip server startup flag to cli (#10665)

* add flag

* fix ruff linting

* add unit test

* fix  ruff errors

* fix lintings issues

* fix linting errors

* add global noqa for print

* Allow passed in vertex_ai credentials to be authorized_user type (#10899)

* fix: handle DB_USER, DB_PASSWORD, DB_HOST problem I faced, since this… (#10842)

* fix: handle DB_USER, DB_PASSWORD, DB_HOST problem I faced, since this could be with special character, so better be url encoded, similar problem also happen in DATABASE_URL

* test: added the test cases

* add: test case of url with sepcial character

* add keys and members (#10950)

* Update github.md (#10946)

Updated clarification in the use of the models form github. (Github uses the model name: <company>/<model-Name> while litellm wants github/<model-Name>

Updated the example to a model that is actually supported / available on github right now

* Add new documentation files for LiteLLM (#10961)

- Created `llms-full.txt` with comprehensive details on LiteLLM features, usage, and supported models.
- Added `llms.txt` for quick access to key links and resources related to LiteLLM, including guides, release notes, and integration documentation.

* [Fix] Invitation Email does not include the invitation link (#10958)

* fix: email invites should link to the invitation

* fix: email invites should link to the invitation

* fix: email invites should link to the invitation

* bump: litellm proxy extras

* refactor(vertex_llm_base.py): remove check on credential project id - allow for cross credential calling

* test: update test due to cohere ssl issues

* fix: fix model param mapping

* fix: update test to reflect change

* Enable key reassignment on UI + Show 'updated at' column for key in all keys table  (#10960)

* feat(key_edit_view.tsx): initial commit enabling reassigning keys to teams

* style(key_edit_view.tsx): cleaner implementation with teams in dropdown

* fix(all_keys_table.tsx): set max width to keys column

* feat(all_keys_table.tsx): show last updated at column for key

* test: update tests

* Litellm dev 05 19 2025 p3 (#10965)

* feat(model_info_view.tsx): enable updating model info for existing models on UI

Fixes LIT-154

* fix(model_info_view.tsx): instantly show model info updates on UI

* feat(proxy_server.py): enable flag on `/models` to include model access groups

This enables admin to assign model access groups to keys/teams on UI

* feat(ui/): add model access groups on ui dropdown when creating teams + keys

* refactor(parallel_request_limiter_v2.py): Migrate multi instance rate limiting to OSS

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

* Validate migrating keys to teams + Fix mistral image url on async translation  (#10966)

* feat(key_management_endpoints.py): add validation checks for migrating key to team

Ensures requests with migrated key can actually succeed

Prevent migrated keys from failing in prod due to team missing required permissions

* fix(mistral/): fix image url handling for mistral on async call

* fix(key_management_endpoints.py): improve check for running team validation on key update

* bump: version 1.70.1 → 1.70.2

* test: update test

* build(ui/): new ui build

* add cla to docs (#10963)

* add cla to docs

* cla docs clarity

* build: ui/

new build

* [Fix] List Guardrails - Show config.yaml guardrails on litellm ui  (#10959)

* fix: listing guardrails defined on litellm config

* fix: list guardrails on litellm config

* fix: list guardrails on litellm config

* test: list guardrails on litellm config

* fix: linting

* Update litellm/proxy/guardrails/guardrail_endpoints.py

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

* fix: GuardrailInfoLiteLLMParamsResponse

---------

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

* fix: vertex show clear exception on failed refresh (#10969)

* fix: vertex show clear exception on failed refresh

* fix: show clear debug log

* docs: cleanup

* test: update tests

* test: skip test - model EOL

* [Feature] Add supports_computer_use to the model list (#10881)

* Add support for supports_computer_use in model info

* Corrected list of supports_computer_use models

* Further fix computer use compatible claude models, fix existing test that predated supports_computer_use in the model list

* Move computer use test case into existing test_utils file

* Moved tests in to test_utils.py

* [Feat] - Add Support for Showing Passthrough endpoint Error Logs on LiteLLM UI (#10990)

* fix: add error logging for passthrough endpoints

* feat: add error logging for passthrough endpoints

* fix: post_call_failure_hook track errors on pt

* fix: use constant for MAXIMUM_TRACEBACK_LINES_TO_LOG

* docs MAXIMUM_TRACEBACK_LINES_TO_LOG

* test: ensure failure callback triggered

* fix: move _init_kwargs_for_pass_through_endpoint

* added support to credential delete to support slashes in the curl (#10987)

* added support to credential delete to support slashes in the curl

* add support for get and update too

* Add new gemini preview models + Fix cohere v2 embedding 'embedding_types' param mapping (#10991)

* build(model_prices_and_context_window.json): add new gemini preview models

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

* fix(cohere/embed): Fix encoding format <-> embedding types param mapping

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

* fix(aim.py): fix syntax error

* Litellm add new gemini models (#10998)

* build(model_prices_and_context_window.json): add new gemini image gen model

* build(model_prices_and_context_window.json): add more gemini models

* [Feat] Prometheus - Track `route` on proxy_* metrics (#10992)

* fix: trace route on prometheus metrics

* fix: show route on prometheus metrics for total fails

* test: trace route on metrics

* fix: tests for route in prom metrics

* test: fix test metrics

* test: fix test_proxy_failure_metrics

* fix: default role for JWT authentication   (#10995)

* fix: get_user_object

* test: test_default_internal_user_params_with_get_user_object

* Update litellm/proxy/auth/auth_checks.py

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

---------

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

* fix(internal_user_endpoints.py): allow resetting spend/max budget on … (#10993)

* fix(internal_user_endpoints.py): allow resetting spend/max budget on user update

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

* fix(internal_user_endpoints.py): correctly return set spend for user on /user/new

* fix(auth_checks.py): check redis for key object before checking in-memory

allows for quicker updates

* feat(internal_user_endpoints.py): update cache object when user is updated + check redis on user values being updated

* fix(auth_checks.py): use redis cache when user updated

* fix: set default value of 'expires' to None

* bump: version 1.70.2 → 1.70.3

* Improve response_id propagation logic and add tests for valid/empty ID handling in streaming. (#11006)

* support vertex_ai global endpoints for chat (#10658)

* fix(internal_user_endpoints.py): fix check

* Ollama wildcard support (#10982)

* Add Ollama wildcard support

* Add Ollama-chatas well.

* Fix missing methods.

* Improve logs a bit.

* Add tests

* Add tests

* spend rounded to 4 (#11013)

* fix: fix linting error

* fix(streaming_handler.py): fix check when response id already set

* put organization and team buttons at the top (#10948)

* feat: add xai/grok-3 pricing (#11028)

* [Feat] Add Image Edits Support to LiteLLM (#11020)

* refactor: use 1 file for image methods

* refactor: use 1 file for image methods

* feat: add stubs for image edits

* fix: types for image edits

* feat: add async image edits

* feat: add base config for image edits

* feat: add basic structure for image edits

* feat: add ImageEditRequestUtils

* feat: complete instrumentation of image edits

* tes: test_openai_image_edit_litellm_sdk

* tets: test_openai_image_edit_litellm_sdk

* feat: get_provider_image_edit_config

* feat: add OpenAIImageEditConfig

* feat: working image edits

* fixes: working image edits

* fix: code qa

* fix: using image edits

* fix: linting errors

* Updating the available VoyageAI models in the docs (#11003)

* Refresh VoyageAI models and prices and context

* Refresh VoyageAI models and prices and context

* Refresh VoyageAI models and prices and context

* Updating the available VoyageAI models in the docs

* Updating the available VoyageAI models in the docs

* fix(ui): call tool when no arguments needed (#11012)

Co-authored-by: wagnerjt <wagnerjt@github.com>

* Verbose error on admin add (#10978)

* Spend rounded to 4 for Organizations and Users page (#11023)

* spend rounded to 4

* fixed for organization and users table

* Fix: Handle dict objects in Anthropic streaming response (#11032)

* fix: handle dict objects in Anthropic streaming response

Fix issue where dictionary objects in Anthropic streaming responses
were not properly converted to SSE format strings before being yielded,
causing AttributeError: 'dict' object has no attribute 'encode'

* fix: refactor Anthropic streaming response handling

- Added STREAM_SSE_DATA_PREFIX constant in constants.py
- Created return_anthropic_chunk helper function for better maintainability
- Using safe_dumps from safe_json_dumps.py for improved JSON serialization
- Added unit test for dictionary object handling in streaming response

* fix: correct patch path in anthropic_endpoints test

* feat: add Databricks Llama 4 Maverick model cost (#11008)

Co-authored-by: Tommy PLANEL <tommy.planel2@ubisoft.com>

* test: mark flaky test

* Litellm dev 05 21 2025 p2 (#11039)

* feat: initial commit adding managed file support to fine tuning endpoints

* feat(fine_tuning/endpoints.py): working call to openai finetuning route

Uses litellm managed files for finetuning api support

* feat(fine-tuning/main.py): refactor to use LiteLLMFineTuningJob pydantic object

includes 'hidden_params'

* fix: initial commit adding unified finetuning id support

return a unified finetuning id we can use to understand which deployment to route the ft request to

* test: fix test

* feat(managed_files.py): return unified finetuning job id on create finetuning job

enables retrieve, delete to work with litellm managed files

* test: update test

* fix: fix linting error

* fix: fix ruff linting error

* test: fix check

* Fixes the InvitationLink Prisma find_many query (#11031)

Related: https://github.com/BerriAI/litellm/commit/3b6c6d05dd8f8bcd83f776cdc1c8fc64d3d85d13#r157675103

We should use "order", according to the prisma python docs https://prisma-client-py.readthedocs.io/en/stable/reference/limitations/#order-argument 

Also we are using "order" in other files of the project: 
https://github.com/search?q=repo%3ABerriAI%2Flitellm%20order%3D%7B&type=code

* fix: fix linting error

* Support passing `prompt_label` to langfuse  (#11018)

* fix: add prompt label support to prompt management hook

* feat: support 'prompt_label' parameter for langfuse prompt management

Closes https://github.com/BerriAI/litellm/discussions/9003#discussioncomment-13221555

* fix(litellm_logging.py): deep copy optional params to avoid mutation while logging

* fix(log-consistent-optional-param-values-across-providers): ensures params can be used for finetuning from providers

* fix: fix linting error

* test: update test

* test: update langfuse tests

* fix(litellm_logging.py): avoid deepcopying optional params

might contain thread object

* added cloding tags for </TabGroup> </Col> </Grid> + indentation changes (#11046)

* Feat: add MCP to Responses API and bump openai python sdk (#11029)

* feat: add MCP to responses API

* feat: bump openai version to 1.75.0

* docs MCP + responses API

* fixes: type checking

* fixes: type checking

* build: use latest openai 1.81.0

* fix: linting error

* fix: linting error

* fix: test

* fix: linting errors

* fix: test

* fix: test

* fix: linting

* Revert "fix: linting"

This reverts commit ebb19ff8cb1f8fcc3e224390e351676daccb33de.

* fix: linting

* Model filter on logs (#11048)

* add model filter

* remove calling all models

* bump: version 1.70.3 → 1.70.4

* docs fix ad hoc recognizer

* docs fix example

* [Feat] Add claude-4 model family  (#11060)

* add new claude-sonnet-4-2025051

* feat: add bedrock claude-4 models

* add bedrock claude-4 models

* add vertx_ai/claude-sonnet-4

* fix provider=bedrock_converse

* feat: ensure thinking is supported for claude-4 model family

* docs add claude-4 models

* Revert "Support passing `prompt_label` to langfuse  (#11018)"

This reverts commit 2b50b43ae2.

* Revert "Revert "Support passing `prompt_label` to langfuse  (#11018)""

This reverts commit 0be7e7d088.

* fix: fix checking optional params from logging object for function call

* test: update groq test - change on their end

* Litellm managed file updates combined (#11040)

* Add LiteLLM Managed file support for `retrieve`, `list` and `cancel` finetuning jobs (#11033)

* feat: initial commit adding managed file support to fine tuning endpoints

* feat(fine_tuning/endpoints.py): working call to openai finetuning route

Uses litellm managed files for finetuning api support

* feat(fine-tuning/main.py): refactor to use LiteLLMFineTuningJob pydantic object

includes 'hidden_params'

* fix: initial commit adding unified finetuning id support

return a unified finetuning id we can use to understand which deployment to route the ft request to

* test: fix test

* feat(managed_files.py): return unified finetuning job id on create finetuning job

enables retrieve, delete to work with litellm managed files

* feat(managed_files.py): support managed files for cancel ft job endpoint

* feat(managed_files.py): support managed files for cancel ft job endpoint

* feat(fine_tuning_endpoints/endpoints.py): add managed files support to list finetuning jobs

* feat(finetuning_endpoints/main): add managed files support for retrieving ft job

Makes it easier to control permissions for ft endpoint

* LiteLLM Managed Files - Enforce validation check if user can access finetuning job (#11034)

* feat: initial commit adding managed file support to fine tuning endpoints

* feat(fine_tuning/endpoints.py): working call to openai finetuning route

Uses litellm managed files for finetuning api support

* feat(fine-tuning/main.py): refactor to use LiteLLMFineTuningJob pydantic object

includes 'hidden_params'

* fix: initial commit adding unified finetuning id support

return a unified finetuning id we can use to understand which deployment to route the ft request to

* test: fix test

* feat(managed_files.py): return unified finetuning job id on create finetuning job

enables retrieve, delete to work with litellm managed files

* feat(managed_files.py): support managed files for cancel ft job endpoint

* feat(managed_files.py): support managed files for cancel ft job endpoint

* feat(fine_tuning_endpoints/endpoints.py): add managed files support to list finetuning jobs

* feat(finetuning_endpoints/main): add managed files support for retrieving ft job

Makes it easier to control permissions for ft endpoint

* feat(managed_files.py): store create fine-tune / batch response object in db

storing this allows us to filter files returned on list based on what user created

* feat(managed_files.py): Ensures users can't retrieve / modify each others jobs

* fix: fix check

* fix: fix ruff check errors

* test: update to handle testing

* fix: suppress linting warning - openai 'seed' is none on azure

* test: update tests

* test: update test

* (build) fix context window for claude 4 model family

* [Fix] Reliability Fix - Removing code that was creating threads on errors  (#11066)

* fix: only init langfuse if active

* fix: only init langfuse if active

* fix: add initialized_langfuse_clients count

* fix: add MAX_LANGFUSE_INITIALIZED_CLIENTS

* fix: use safe init langfuse

* test: init langfuse clients

* test: test_langfuse_not_initialized_returns_none_early

* docs MAX_LANGFUSE_INITIALIZED_CLIENTS

* fix: use correct langfuse callback

* fix: code qa

* [Feat] Add Azure AD certificate-based authentication (#11069)

* feat: add cert based auth for Azure get_azure_ad_token_provider

* test: tests azure cert auth

* fix update poetry

* fix: fix linting

* Update feature_request.yml

* Update feature_request.yml (#11078)

* adds tzdata (#10796) (#11052)

With tzdata installed, the environment variable `TZ` will be respected by Python's datetime module. This means that users can specify the timezone they want LiteLLM to use.

Co-authored-by: Simon Stone <sipreuss@gmail.com>

* Fix proxy_cli.py: avoid overriding DATABASE_URL when it’s already provided. (#11076)

* feat(helm): Add loadBalancerClass support for LoadBalancer services (#11064)

* feat(helm): Add loadBalancerClass support for LoadBalancer services

Adds the ability to specify a loadBalancerClass when using LoadBalancer service type.
This enables integration with custom load balancer implementations like Tailscale.

* fixup! feat(helm): Add loadBalancerClass support for LoadBalancer services

* Add Azure Mistral Medium 25.05 (#11063)

* Add Azure Mistral Medium 25.05

* fix provider

* fix:Databricks Claude 3.7 Sonnet output token cost: $17.85/M instead of (#11007)

$178.5/M

Co-authored-by: Tommy PLANEL <tommy.planel2@ubisoft.com>

* Fix/openrouter stream usage id 8913 (#11004)

* Add handling and verification for 'usage' field in OpenRouter chat transformations and streaming responses.

* Ensure consistent response ID by using valid ID from any chunk.

* Remove redundant comments from OpenRouter chat transformation tests and logic.

* Remove this from here as I'm opening a new pr

* Reverting space

* Remove redundant assertions from OpenRouter chat transformation test

* feat: add embeddings to CustomLLM (#10980)

* feat: add embeddings to CustomLLM

* feat: add aembedding to custom llm

* Enable switching between custom auth and litellm api key auth + Fix `/customer/update` for max budgets  (#11070)

* feat(user_api_key_auth.py): (enterprise) allow user to enable custom auth + litellm api key auth

makes it easy to migrate to proxy

* fix(proxy/_types.py): allow setting 'spend' for new customer

* fix(customer_endpoints.py): fix updating max budget on `/customer/update`

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

* test(test_customer_endpoints.py): add unit tests for customer update endpoint

* fix: fix linting error

* fix(custom_auth_auto.py): fix ruff check

* fix(customer_endpoints.py): fix documentation

* Litellm add file validation (#11081)

* fix: cleanup print statement

* feat(managed_files.py): add auth check on managed files

Implemented for file retrieve + delete calls

* feat(files_endpoints.py): support returning files by model name

enables managed file support

* feat(managed_files/): filter list of files by the ones created by user

prevents user from seeing another file

* test: update test

* fix(files_endpoints.py): list_files - always default to provider based routing

* build: add new table to prisma schema

* [feature] ConfidentAI logging enabled for proxy and sdk (#10649)

* async success implemented

* fail async event

* sync events added

* docs added

* docs added

* test added

* style

* test

* .

* lock file genrated due to tenacity change

* mypy errors

* resolved comments

* resolved comments

* resolved comments

* resolved comments

* style

* style

* resolved comments

* build(pyproject.toml): add langfuse dev dependency for tests

* Proper github images (#10927)

* feat: add seperate image URLs to distinguish types of release

* feat: remove new nightly/dev image URLs, only keep stable

* test: fix failing deepeval test

* Add devstral-small-2505 model to pricing and context window configuration (#11103)

- Added mistral/devstral-small-2505 with 128K context window
- Pricing: bash.1/M input tokens, bash.3/M output tokens (same as Mistral Small 3.1)
- Supports function calling, assistant prefill, and tool choice
- Source: https://mistral.ai/news/devstral

Co-authored-by: openhands <openhands@all-hands.dev>

* test: test_openai_image_edit_litellm_sdk

* use n 4 for mapped tests (#11109)

* Fix/background health check (#10887)

* fix: improve health check logic by deep copying model list on each iteration

* test: add async test for background health check reflecting model list changes

* fix: validate health check interval before executing background health check

* fix: specify type for health check results dictionary

* fix(user_api_key_auth.py): handle user custom auth set with no custom settings

* bump: version 0.1.21 → 0.2.0

* ci(config.yml): run enterprise and litellm tests separately

* fix: fix linting error

* docs: add missing docs

* [Feat] Add content policy violation error mapping for image editd (#11113)

* feat: add image edit mapping for content policy violations

* test fix

* Expose `/list` and `/info` endpoints for Audit Log events (#11102)

* feat(audit_logging_endpoints.py): expose list endpoint to show all audit logs

make it easier for user to retrieve individual endpoints

* feat(enterprise/): add audit logging endpoint

* feat(audit_logging_endpoints.py): expose new GET `/audit/{id}` endpoint

make it easier to retrieve view individual audit logs

* feat(key_management_event_hooks.py): correctly show the key of the user who initiated the change

* fix(key_management_event_hooks.py): add key rotations as an audit log event

'

* test(test_audit_logging_endpoints.py): add simple unit testing for audit log endpoint

* fix: testing fixes

* fix: fix ruff check

* [Feat] Use aiohttp transport by default - 97% lower median latency  (#11097)

* fix: add flag for disabling use_aiohttp_transport

* feat: add _create_async_transport

* feat: fixes for transport

* add httpx-aiohttp

* feat: fixes for transport

* refactor: fixes for transport

* build: fix deps

* fixes: test fixes

* fix: ensure aiohttp does not auto set content type

* test: test fixes

* feat: add LiteLLMAiohttpTransport

* fix: fixes for responses API handling

* test: fixes for responses API handling

* test: fixes for responses API handling

* feat: fixes for transport

* fix: base embedding handler

* test: test_async_http_handler_force_ipv4

* test: fix failing deepeval test

* fix: add YARL for bedrock urls

* fix: issues with transport

* fix: comment out linting issues

* test fix

* test: XAI is unstable

* test: fixes for using respx

* test: XAI fixes

* test: XAI fixes

* test: infinity testing fixes

* docs(config_settings.md): document param

* test: test_openai_image_edit_litellm_sdk

* test: remove deprecated test

* bump respx==0.22.0

* test: test_xai_message_name_filtering

* test: fix anthropic test after bumping httpx

* use n 4 for mapped tests (#11109)

* fix: use 1 session per event loop

* test: test_client_session_helper

* fix: linting error

* fix: resolving GET requests on httpx 0.28.1

* test fixes proxy unit tests

* fix: add ssl verify settings

* fix: proxy unit tests

* fix: refactor

* tests: basic unit tests for aiohttp transports

* tests: fixes xai

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>

* test: cleanup redundant test

* ui new build

* bump: 1.70.5

* bump: version 1.70.5 → 1.71.0

* fix(pyproject.toml): bump litellm version

* Logfire - fix(opentelemetry.py): Fix otel proxy server initialization (#11091)

* fix(opentelemetry.py): Fix otel proxy server initialization

Fixes https://github.com/BerriAI/litellm/issues/10349#issuecomment-2902455231

* feat(router.py): allow ignoring invalid deployments on model load

Prevents invalid models from preventing loading other valid models

Fixes issue where on instance spin up invalid models were blocking valid models from being used

* test: add additional unit testing

* fix(user_api_key_auth.py): return abbreviated key in exception - make it easy to debug which key is invalid for client

* docs(config_settings.md): document param

* fix(user_api_key_auth.py): fix error string to match previous one

* feat(handle_jwt.py): map user to team when added via jwt auth (#11108)

* feat(handle_jwt.py): map user to team when added via jwt auth

makes it easy to ensure user belongs to team

* test: test_openai_image_edit_litellm_sdk

* use n 4 for mapped tests (#11109)

* Fix/background health check (#10887)

* fix: improve health check logic by deep copying model list on each iteration

* test: add async test for background health check reflecting model list changes

* fix: validate health check interval before executing background health check

* fix: specify type for health check results dictionary

* fix(user_api_key_auth.py): handle user custom auth set with no custom settings

* bump: version 0.1.21 → 0.2.0

* ci(config.yml): run enterprise and litellm tests separately

* fix: fix linting error

* docs: add missing docs

* [Feat] Add content policy violation error mapping for image editd (#11113)

* feat: add image edit mapping for content policy violations

* test fix

* Expose `/list` and `/info` endpoints for Audit Log events (#11102)

* feat(audit_logging_endpoints.py): expose list endpoint to show all audit logs

make it easier for user to retrieve individual endpoints

* feat(enterprise/): add audit logging endpoint

* feat(audit_logging_endpoints.py): expose new GET `/audit/{id}` endpoint

make it easier to retrieve view individual audit logs

* feat(key_management_event_hooks.py): correctly show the key of the user who initiated the change

* fix(key_management_event_hooks.py): add key rotations as an audit log event

'

* test(test_audit_logging_endpoints.py): add simple unit testing for audit log endpoint

* fix: testing fixes

* fix: fix ruff check

* [Feat] Use aiohttp transport by default - 97% lower median latency  (#11097)

* fix: add flag for disabling use_aiohttp_transport

* feat: add _create_async_transport

* feat: fixes for transport

* add httpx-aiohttp

* feat: fixes for transport

* refactor: fixes for transport

* build: fix deps

* fixes: test fixes

* fix: ensure aiohttp does not auto set content type

* test: test fixes

* feat: add LiteLLMAiohttpTransport

* fix: fixes for responses API handling

* test: fixes for responses API handling

* test: fixes for responses API handling

* feat: fixes for transport

* fix: base embedding handler

* test: test_async_http_handler_force_ipv4

* test: fix failing deepeval test

* fix: add YARL for bedrock urls

* fix: issues with transport

* fix: comment out linting issues

* test fix

* test: XAI is unstable

* test: fixes for using respx

* test: XAI fixes

* test: XAI fixes

* test: infinity testing fixes

* docs(config_settings.md): document param

* test: test_openai_image_edit_litellm_sdk

* test: remove deprecated test

* bump respx==0.22.0

* test: test_xai_message_name_filtering

* test: fix anthropic test after bumping httpx

* use n 4 for mapped tests (#11109)

* fix: use 1 session per event loop

* test: test_client_session_helper

* fix: linting error

* fix: resolving GET requests on httpx 0.28.1

* test fixes proxy unit tests

* fix: add ssl verify settings

* fix: proxy unit tests

* fix: refactor

* tests: basic unit tests for aiohttp transports

* tests: fixes xai

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>

* test: cleanup redundant test

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: JuHyun Bae <jhyun0408@nate.com>

* fix(ui_sso.py): maintain backwards compatibility for older user id va… (#11106)

* fix(ui_sso.py): maintain backwards compatibility for older user id variations

Fixes issue in later SSO checks which only checked id from result

* fix(internal_user_endpoints.py): handle trailing whitespace in new user email

* fix(internal_user_endpoints.py): apply default_internal_user_settings on all new user calls (even when role not set)

allows role undefined users to be assigned the correct role on sign up

* feat(proxy_server.py): load default user settings from db - update litellm correctly

updates the litellm module with default internal user settings

ensures updated settings actually apply

* test: add unit test

* fix(internal_user_endpoints.py): fix internal user default param role

* fix(ui_sso.py): fix linting error

* test fix xai

* bump: version 1.71.0 → 1.71.1

---------

Co-authored-by: Earl St Sauver <estsauver@gmail.com>
Co-authored-by: Earl St Sauver <estasuver@gmail.com>
Co-authored-by: Jorge Piedrahita Ortiz <jhpiedrahitao97@gmail.com>
Co-authored-by: Bryan Low <keyute@users.noreply.github.com>
Co-authored-by: mohittalele <mohittalele@gmail.com>
Co-authored-by: Paul Selden <pselden@users.noreply.github.com>
Co-authored-by: Caffeine Coder <eddie.chan@connect.ust.hk>
Co-authored-by: tanjiro <56165694+NANDINI-star@users.noreply.github.com>
Co-authored-by: Daniel Staiger <danielstaiger87@gmail.com>
Co-authored-by: Cole McIntosh <82463175+colesmcintosh@users.noreply.github.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Jugal D. Bhatt <55304795+jugaldb@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: slytechnical <139649758+slytechnical@users.noreply.github.com>
Co-authored-by: daarko10 <34120174+daarko10@users.noreply.github.com>
Co-authored-by: Søren Mathiasen <sorenm@mymessages.dk>
Co-authored-by: Matthias Dittrich <matthi.d@gmail.com>
Co-authored-by: fzowl <160063452+fzowl@users.noreply.github.com>
Co-authored-by: Tyler Wagner <wagnerjt@users.noreply.github.com>
Co-authored-by: wagnerjt <wagnerjt@github.com>
Co-authored-by: Jay Gowdy <130084966+jgowdy-godaddy@users.noreply.github.com>
Co-authored-by: bepotp <bepotp@gmail.com>
Co-authored-by: Tommy PLANEL <tommy.planel2@ubisoft.com>
Co-authored-by: jmorenoc-o <52289208+jmorenoc-o@users.noreply.github.com>
Co-authored-by: Simon Stone <sipreuss@gmail.com>
Co-authored-by: Martin Liu <1459760+martin-liu@users.noreply.github.com>
Co-authored-by: Gunjan Solanki <44227165+gunjan-solanki@users.noreply.github.com>
Co-authored-by: Emerson Gomes <emerson.gomes@thalesgroup.com>
Co-authored-by: Tornike Gurgenidze <tokoko96@gmail.com>
Co-authored-by: Mayank <83648453+spike-spiegel-21@users.noreply.github.com>
Co-authored-by: Kreato <kreato@kreato.dev>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: JuHyun Bae <jhyun0408@nate.com>

* test: update tests

* fix: fix linting error

---------

Co-authored-by: Earl St Sauver <estsauver@gmail.com>
Co-authored-by: Earl St Sauver <estasuver@gmail.com>
Co-authored-by: Jorge Piedrahita Ortiz <jhpiedrahitao97@gmail.com>
Co-authored-by: Bryan Low <keyute@users.noreply.github.com>
Co-authored-by: mohittalele <mohittalele@gmail.com>
Co-authored-by: Paul Selden <pselden@users.noreply.github.com>
Co-authored-by: Caffeine Coder <eddie.chan@connect.ust.hk>
Co-authored-by: tanjiro <56165694+NANDINI-star@users.noreply.github.com>
Co-authored-by: Daniel Staiger <danielstaiger87@gmail.com>
Co-authored-by: Cole McIntosh <82463175+colesmcintosh@users.noreply.github.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Jugal D. Bhatt <55304795+jugaldb@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: slytechnical <139649758+slytechnical@users.noreply.github.com>
Co-authored-by: daarko10 <34120174+daarko10@users.noreply.github.com>
Co-authored-by: Søren Mathiasen <sorenm@mymessages.dk>
Co-authored-by: Matthias Dittrich <matthi.d@gmail.com>
Co-authored-by: fzowl <160063452+fzowl@users.noreply.github.com>
Co-authored-by: Tyler Wagner <wagnerjt@users.noreply.github.com>
Co-authored-by: wagnerjt <wagnerjt@github.com>
Co-authored-by: Jay Gowdy <130084966+jgowdy-godaddy@users.noreply.github.com>
Co-authored-by: bepotp <bepotp@gmail.com>
Co-authored-by: Tommy PLANEL <tommy.planel2@ubisoft.com>
Co-authored-by: jmorenoc-o <52289208+jmorenoc-o@users.noreply.github.com>
Co-authored-by: Simon Stone <sipreuss@gmail.com>
Co-authored-by: Martin Liu <1459760+martin-liu@users.noreply.github.com>
Co-authored-by: Gunjan Solanki <44227165+gunjan-solanki@users.noreply.github.com>
Co-authored-by: Emerson Gomes <emerson.gomes@thalesgroup.com>
Co-authored-by: Tornike Gurgenidze <tokoko96@gmail.com>
Co-authored-by: Mayank <83648453+spike-spiegel-21@users.noreply.github.com>
Co-authored-by: Kreato <kreato@kreato.dev>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: JuHyun Bae <jhyun0408@nate.com>
2025-05-24 10:38:12 -07:00
Ishaan Jaff 702b5fec22 [Feat] Add /image/edits on LiteLLM (#11123)
* feat: add image edits on litellm router

* feat: add image edits endpoint

* fix: use pure async for image edits

* fix: base_process_llm_request

* fix: get_image_content_type

* feat: add image edits endpoint

* add image edits on UI

* test: image edits support

* fix: linting errors

* fix: linting errors

* test fix img gen
2025-05-24 10:18:01 -07:00
John Tong bb700b8ece fix(model_management_endpoints): clear cache and reload models after update (#10853)
* fix(model_management_endpoints): clear cache and reload models after update

* add unit test on clear cache function

* fix(model_management_endpoints): clear cache and reload models after update

* add unit test on clear cache function
2025-05-24 10:11:50 -07:00
Krish Dholakia a44bc9f613 Remove + Check for unsafe enterprise/ folder imports (#11107)
* refactor(litellm/): wrap enterprise package usage in safe try-excepts

prevents missing package error for OSS users

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

* ci(config.yml): add script to check for unsafe imports to ci/cd

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

* fix: add missing docs

* test: test_openai_image_edit_litellm_sdk

* use n 4 for mapped tests (#11109)

* Fix/background health check (#10887)

* fix: improve health check logic by deep copying model list on each iteration

* test: add async test for background health check reflecting model list changes

* fix: validate health check interval before executing background health check

* fix: specify type for health check results dictionary

* fix(user_api_key_auth.py): handle user custom auth set with no custom settings

* bump: version 0.1.21 → 0.2.0

* ci(config.yml): run enterprise and litellm tests separately

* fix: fix linting error

* docs: add missing docs

* [Feat] Add content policy violation error mapping for image editd (#11113)

* feat: add image edit mapping for content policy violations

* test fix

* Expose `/list` and `/info` endpoints for Audit Log events (#11102)

* feat(audit_logging_endpoints.py): expose list endpoint to show all audit logs

make it easier for user to retrieve individual endpoints

* feat(enterprise/): add audit logging endpoint

* feat(audit_logging_endpoints.py): expose new GET `/audit/{id}` endpoint

make it easier to retrieve view individual audit logs

* feat(key_management_event_hooks.py): correctly show the key of the user who initiated the change

* fix(key_management_event_hooks.py): add key rotations as an audit log event

'

* test(test_audit_logging_endpoints.py): add simple unit testing for audit log endpoint

* fix: testing fixes

* fix: fix ruff check

* [Feat] Use aiohttp transport by default - 97% lower median latency  (#11097)

* fix: add flag for disabling use_aiohttp_transport

* feat: add _create_async_transport

* feat: fixes for transport

* add httpx-aiohttp

* feat: fixes for transport

* refactor: fixes for transport

* build: fix deps

* fixes: test fixes

* fix: ensure aiohttp does not auto set content type

* test: test fixes

* feat: add LiteLLMAiohttpTransport

* fix: fixes for responses API handling

* test: fixes for responses API handling

* test: fixes for responses API handling

* feat: fixes for transport

* fix: base embedding handler

* test: test_async_http_handler_force_ipv4

* test: fix failing deepeval test

* fix: add YARL for bedrock urls

* fix: issues with transport

* fix: comment out linting issues

* test fix

* test: XAI is unstable

* test: fixes for using respx

* test: XAI fixes

* test: XAI fixes

* test: infinity testing fixes

* docs(config_settings.md): document param

* test: test_openai_image_edit_litellm_sdk

* test: remove deprecated test

* bump respx==0.22.0

* test: test_xai_message_name_filtering

* test: fix anthropic test after bumping httpx

* use n 4 for mapped tests (#11109)

* fix: use 1 session per event loop

* test: test_client_session_helper

* fix: linting error

* fix: resolving GET requests on httpx 0.28.1

* test fixes proxy unit tests

* fix: add ssl verify settings

* fix: proxy unit tests

* fix: refactor

* tests: basic unit tests for aiohttp transports

* tests: fixes xai

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>

* test: cleanup redundant test

* fix: fix import

* fix: fix linting errors

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: JuHyun Bae <jhyun0408@nate.com>
2025-05-24 08:59:02 -07:00
Krish Dholakia dc79424e6b fix(route_llm_request.py): map team model from list in route llm request (#11111)
* fix(route_llm_request.py): map team model from list in route llm request

remove unnecessary proxy model table lookup for model alias

 Fixes issue where aliases weren't being consistently written to model table

* test: add unit tests
2025-05-24 08:57:47 -07:00
Ishaan Jaff 7548e87cf8 test fix xai 2025-05-24 07:25:47 -07:00
Krish Dholakia 1caefb0ce0 fix(ui_sso.py): maintain backwards compatibility for older user id va… (#11106)
* fix(ui_sso.py): maintain backwards compatibility for older user id variations

Fixes issue in later SSO checks which only checked id from result

* fix(internal_user_endpoints.py): handle trailing whitespace in new user email

* fix(internal_user_endpoints.py): apply default_internal_user_settings on all new user calls (even when role not set)

allows role undefined users to be assigned the correct role on sign up

* feat(proxy_server.py): load default user settings from db - update litellm correctly

updates the litellm module with default internal user settings

ensures updated settings actually apply

* test: add unit test

* fix(internal_user_endpoints.py): fix internal user default param role

* fix(ui_sso.py): fix linting error
2025-05-23 23:46:29 -07:00
Krish Dholakia ba2d4d080f feat(handle_jwt.py): map user to team when added via jwt auth (#11108)
* feat(handle_jwt.py): map user to team when added via jwt auth

makes it easy to ensure user belongs to team

* test: test_openai_image_edit_litellm_sdk

* use n 4 for mapped tests (#11109)

* Fix/background health check (#10887)

* fix: improve health check logic by deep copying model list on each iteration

* test: add async test for background health check reflecting model list changes

* fix: validate health check interval before executing background health check

* fix: specify type for health check results dictionary

* fix(user_api_key_auth.py): handle user custom auth set with no custom settings

* bump: version 0.1.21 → 0.2.0

* ci(config.yml): run enterprise and litellm tests separately

* fix: fix linting error

* docs: add missing docs

* [Feat] Add content policy violation error mapping for image editd (#11113)

* feat: add image edit mapping for content policy violations

* test fix

* Expose `/list` and `/info` endpoints for Audit Log events (#11102)

* feat(audit_logging_endpoints.py): expose list endpoint to show all audit logs

make it easier for user to retrieve individual endpoints

* feat(enterprise/): add audit logging endpoint

* feat(audit_logging_endpoints.py): expose new GET `/audit/{id}` endpoint

make it easier to retrieve view individual audit logs

* feat(key_management_event_hooks.py): correctly show the key of the user who initiated the change

* fix(key_management_event_hooks.py): add key rotations as an audit log event

'

* test(test_audit_logging_endpoints.py): add simple unit testing for audit log endpoint

* fix: testing fixes

* fix: fix ruff check

* [Feat] Use aiohttp transport by default - 97% lower median latency  (#11097)

* fix: add flag for disabling use_aiohttp_transport

* feat: add _create_async_transport

* feat: fixes for transport

* add httpx-aiohttp

* feat: fixes for transport

* refactor: fixes for transport

* build: fix deps

* fixes: test fixes

* fix: ensure aiohttp does not auto set content type

* test: test fixes

* feat: add LiteLLMAiohttpTransport

* fix: fixes for responses API handling

* test: fixes for responses API handling

* test: fixes for responses API handling

* feat: fixes for transport

* fix: base embedding handler

* test: test_async_http_handler_force_ipv4

* test: fix failing deepeval test

* fix: add YARL for bedrock urls

* fix: issues with transport

* fix: comment out linting issues

* test fix

* test: XAI is unstable

* test: fixes for using respx

* test: XAI fixes

* test: XAI fixes

* test: infinity testing fixes

* docs(config_settings.md): document param

* test: test_openai_image_edit_litellm_sdk

* test: remove deprecated test

* bump respx==0.22.0

* test: test_xai_message_name_filtering

* test: fix anthropic test after bumping httpx

* use n 4 for mapped tests (#11109)

* fix: use 1 session per event loop

* test: test_client_session_helper

* fix: linting error

* fix: resolving GET requests on httpx 0.28.1

* test fixes proxy unit tests

* fix: add ssl verify settings

* fix: proxy unit tests

* fix: refactor

* tests: basic unit tests for aiohttp transports

* tests: fixes xai

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>

* test: cleanup redundant test

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: JuHyun Bae <jhyun0408@nate.com>
2025-05-23 23:23:46 -07:00
Krish Dholakia a52943089b Logfire - fix(opentelemetry.py): Fix otel proxy server initialization (#11091)
* fix(opentelemetry.py): Fix otel proxy server initialization

Fixes https://github.com/BerriAI/litellm/issues/10349#issuecomment-2902455231

* feat(router.py): allow ignoring invalid deployments on model load

Prevents invalid models from preventing loading other valid models

Fixes issue where on instance spin up invalid models were blocking valid models from being used

* test: add additional unit testing

* fix(user_api_key_auth.py): return abbreviated key in exception - make it easy to debug which key is invalid for client

* docs(config_settings.md): document param

* fix(user_api_key_auth.py): fix error string to match previous one
2025-05-23 23:15:10 -07:00
Krrish Dholakia b04d5cba2a test: cleanup redundant test 2025-05-23 22:56:30 -07:00
Ishaan Jaff 86cdb8382b [Feat] Use aiohttp transport by default - 97% lower median latency (#11097)
* fix: add flag for disabling use_aiohttp_transport

* feat: add _create_async_transport

* feat: fixes for transport

* add httpx-aiohttp

* feat: fixes for transport

* refactor: fixes for transport

* build: fix deps

* fixes: test fixes

* fix: ensure aiohttp does not auto set content type

* test: test fixes

* feat: add LiteLLMAiohttpTransport

* fix: fixes for responses API handling

* test: fixes for responses API handling

* test: fixes for responses API handling

* feat: fixes for transport

* fix: base embedding handler

* test: test_async_http_handler_force_ipv4

* test: fix failing deepeval test

* fix: add YARL for bedrock urls

* fix: issues with transport

* fix: comment out linting issues

* test fix

* test: XAI is unstable

* test: fixes for using respx

* test: XAI fixes

* test: XAI fixes

* test: infinity testing fixes

* docs(config_settings.md): document param

* test: test_openai_image_edit_litellm_sdk

* test: remove deprecated test

* bump respx==0.22.0

* test: test_xai_message_name_filtering

* test: fix anthropic test after bumping httpx

* use n 4 for mapped tests (#11109)

* fix: use 1 session per event loop

* test: test_client_session_helper

* fix: linting error

* fix: resolving GET requests on httpx 0.28.1

* test fixes proxy unit tests

* fix: add ssl verify settings

* fix: proxy unit tests

* fix: refactor

* tests: basic unit tests for aiohttp transports

* tests: fixes xai

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
2025-05-23 22:55:35 -07:00
Krish Dholakia 2efaa3cf36 Expose /list and /info endpoints for Audit Log events (#11102)
* feat(audit_logging_endpoints.py): expose list endpoint to show all audit logs

make it easier for user to retrieve individual endpoints

* feat(enterprise/): add audit logging endpoint

* feat(audit_logging_endpoints.py): expose new GET `/audit/{id}` endpoint

make it easier to retrieve view individual audit logs

* feat(key_management_event_hooks.py): correctly show the key of the user who initiated the change

* fix(key_management_event_hooks.py): add key rotations as an audit log event

'

* test(test_audit_logging_endpoints.py): add simple unit testing for audit log endpoint

* fix: testing fixes

* fix: fix ruff check
2025-05-23 22:54:59 -07:00
Ishaan Jaff 8d7e234efd [Feat] Add content policy violation error mapping for image editd (#11113)
* feat: add image edit mapping for content policy violations

* test fix
2025-05-23 21:57:43 -07:00