Commit Graph

1895 Commits

Author SHA1 Message Date
Ishaan Jaff dd4a65b83a 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
2025-05-22 07:24:10 -07:00
Krish Dholakia 2b50b43ae2 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
2025-05-21 22:27:36 -07:00
Krish Dholakia 58f958f30a 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
2025-05-21 21:40:53 -07:00
Krrish Dholakia 546a508c8c test: mark flaky test 2025-05-21 21:36:46 -07:00
Jay Gowdy 85d577c8e6 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
2025-05-21 20:58:11 -07:00
Jugal D. Bhatt 03cda24681 Verbose error on admin add (#10978) 2025-05-21 19:30:18 -07:00
Ishaan Jaff e5d278c454 [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
2025-05-21 14:03:09 -07:00
Matthias Dittrich 3322b282f8 Ollama wildcard support (#10982)
* Add Ollama wildcard support

* Add Ollama-chatas well.

* Fix missing methods.

* Improve logs a bit.

* Add tests

* Add tests
2025-05-21 08:47:01 -07:00
Søren Mathiasen aa11ea3a9f support vertex_ai global endpoints for chat (#10658) 2025-05-21 07:58:36 -07:00
daarko10 00a789440d Improve response_id propagation logic and add tests for valid/empty ID handling in streaming. (#11006) 2025-05-21 07:27:17 -07:00
Krish Dholakia 4bd64c872a 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
2025-05-20 23:08:26 -07:00
Ishaan Jaff bf97d994b5 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>
2025-05-20 22:58:41 -07:00
Ishaan Jaff 14321a2708 [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
2025-05-20 22:55:55 -07:00
Krish Dholakia f0c8254665 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
2025-05-20 22:39:31 -07:00
Ishaan Jaff 3a6802fef1 [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
2025-05-20 18:29:39 -07:00
slytechnical 98e9db340c [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
2025-05-20 17:07:43 -07:00
Krrish Dholakia 058503ea11 test: skip test - model EOL 2025-05-20 15:57:12 -07:00
Krrish Dholakia b122ead5b3 test: update tests 2025-05-20 13:08:47 -07:00
Ishaan Jaff 7d8ed6f362 [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>
2025-05-19 21:25:23 -07:00
Krrish Dholakia 1857f5d264 test: update test 2025-05-19 21:21:44 -07:00
Krish Dholakia d282babd3e 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
2025-05-19 21:01:53 -07:00
Krish Dholakia 6cfb6e5253 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
2025-05-19 20:49:21 -07:00
Krrish Dholakia b091832733 test: update tests 2025-05-19 20:48:26 -07:00
Krrish Dholakia edfd8a138d fix: update test to reflect change 2025-05-19 20:26:48 -07:00
Krrish Dholakia defd602513 fix: fix model param mapping 2025-05-19 20:24:47 -07:00
Krrish Dholakia 4e3c8ae94f test: update test due to cohere ssl issues 2025-05-19 20:07:57 -07:00
Ishaan Jaff 3b6c6d05dd [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
2025-05-19 15:38:38 -07:00
Caffeine Coder 90e1647566 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
2025-05-19 09:29:12 -07:00
Paul Selden fde0c5e53f Allow passed in vertex_ai credentials to be authorized_user type (#10899) 2025-05-19 08:52:35 -07:00
mohittalele d36b6fa60b 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
2025-05-19 08:00:41 -07:00
Earl St Sauver 6ac3c6ba35 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>
2025-05-18 20:43:49 -07:00
DarinVerheijke 54a0766ff9 Add provider Featherless AI (access to 4200+ models) (#10596)
* add featherless provider

* change docs

* clean lint

* fix provider logic

* Add fixes per review

* update parameters

* update error msg

* remove featherless

* add tests

* add mock test e2e

* update to openai mock test
2025-05-17 19:38:46 -07:00
Ishaan Jaff 50a6f289cd [QA/Guardrails] Allow editing guardrail entity configs (#10918)
* allow editing guardrail entity

* fix: allow patching guardrail entity config

* fix: test init guardrails

* fix: update in mem guardrail params

* fix: update in mem guardrail params

* allow editing guardrail entities on ui

* fix pii entity config

* fixes for unselect/select entities

* fix: test fixes
2025-05-17 16:27:02 -07:00
Krrish Dholakia 9199078f36 test: update test 2025-05-17 07:56:05 -07:00
Krrish Dholakia 5c5699b65d build: merge in https://github.com/BerriAI/litellm/pull/10909
Closes https://github.com/BerriAI/litellm/pull/10909
2025-05-17 07:36:56 -07:00
Krish Dholakia cc626ad3ec Handle openai gpt file data + add openai 'supports_pdf_input' to all vision models + Support bedrock tool cache pointing (#10897)
* fix(openai/gpt_transformation.py): handle missing filename for openai file data call

* fix(openai/gpt_transformation.py): clean handling for sync + async pdf url transformation flows

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

* build(model_prices_and_context_window.json): add 'supports_pdf_input' for all openai models which have 'vision' support

Follows openai guidelines

* feat(bedrock/chat): support cache pointing tool calls on Bedrock

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

* fix: fix linting error
2025-05-17 07:29:01 -07:00
Jugal D. Bhatt d8525ecbfa Remove extra test file (#10889) 2025-05-16 18:34:22 -07:00
Jugal D. Bhatt 44c100d05d [Feat] handle multi-pod deployment for SpendLogs Retention (#10895)
* handle multi-pod deployment

* fix utc and ruff errors

* add constants.py

* add lock duration acc to interval

* add lock duration on pod lock manager

* update tests to use redis

* update comments from review

* update config_Settings.md

* lint errors

* remove custom ttl setting

* add constants.py

* add constants.py

* add check for pod lock manager, and allow otherwise

* remove dup try except and move to finally

remove args
2025-05-16 18:18:51 -07:00
Ishaan Jaff bd1e0634bf [Feat] Add Lakera v2 Guardrail Support (#10880)
* feat: add types for lakera v2

* feat: add call v2 guard for lakera

* feat: add call v2 guard for lakera

* feat: add LAKERA_V2

* feat: add LAKERA_V2 params

* feat: add initialize_lakera_v2

* fix: lakera pii masking

* test: lakera pii masking

* fix: lakera pii masking with tracing

* fix: lakera pii masking with tracing

* fix: fix linting errors

* fix: lakera ai docs
2025-05-16 17:08:21 -07:00
tanjiro dc8945cce8 key hash filter added (#10903) 2025-05-16 16:53:52 -07:00
Ishaan Jaff 1a7932a262 Feat: add guardrail tracing to OTEL, Arize phoenix (#10896)
* feat: add guardrail tracing to OTEL, Arize phoenix

* fix: code qa check

* test: trace guard on OTEL

* fix: linting
2025-05-16 13:38:11 -07:00
Ishaan Jaff 298912bd38 [UI] - Add Guardrail Tracing to LiteLLM SpendLogs (#10893)
* feat: trace guardrail SLP in spendLogs

* test: trace guardrail SLP in spendLogs

* add guardrail viewer

* checkpoint - working guardrail view on logs

* ui add guardrail view to SpendLogs

* test: fixes guardrails

* trace: fixes guardrails
2025-05-16 12:20:20 -07:00
Ishaan Jaff b9460dfe37 [Feat] Add Tracing for guardrails in StandardLoggingPayload, Langfuse (#10890)
* test:test_standard_logging_payload_includes_guardrail_information

* feat: add tracing for presidio pii masking

* feat: add tracing for guardrails on langfuse

* test: test_langfuse_trace_includes_guardrail_information

* feat: add tracing for guardrails on langfuse

* fix: working guardrail trace

* test: guardrail trace lands on langfuse

* fix: linting

* fix: code qa check

* test: fixes for presidio test

* test: fixes for presidio test

* test: guardrail trace lands on langfuse

* test: guardrail trace lands on langfuse

* test: guardrail trace lands on langfuse

* test: guardrail trace lands on langfuse
2025-05-16 10:47:12 -07:00
Krrish Dholakia cec4535cd8 fix: fix unit tests 2025-05-16 10:33:44 -07:00
Ishaan Jaff f335bb91dd Model filter added on logs tab. (#10877) (#10891)
* model filter added

* Make status logic it's own helper + add a unit test in test_spend_management_endpoints

Co-authored-by: tanjiro <56165694+NANDINI-star@users.noreply.github.com>
2025-05-16 10:04:02 -07:00
Jugal D. Bhatt d5d5166777 Feat log retention cleanup (#10872)
* Batch deletion with tasks

* reset utils

* change print to logger

* remove print for lint

* fix lint

* local testing

* remove constants.py var

* ruff fix

* type fix

* - make sure job doesn't get added if maximum_spend_logs_retention_period is not set
- enable user to override scheduler time
- Upper bound on while true

* update and fix test
2025-05-15 22:43:39 -07:00
Krish Dholakia fdfef04d93 Gemini Multimodal Live API support (#10841)
* fix: initial commit

* refactor(gemini/realtime/transformation.py): initial instrumentation

* fix: fix default api base if not set

* feat(gemini/): passes initial user request to backend

* feat(realtime_streaming.py): support transforming message input before sending it

enables gemini realtime streaming to be sent in correct format

* feat: initial working commit of setup message being sent + working

* fix(gemini/): initial commit supporting realtime response transformation

* feat(gemini/realtime): transform session.created event correctly

* fix(realtime_streaming.py): more gemini/realtime response mapping - handle new message

* test(gemini/realtime/test_): add more unit tests

* feat(gemini/realtime): handles consecutive deltas

* feat(gemini/realtime): support openai 'response.text.done' event

* feat(gemini/realtime): add openai 'response.text.done' and 'response.content_part.done' event support

* fix(gemini/realtime): add openai 'response.done' event support

unified realtime api support

* fix: fix linting errors

* fix: fix linting error

* fix: fix linting error

* fix: handle infinite loop

* fix: fix linting error

* fix: fix recursive detector

* fix: fix file

* fix: fix linting error

* fix: fix linting error
2025-05-15 22:39:09 -07:00
Dror Baron 93639df4c3 Feat/support anonymize in aim guardrail (#10757)
* Enable update/delete org members on UI  (#8560)

* feat(organization_endpoints.py): expose new `/organization/delete` endpoint. Cascade org deletion to member, teams and keys

Ensures any org deletion is handled correctly

* test(test_organizations.py): add simple test to ensure org deletion works

* feat(organization_endpoints.py): expose /organization/update endpoint, and define response models for org delete + update

* fix(organizations.tsx): support org delete on UI + move org/delete endpoint to use DELETE

* feat(organization_endpoints.py): support `/organization/member_update` endpoint

Allow admin to update member's role within org

* feat(organization_endpoints.py): support deleting member from org

* test(test_organizations.py): add e2e test to ensure org member flow works

* fix(organization_endpoints.py): fix code qa check

* fix(schema.prisma): don't introduce ondelete:cascade - breaking change

* docs(organization_endpoints.py): document missing params

* support anonymize and deanonymize

* use new response schema

* don't use detected because action already means there are detections

* log to debug

* CR fixes

* lint

* add tests

* use single quotes in deanonymiztion

* remove engage action case

* set max entities to 100 to prevent memory leak

* add test case for de-anonymization of llm response

---------

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2025-05-15 22:18:58 -07:00
Krrish Dholakia b54e2ae98b test: update unit test 2025-05-15 22:18:15 -07:00
Damian Gleumes 384a7ba94d [Feat]: Configure LiteLLM to Parse User Headers from Open Web UI (#9802)
* add user_header_name

* docs: add per-user tracking to Open WebUI with LiteLLM doc

* docs: standardize "OpenWeb UI" spelling across openweb_ui.md

* docs: improve wording for openweb_ui guide

* fix end_user_id not being set

- move user header parsing to add_litellm_data_to_request
- also set  user_api_key_dict.end_user_id from user header
2025-05-15 22:01:12 -07:00