Commit Graph
6020 Commits
Author SHA1 Message Date
Shanto MathewandGitHub 4535b5847d docs(openrouter): add base_url config with environment variables (#15946)
Added a new "Configuration with Environment Variables" section demonstrating:
- Using os.getenv() to dynamically retrieve OpenRouter configuration
- Explicitly passing base_url parameter with environment variables
- Benefits of this approach for managing configs across environments

This helps users implement production-ready configuration patterns.
2025-10-27 13:35:52 -07:00
Krrish Dholakia e1f54ef02c docs: refactor placement of adding guardrails to endpoints doc 2025-10-27 10:26:00 -07:00
YutaSaitoandGitHub c0890e7d33 [Feat] add support for dynamic client registration (#15921) (enables Atlassian MCP to work via Oauth on LiteLLM)
* feat: add support for dynamic client registration #13856

* fix: test

* feat: return 401 when oauth2_header is missing for OAuth2-based MCP servers
2025-10-26 10:13:46 -07:00
Sameer KankuteandGitHub 70650a044c Add all sora models (#15937) 2025-10-26 10:10:57 -07:00
oroxenbergandGitHub a75e75ae1a feat(lasso): Upgrade to Lasso API v3 and fix ULID generation (#15941)
* 1. add v3 classify
2. add new classifix for masking
3. support same id for the conversation for pre and post
working with duplicates

* clean code, remove some debug and run tests

* update liter errors

* improvment for Code Organization, httpx Error Handling Specificity, Logging Improvements and Type

* transfer test test_lasso_guard_config to the new location

* Fix type hints and linting errors in lasso.py

- Add type: ignore for httpx module when None
- Fix return type issues in _handle_classification and _handle_masking
- Ensure masked_messages is not None before passing to _apply_masking_to_model_response
- Convert LassoResponse to dict for _log_masking_applied call

* feat(lasso): Upgrade to Lasso API v3 and fix ULID generation

- Update Lasso API endpoints from v2 to v3 (/gateway/v3/classify)
- Update masking endpoints from v1 to v3 (/gateway/v3/classifix)
- Fix ULID generation: use ulid.new() instead of ULID() constructor
- Resolve MemoryView error that occurred with incorrect ULID usage

Tested with real proxy server and verified:
- Malicious content (jailbreak) properly blocked
- Safe content passes through guardrail
- PII detection and masking works correctly
- No ULID generation errors

* docs(lasso): Add ulid-py>=1.1.0 dependency prerequisite

Add Prerequisites section documenting the required ulid-py package
(version 1.1.0 or higher) for Lasso guardrail conversation tracking.

* update docs with the right api_key format
2025-10-26 10:08:52 -07:00
Ishaan JaffandGitHub 06a17ac1af 1-79-0 docs (#15936)
* draft v1-79-0

* docs fix

* docs fix

* 1.78.5-stable

* docs fix

* docs fix

* docs video gen
2025-10-25 18:04:04 -07:00
Krish DholakiaandGitHub 346e036399 fix(opentelemetry.py): fix issue where headers were not being split correctly + feat(bedrock): add titan image generations w/ cost tracking (#15916)
* fix(opentelemetry.py): fix issue where headers were not being split correctly

* feat(bedrock/image): Support bedrock titan image generation

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

* build(model_prices_and_context_window.json): track titan image gen pricing

enables cost tracking per request

* feat(amazon_titan_transformation.py): support titan image generation cost tracking

* docs: document new model

* docs: update docs to indicate cost tracking + refactor rerank into separate doc

* fix: fix mypy linting error

* fix: fix type ignore
2025-10-25 13:45:13 -07:00
Krish DholakiaandGitHub 72bbdfd3f3 (security) Responses API - prevent User A from retrieving User B's response, if response.id is leaked (#15757)
* feat(responses_id_security.py): encrypt response.id - prevent user A from retrieving user B's response

additional security for retrievals on shared accounts

Closes LIT-1307

* feat(responses_id_security.py): allow admin to disable responses id security check

* test: add initial unit testing

* feat(responses_id_security.py): add streaming support

* docs: document new param

* docs: document new param

* feat(responses_id_security.py): add team id checks - ensure it works for service accounts

prevent service accounts keys from different teams from accessing each other's responses

more secure

* test: add unit testing

* fix: fix linting error
2025-10-25 13:41:59 -07:00
Krish DholakiaandGitHub 2bd41dc034 Guardrails - Responses API, Image Gen, Text completions, Audio transcriptions, Audio Speech, Rerank, Anthropic Messages API support via the unified apply_guardrails function (#15706)
* fix(presidio.py): handle content as a list of texts

covers openai + anthropic messages api

* fix(presidio.py): safe get messages

* test: add unit testing for presidio guardrails

* fix(unified_guardrail.py): initial commit

* fix(enkryptai.py): implement apply_guardrail to enkrypt guardrail

* fix(unified_guardrail.py): support unified guardrail on input

* feat(unified_guardrail.py): add post call success hook implementation

allows us to just have 1 place to handle llm translation to guardrail api spec

* refactor: refactor initial unified guardrail component

* refactor: more refactoring

* feat(responses/): add guardrails to responses api

allows existing guardrails to work for new llm endpoints

* docs(adding_guardrail_support.md): document new guardrail endpoint support

* test: add unit tests

* feat(image_generation/): add guardrail support for image generation endpoint

* feat(openai/text_completion): support guardrails on `/v1/completions` API

* docs: document guardrails support on new endpoints

* docs: clarify when guardrails run

* feat(openai/speech): add guardrail support for input

* docs(rerank/): add guardrail support on input query

* fix: fix ruff check
2025-10-25 13:38:57 -07:00
Krrish Dholakia eb67cef167 docs(mcp.md): add docs 2025-10-25 13:30:47 -07:00
Krish DholakiaandGitHub 86524fcaf5 VertexAI Search Vector Store - Passthrough endpoint support + Vector store search Cost tracking support (#15824)
* feat(vector_stores/): initial commit adding Vertex AI Search API support for litellm

new vector store provider

* feat(vector_store/): use vector store id for vertex ai search api

* fix: transformation.py

cleanup

* fix: implement abstract function

* fix: fix linting error

* fix: main.py

fix check

* feat: initial commit with working passthrough support for vertex ai search api through litellm

* feat(llm_passthrough_endpoints.py): fix passing correct project on datastore passthrough

* feat(vertex_ai/): support passthrough call for vertex ai search vector store

* docs(vertex_ai_search_datastore.md): document new vertex ai passthrough endpoint

* docs(sidebars.js): document new endpoint

* feat: initial commit adding logging for vertex ai passthrough api

 allows vertex ai vector search api to work with cost calculation

* feat(vertex_ai/): search vector store cost tracking

* fix(vertex_passthrough_logging_handler.py): log the cost

* fix: improve logged response

* fix(vertex_passthrough_logging_handler.py): logging

* feat(litellm_logging): main.py

add cost tracking for vertex ai search api via unified api

* refactor: fix ruff checks

* fix(llm_passthrough_endpoints.py): fix linting
2025-10-25 13:17:15 -07:00
Ishaan Jaffer 747ae49848 fix missing IBM_GUARDRAILS_API_BASE, IBM_GUARDRAILS_AUTH_TOKEN vars 2025-10-25 12:33:20 -07:00
Krish DholakiaandGitHub f8d6a6edb9 fix(managed_files.py): don't raise error if managed object is not found + (Feat) Azure AI - Search Vector Stores + (Fix) Batches - “User default_user_id does not have access to the object” when object not in db + (fix) Vector Stores - show config.yaml vector stores on UI (#15873)
* fix(managed_files.py): don't raise error if managed object is not found

* feat(vector_stores): add azure ai search vector store support

Enables direct querying a vector store on azure

* fix(azure/vector_stores): working azure ai search api vector stores

allows azure direct querying on vector stores

* test: update env vars

* docs(docs/): document new azure ai vector store search

* docs(azure_ai_vector_stores.md): add table

* docs: clarify support for 'create' vector stores

* fix(vector_stores/endpoints.py): Fixes https://github.com/BerriAI/litellm/issues/14606

* fix: fix linting errors
2025-10-25 12:06:24 -07:00
Ishaan Jaffer c0555c84c0 1.78.0-stable 2025-10-25 11:14:59 -07:00
Krish DholakiaandGitHub ddacaf6c32 (feat) Organizations: allow org admins to create teams on UI + (feat) IBM Guardrails (#15924)
* fix(oldteams.tsx): allow org admin to create team on ui

* fix(oldteams.tsx): show org admin a dropdown of allowed orgs for team creation

* docs(access_control.md): cleanup doc

* feat(ibm_guardrails/): initial commit adding support for ibm guardrails on litellm

allows user to use self-hosted ibm guardrails

* feat(ibm_detector.py): working detector

* docs(ibm_guardrails.md): document new ibm guardrails

* fix: fix linting errors
2025-10-25 11:13:39 -07:00
Ishaan JaffandGitHub e4d5f00990 [Feat] New Guardrail - Dynamo AI Guardrail (#15920)
* add dynamo types

* fix Dynamo guard

* add dynamo guardrail

* add dynamo ai docs guard

* docs fix

* test dynamo

* test LASSO
2025-10-24 17:11:04 -07:00
Sameer KankuteandGitHub 0f9996a4d0 Litellm sameer oct staging (#15806)
* Addd v2/chat support for cohere

* fix streaming

* Use v2_transformation for logging passthrough:

* Use v2_transformation for logging passthrough:

* Add test for checking if document and citation_options is getting passed

* Update the cohere model

* Add cost tracking for vertex ai passthrough batch jobs

* Add full passthrough support

* refactor code according to the comments

* Add passthrough handler

* remove invalid params

* Updated documentation

* Updated documentation

* Updated documentation

* Correct the import

* Add openai videos generation and retrieval support

* add retrieval endpoint

* Add docs

* Add imports

* remove orjson

* remove double import

* fix openai videos format

* remove mock code

* remove not required comments

* Add tests

* Add tests

* Add other video endpoints

* Fix cost calculation and transformation

* Fixed mypy tests

* remove not used imports

* fix documentation for get batch req (#15742)

* Add grounding info to responses API (#15737)

* Add grounding info to responses API

* fix lint errors

* Use typed objects for annotations

* Use typed objects for annotations

* fix mypy error

* Litellm fix json serialize alreting 2 (#15741)

* fix json serializable error for alerts

* Add test

* fix mypt errors

* fix mypt errors

* Add Qwen3 imported model support for AWS Bedrock (#15783)

* Add qwen imported model support

* fix mypy errors

* fix empty user message error (#15784)

* fix typed dict for list

* Add azure supported videos endpoint

* fix mapped tests

* add azure sora models to model map

* Add OpenAI video generation and content retrieval support (#15745)

* Add openai videos generation and retrieval support

* add retrieval endpoint

* Add docs

* Add imports

* remove orjson

* remove double import

* fix openai videos format

* remove mock code

* remove not required comments

* Add tests

* Add tests

* Add other video endpoints

* Fix cost calculation and transformation

* Fixed mypy tests

* remove not used imports

* fix typed dict for list

* fix mypy errors

* move directory

* make v2 chat default

* Fix mypy tests

* Fix mypy tests

* Fix mypy tests

* Fix mypy tests

* Revert "Add Azure Video Generation Support with Sora Integration"

* refactor videos repo

* add test

* Add azure openai videos support

* Add azure openai videos support

* Add router endpoint support for videos

* fix mypy error

* add azure models

* fix mapped test

* fix mypy error

* Add proxy router test

* Add proxy router test

* remove deprecated model name from tests

* fix import error

* fix import error

* Add gaurdrail integration in videos endpoint

* Add logging support for videos endpoint

* Add final documentation supporting videos integration

* fix model name and document input

* Update literals to avoid mypy errors

* Remove unused imports and print statements

* revert guardrail support for video generation and video remix

* revert guardrail support for video generation and video remix

* Fix failing mapped and llm translation tests
2025-10-24 12:17:22 -07:00
oroxenbergandGitHub c793bd5ba9 Lasso Security Guardrail: Add v3 API Support (#12452)
* 1. add v3 classify
2. add new classifix for masking
3. support same id for the conversation for pre and post
working with duplicates

* clean code, remove some debug and run tests

* update liter errors

* improvment for Code Organization, httpx Error Handling Specificity, Logging Improvements and Type

* transfer test test_lasso_guard_config to the new location

* Fix type hints and linting errors in lasso.py

- Add type: ignore for httpx module when None
- Fix return type issues in _handle_classification and _handle_masking
- Ensure masked_messages is not None before passing to _apply_masking_to_model_response
- Convert LassoResponse to dict for _log_masking_applied call
2025-10-24 11:03:58 -07:00
Sameer KankuteandGitHub c638f45213 Implement Bedrock Guardrail apply_guardrail endpoint support (#15892)
* Add bedrock support for apply gaurdrails

* Add bedrock support doc

* remove unused variable

* remove unused variable
2025-10-24 10:24:03 -07:00
Sameer KankuteandGitHub b9585b1db5 Update documentation for enable_caching_on_provider_specific_optional_params (#15885) 2025-10-24 10:22:27 -07:00
Alexsander HamirandGitHub 9338727960 feat(proxy): support absolute RPM/TPM in priority_reservation (#15813)
* feat(proxy): support absolute RPM/TPM in priority_reservation

Allow priority reservations as absolute values instead of percentages:
- Float: {'prod': 0.75} (75%, existing)
- RPM: {'prod': {'type': 'rpm', 'value': 750}}
- TPM: {'prod': {'type': 'tpm', 'value': 750000}}

Added _convert_to_percent() that converts absolute values to percentages
based on model capacity. Fully backward compatible.

* feat(types): convert priority_reservation Dict to TypedDict

Add PriorityReservationDict TypedDict to replace generic Dict type in priority_reservation configuration.

Changes:
- Add PriorityReservationDict to litellm/types/utils.py
- Update convert_priority_to_percent() signature in rate_limiter_utils.py
- Update litellm.priority_reservation type annotation in __init__.py

Improves IDE autocomplete and type checking for priority reservation configs.

* docs: update dynamic rate limiter priority reservation docs
2025-10-23 18:30:36 -07:00
c5fee97850 docs: add OpenAI responses api (#15868)
* docs: add tip openai page

* added responses api

---------

Co-authored-by: mubashir1osmani <mubashir.osmani777@gmail.com>
2025-10-23 18:25:59 -07:00
09c1ad190e docs: add tip openai page (#15866)
Co-authored-by: mubashir1osmani <mubashir.osmani777@gmail.com>
2025-10-23 18:25:25 -07:00
Ishaan JaffandGitHub 3e4b5ef3a5 [Feat] Add cost tracking for Search API requests - Google PSE, Tavily, Parallel AI, Exa AI (#15821)
* add search cost tracking

* add cost tracking for tavily tiers

* add search to call types

* add search_provider_cost_per_query

* add cost tracking for search APIs

* add cost tracking search APIs

* docs cost tracking search

* docs search

* fix linting
2025-10-22 17:29:09 -07:00
Ishaan JaffandGitHub ad62a6d3d1 [Feat] Add DataforSEO Search API (#15817)
* docs google PSE

* add SearchProviders

* add search providers

* add PSE search

* add SearchProviders

* get_provider_search_config

* add Search

* init Search

* add get_http_method on BaseSearch

* fixes for Google PSE

* TestGooglePSESearch

* add DATAFORSEO

* add DataForSEOSearchConfig

* TestDataForSEOSearch

* add DataForSEO

* fix base transform

* fix search

* fix dataforSEO

* docs fix

* fix linting

* fix linting
2025-10-22 16:00:40 -07:00
Ishaan JaffandGitHub ec6a5ffa2d [Fix] Azure AI Speech - Ensure voice is mapped from request body -> SSML body , allow sending role and style (#15810)
* update map_openai_params

* fix update voice transform

* fix text_to_speech_provider_config

* test_azure_ava_tts_with_custom_voice

* test Azure AVA style, role sent

* _build_express_as_element

* docs custom params

* build LANG

* fix transform

* fix transform

* fix speech

* docs update

* docs azure ai speech
2025-10-22 14:41:11 -07:00
Ishaan Jaffer bd0a8a047a docs search_tools 2025-10-21 19:15:18 -07:00
Ishaan JaffandGitHub f5a80110c1 [Feat] Add /search endpoint on LiteLLM Gateway (#15780)
* add SearchProvider

* add SearchToolTypedDict

* add search

* add SearchAPIRouter

* working router level search

* add search to allowed llm / ocr routes

* feat: add search_router

* add routing + proxy for search APIs

* /v1/search/{search_tool_name}

* fix search routing

* feat: parse_search_tools

* clean up sidebar

* docs fix

* router tests for search tools

* docs fix
2025-10-21 19:05:20 -07:00
Ishaan JaffandGitHub 9135e748a0 [Feat ] /ocr - Add mode + Health check support for OCR models (#15767)
* get_mode_handlers

* use get_mode_handlers

* test_ahealth_check_ocr

* Add OCR mode to test models

* docs OCR Health Checks

* fix connection endpoint
2025-10-21 16:58:37 -07:00
Javier GarciaandGitHub b0a3a7c4fb Add details in docs (#15721)
* Add details in docs

* add logic to set span attributes and unit tests

* Restore html files

* Remove html files

* Remove html files
2025-10-21 16:57:51 -07:00
Thomas MildnerandGitHub 1cfc4624c3 [Feat] Add SENTRY_ENVIRONMENT configuration for Sentry integration (#15760)
* [Feat] Add SENTRY_ENVIRONMENT configuration for Sentry integration and corresponding tests

* [Refactor] Enhance test_sentry_environment by mocking sentry_sdk and improving environment handling

* [Fix] Update default SENTRY_ENVIRONMENT to 'production' and enhance test for Sentry integration

* [Fix] Update test_sentry_environment to verify correct handling of SENTRY_ENVIRONMENT values

* [Fix] Update test_sentry_environment to assert correct handling of production environment
2025-10-21 16:40:55 -07:00
Krrish Dholakia 2a1dbb5b9e docs(creating_adapters.md): document how to write an adapter 2025-10-21 16:20:31 -07:00
YutaSaitoandGitHub 39641e7e68 chore: rename GraySwan to Gray Swan (#15771) 2025-10-21 15:18:55 -07:00
Krrish Dholakia 1e0368521e refactor: cleanup 2025-10-21 13:46:19 -07:00
Ishaan Jaffer 3741c43396 docs fix 2025-10-21 13:21:59 -07:00
Ishaan JaffandGitHub 8ad9bbbd02 [Docs] Add Azure AI - OCR to docs (#15768)
* add Azure OCR to docs

* docs fix

* docs fix

* docs fix

* docs OCR
2025-10-21 13:10:45 -07:00
Ishaan Jaffer 185182bebc Revert "add Azure OCR to docs"
This reverts commit a3699e28a4.
2025-10-21 13:02:31 -07:00
Ishaan Jaffer a3699e28a4 add Azure OCR to docs 2025-10-21 13:02:21 -07:00
Ishaan Jaffer 6605aba307 docs grayswan 2025-10-21 11:16:25 -07:00
YutaSaitoandGitHub d79bdd491f feat: add GraySwan Guardrails support (#15756) 2025-10-21 11:13:50 -07:00
Ishaan JaffandGitHub 92335d991c [Feat] Add Azure AVA (Speech AI) Cost Tracking (#15754)
* add azure/speech/ cost tracking

* test_azure_ava_tts_async

* add azure/speech to model cost map

* docs cost tracking

* docs tts AVA

* add azure/speech/azure-tts
2025-10-20 18:01:51 -07:00
Ishaan Jaffer 9a25eeccb2 docs fix 2025-10-20 17:02:38 -07:00
Ishaan JaffandGitHub 73a23a6c78 [Feat] Add Azure AVA TTS integration (#15749)
* add AzureBaseIssueTokenHandler

* add BaseTextToSpeechConfig

* async_text_to_speech_handler

* add AzureAVATextToSpeechConfig

* add get_provider_text_to_speech_config

* add AzureAVATextToSpeechConfig

* fixes for base_llm_http_handler

* fix transform_text_to_speech_request

* test_azure_ava_tts_async

* test_azure_ava_tts_async

* fix TextToSpeechRequestData

* fix transform_text_to_speech_request

* add text_to_speech_handler in LLMHttpHandler

* remove old file

* fix transform_text_to_speech_request

* fix dispatch_text_to_speech

* fix azure TTS

* fix AVA TTS

* fix transform

* fix linting

* ci/cd - use one job for audio testing

* fix tests

* fix llm http handler debugging

* unit tests azure tts

* docs Azure speech

* docs fix

* docs azure AVA

* docs azure AVA

* fix handlers

* test_async_realtime_uses_max_size_parameter
2025-10-20 16:52:23 -07:00
Sameer KankuteandGitHub 3955a3de5d fix the wrong request body in json mode doc (#15729) 2025-10-20 08:44:14 -07:00
Alexsander HamirandGitHub 441aed2c87 fix: update worker recommendation (#15702) 2025-10-18 16:24:32 -07:00
Ishaan Jaffer 3fc49a029f docs fix 2025-10-18 15:28:49 -07:00
Ishaan Jaffer eed1ddba49 docs v1.78.5-stable 2025-10-18 15:28:07 -07:00
Ishaan JaffandGitHub 6ab9b0af9f [Fix] Anthropic cache_control incorrectly applied to all content items instead of last item only (#15699)
* fix: _safe_insert_cache_control_in_message

* test_anthropic_cache_control_hook_system_message

* docs prompt cache injection

* docs fix
2025-10-18 15:18:08 -07:00
Jason RobertsandGitHub c471bf1f16 feat(guardrails): Add content masking and streaming support to PANW Prisma AIRS guardrail (#15666)
* feat(guardrails): Add content masking and streaming support to PANW Prisma AIRS

- Add mask_request_content and mask_response_content parameters
- Implement content masking for prompts and responses
- Add streaming support with real-time masking
- Add comprehensive test coverage (28 tests)
- Update documentation with masking examples and security notes

* fix(guardrails): Fix PANW Prisma AIRS env var fallback and text completion support
2025-10-18 13:57:51 -07:00
Krish DholakiaandGitHub c1355e92dc fix(proxy_server.py): re-encrypt env var on config save + use original value on decrypt error (#15671)
* fix(proxy_server.py): re-encrypt env var on config save + use original value on decrypt error

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

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

* docs: email.md

document PROXY_BASE_URL param

* fix(proxy_server.py): pop model list before writing to db
2025-10-18 13:39:25 -07:00