Commit Graph

5306 Commits

Author SHA1 Message Date
Ishaan Jaff 95f7290e44 [Feat] Proxy - New LLM API Routes /v1/vector_stores and /v1/vector_stores/vs_abc123/search (#12699)
* add Search + Create vector stores

* add new vector_stores routes

* add avector_store_search routes

* docs vector stores

* docs vector stores

* Create Vector Store

* fix - refactor

* add vector_store_router

* fix imports

* fix ruff
2025-07-17 11:19:25 -07:00
Ishaan Jaff 52a525ab9c [Feat] Bedrock Guardrails - Allow disabling exception on 'BLOCKED' action (#12693)
* flag: disable_exception_on_block

* allow setting disable_exception_on_block

* test_bedrock_guardrail_disable_exception_on_block_non_streaming

* docs Disabling Exceptions on Bedrock BLOCK

* fix recognition_metadata test
2025-07-17 08:46:33 -07:00
Cole McIntosh 77191c7b2a Fix incorrect environment variable names in LiteLLM gateway documentation (#12686)
Updated ANTHROPIC_API_KEY to ANTHROPIC_AUTH_TOKEN to match the official documentation requirements for LiteLLM gateway configuration.
2025-07-17 08:02:28 -07:00
Cole McIntosh 3a0ea80c75 Add Claude Code LiteLLM tutorial (#12650)
* Add concise Claude Code + LiteLLM Gateway tutorial

- Create focused tutorial matching existing tutorial style
- Step-by-step guide from installation to advanced configurations
- Multi-provider configuration examples (AWS Bedrock, Azure OpenAI, Load Balancing)
- Based on Anthropic's official LiteLLM configuration documentation
- Added to sidebar with clean title 'Use LiteLLM with Claude Code'
- Fixed sidebar reference from 'secret' to 'set_keys' for proper document resolution

* Update config_settings.md to correct documentation links for key management and Hashicorp Vault settings. Changed references from 'secret.md' to 'set_keys.md' for improved clarity and accuracy.

* Update sidebar and config_settings.md to reflect changes in key management documentation. Changed sidebar reference from 'set_keys' to 'secret' and updated links in config_settings.md for Hashicorp Vault settings to point to 'secret.md' for improved accuracy.

* Remove extra tutorial and update sidebar accordingly

* Update tutorial title from 'WebUI' to 'Open WebUI' for clarity and consistency in documentation.

* Remove Python version requirement from Claude Responses API tutorial for clarity and to align with updated prerequisites.
2025-07-16 23:07:29 -07:00
Jugal D. Bhatt 4b09d0d517 [Liveness/Liveliness probe] add separate health app for liveness probes in files (#12669)
* add separate health app

* add new docs

* refactor

* fix colons

* Update config_settings.md

* refactor

* docs

* add unit test
2025-07-16 20:35:09 -07:00
Cole McIntosh b2080ec9af feat: add input_fidelity parameter for OpenAI image generation (#12662)
* feat: add input_fidelity parameter for OpenAI image generation

- Add input_fidelity to OpenAIImageGenerationOptionalParams type
- Update image_generation function signature to accept input_fidelity
- Add input_fidelity to default_params in get_optional_params_image_gen
- Include input_fidelity in openai_params list for proper handling
- Update documentation with input_fidelity parameter description
- Add test for input_fidelity parameter functionality

This enables control over how closely the model follows the input prompt
for gpt-image-1 model, improving prompt adherence and image quality.

* feat: add input_fidelity to optional parameters for image generation

- Include input_fidelity in the list of OpenAIImageGenerationOptionalParams
- This addition enhances the flexibility of image generation by allowing control over input fidelity.

* test: enhance test for gpt-image-1 with input_fidelity parameter

- Update test_gpt_image_1_with_input_fidelity to include mocking of OpenAI response
- Validate that the OpenAI client is called with correct parameters, including input_fidelity
- Improve response validation to ensure expected output structure and values
2025-07-16 16:56:05 -07:00
Ishaan Jaff 9b817b511e [Feat] Allow reading custom logger python scripts from s3 (#12623)
* add _load_instance_from_remote_storage

* load from s3

* fix download_python_file_from_s3

* fix download_python_file_from_s3

* add _load_instance_from_remote_storage

* tests

* Step 2b - Loading Custom Callbacks

* docs

* fix code qa check
2025-07-16 15:07:01 -07:00
Krrish Dholakia 6e426c8b7c refactor(admin_ui_sso.md): refactor to include /sso/debug/callback in this doc
more natural place
2025-07-16 11:39:02 -07:00
Krrish Dholakia 047b106197 docs(custom_auth.md): add virtual keys doc 2025-07-16 11:09:57 -07:00
Cole McIntosh d51aee1b84 Add GitHub Copilot LiteLLM tutorial (#12649)
* Add comprehensive GitHub Copilot + LiteLLM integration tutorial

- Complete setup guide from installation to production deployment
- Multiple configuration examples including authentication, load balancing, and cost tracking
- Docker and Kubernetes deployment configurations
- Troubleshooting section with common issues and solutions
- Best practices for security, monitoring, and reliability
- Usage examples for code completion, chat interface, and direct API integration

* Add concise GitHub Copilot + LiteLLM tutorial

- Create focused tutorial matching Gemini CLI style
- Step-by-step guide from installation to production deployment
- Multi-provider configuration examples (OpenAI, Anthropic, Bedrock)
- Load balancing and fallback configuration
- Docker deployment instructions
- Troubleshooting section with common issues
- Updated sidebar with clean title 'Use LiteLLM with GitHub Copilot'

* Refactor GitHub Copilot integration tutorial

- Removed outdated production deployment and direct API usage sections
- Streamlined troubleshooting steps for clarity
- Ensured documentation aligns with current best practices and configurations

* Add proper credit to Sergio Pino for GitHub Copilot tutorial

- Reference original DEV.to article in info box
- Add credits section acknowledging foundational work
- Maintain attribution to original author's guide
2025-07-16 09:40:27 -07:00
Krrish Dholakia 446ed6039e docs(admin_ui_sso.md): document /fallback/login flow 2025-07-16 09:07:42 -07:00
Krrish Dholakia 4e9440ee85 docs: cleanup docs 2025-07-16 07:18:13 -07:00
Krrish Dholakia e22390a39a docs(openai.md): cleanup bridge doc 2025-07-15 22:59:10 -07:00
Krrish Dholakia 7064542504 docs(openai.md): document openai chat completions to responses api bridge 2025-07-15 22:50:23 -07:00
Ishaan Jaff 2d6751a396 [Feat] MCP Gateway - allow using MCPs with all LLM APIs when using /responses with LiteLLM (#12546)
* add MCPResponsesAPIHelper

* rename LiteLLM_Proxy_MCP_Handler

* aresponses_api_with_mcp

* mock_responses_api_response

* test response with litellm proxy MCP

* add _should_use_litellm_mcp_gateway

* fix transform_mcp_tool_to_openai_responses_api_tool

* use correct _transform_mcp_tools_to_openai

* fix config.yaml

* fixes for native MCP handling

* docs MCP with litellm proxy

* aresponses_api_with_mcp

* fix linting

* fix mypy

* fix linting

* test_aresponses_api_with_mcp_mock_integration

* docs How it works when server_url="litellm_proxy"
2025-07-15 14:06:31 -07:00
Ishaan Jaff d132f6e4e0 Troubleshooting (#12621) 2025-07-15 14:00:55 -07:00
Brian Caswell 45605f8362 add azure blob cache support (#12587)
* add support for Azure Blob caching

* add integration tests

* address feedback
2025-07-15 11:47:38 -07:00
Krrish Dholakia e159ac932d docs: doc cleanup 2025-07-15 08:25:06 -07:00
Krrish Dholakia 0cbffe28a6 docs: doc cleanup 2025-07-15 08:23:42 -07:00
Krrish Dholakia d850d1fa67 docs(controle_plane_and_data_plane.md): rename doc 2025-07-15 08:23:23 -07:00
Krrish Dholakia 45700b329b docs(bedrock.md): update doc
s
2025-07-15 07:28:00 -07:00
Marcelo Díaz 094ce8f772 feat(gemini): Add custom TTL support for context caching (#9810) (#12541)
- Add ttl parameter to cache_control for Gemini models
- Support Google's TTL format (e.g., '3600s', '7200s')
- Implement robust TTL extraction and validation
- Extract TTL before system message transformation to handle all cases
- Add comprehensive test suite with 17 test cases in tests/test_litellm/
- Update documentation with TTL usage examples
- Maintain backward compatibility with existing cache_control usage

Fixes #9810
2025-07-14 22:30:54 -07:00
Krish Dholakia 49e9b73fcb Claude 4 Bedrock /invoke route support + Bedrock application inference profile tool choice support (#12599)
* docs(config_settings.md): document enable_json_schema_validation

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

* fix(utils.py): add claude-sonnet-4 on bedrock support

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

* refactor(utils.py): move list to getter in function

more maintainable

* fix(utils.py): handle bedrock_converse in provider check

Fixes https://github.com/BerriAI/litellm/issues/11751
2025-07-14 21:42:25 -07:00
Krish Dholakia 7c392475e6 Control Plane + Data Plane support (#12601)
* feat(route_checks.py): allow admin to disable proxy management endpoints on instance

useful for preventing multiple instances from doing admin actions

* docs(scaling_multiple_instances.md): add architecture doc on scaling multiple litellm instances

provide guidance on scaling proxy

* docs(scaling_multiple_instances.md): add doc on scaling across multiple regions for litellm

* fix(route_checks.py): allow disabling llm api endpoints on an instance

allows pure admin instance to exist

* refactor(enterprise/route_checks.py): refactor env var checks

* refactor: finish refactoring

* docs(control_plane_and_data_plane.md): refactor docs

* test: update tests
2025-07-14 21:31:56 -07:00
Ishaan Jaff 5a1746879d [Feat] Vector Stores - Add Vertex RAG Engine API as a provider (#12595)
* add Vertex VertexVectorStoreConfig

* add VertexVectorStoreConfig

* docs add Vertex Vector Store

* add initial VertexVectorStoreConfig

* test TestVertexAIVectorStore

* test - update test

* test update test

* fix vertex vector search

* fix transform_search_vector_store_response

* add transform_search_vector_store_response

* fix test

* transform_search_vector_store_response

* ruff fix

* transform_search_vector_store_request

* fix linting
2025-07-14 18:10:33 -07:00
Krish Dholakia 78baeae6d8 Updated release notes (#12594)
* docs(index.md): cleanup docs

* docs(index.md): add more highlights

* docs(model_hub.md): cleanup doc
2025-07-14 17:03:11 -07:00
Ishaan Jaff 27ff234b7d [Feat] New LLM API Integration - Add Moonshot API (Kimi) (#12551) (#12592)
* [Feat] New LLM API Integration - Add Moonshot API (Kimi) (#12551)

* Add Moonshot AI provider support to LiteLLM

Co-authored-by: ishaan <ishaan@berri.ai>

* Refactor Moonshot provider params handling and transformation logic

Co-authored-by: ishaan <ishaan@berri.ai>

* fix constants

* add Moonshot AI

* fix get_supported_openai_params

* handle kimi temp

* add tool choice handling

* test moonshot unit tests

* fix kimi

* fix linting

* Add pricing information for Moonshot AI's kimi-k2 model (#12566)

* Add pricing information for Moonshot AI's kimi-k2 model

* Update model name to kimi-k2-0711-preview

- Changed model name from moonshot/kimi-k2 to moonshot/kimi-k2-0711-preview
- This reflects the specific model version as requested

* Update moonshot_models list to match model_context JSON

---------

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

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ishaan <ishaan@berri.ai>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>

* update docs

* docs moonshot

* fixes model cost map

* fix map_openai_params

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ishaan <ishaan@berri.ai>
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
2025-07-14 15:23:34 -07:00
Aaron Vogler 2b2ba8a2b1 Add Bytez to the list of providers in the docs (#12588)
* Get the basics of the integration working.

* Cleanup bytez integration.

* Update user agent for Bytez integration.

* Use the config class directly. Create the start of the docs.

* Finish up bytez documentation. Include a provider integration guide.

* Fix typing bug in custom_logger_utils. Add tests for bytez integration.

* Add token tracking for model usage for Bytez integration.

* Create a units test for the Bytez config.

* Make changes to Bytez transformation code per PR feedback.

* Cleanup coment in Bytez transformation test.

* Remove LRU usage for bytez integration.

* Consolidate Bytez tests into a single file. Conform to project structure for tests.

* Fix linting error with Bytez impl.

* Add Bytez to the list of providers in the docs.
2025-07-14 14:17:56 -07:00
Krish Dholakia 2290250c9f Litellm release notes 07 12 2025 (#12563)
* docs(index.md): add new models / updated models to new release note

* docs(index.md): add LLM api endpoints to release notes

* docs(index.md): refactor mcp into separate section '

* docs: doc improvements

* docs(index.md): more cleanup

* docs(index.md): more cleanup

* docs: update litellm enterprise trial link

* docs(index.md): cleanup

* docs(datadog.md): add separate datadog doc

* docs(index.md): cleanup

* docs(index.md): update docker version

* docs(index.md): add screenshots for new features

* docs(index.md): add doc links
2025-07-12 19:31:13 -07:00
Ishaan Jaff 2770e5b53e docs mcp fix 2025-07-12 17:38:43 -07:00
Ishaan Jaff 50b106be11 [MCP Gateway] Ensure we use the same param for specifying groups (#12561)
* just use 1 param for mcp groups

* fix just use 1 param for access groups

* test_get_tools_from_mcp_servers

* docs access groups

* group MCPs

* test fix

* fix screenshots on docs

* TestMCPAccessGroupsE2E

* update img

* fix MCP connect
2025-07-12 16:41:58 -07:00
Jugal D. Bhatt 65533ccf62 added mcp access group docs (#12557) 2025-07-12 14:49:52 -07:00
Aaron Vogler 4c466ef157 Integration: Bytez as a model provider (#12121)
* Get the basics of the integration working.

* Cleanup bytez integration.

* Update user agent for Bytez integration.

* Use the config class directly. Create the start of the docs.

* Finish up bytez documentation. Include a provider integration guide.

* Fix typing bug in custom_logger_utils. Add tests for bytez integration.

* Add token tracking for model usage for Bytez integration.

* Create a units test for the Bytez config.

* Make changes to Bytez transformation code per PR feedback.

* Cleanup coment in Bytez transformation test.

* Remove LRU usage for bytez integration.

* Consolidate Bytez tests into a single file. Conform to project structure for tests.

* Fix linting error with Bytez impl.
2025-07-12 10:50:39 -07:00
Eliza Huang 858c756d47 chore: Update Vertex AI Model Garden LiteLLM integration tutorial (#12428)
* Update Vertex Model Garden documentation to deploy + use OpenAI Chat Completion tutorial.

* update anchor description

* update to LiteLLM specific tutorial

* update the right doc

* Reverted docs/my-website/docs/providers/vertex.md to match main

* revert to main vertex tutorial
2025-07-12 09:10:41 -07:00
Krish Dholakia 749051105b Team Members - reset budget, if duration set + Prometheus - support tag based metrics (#12534)
* fix(internal_user_endpoints.py): initial commit removing logic to create new budget for new user if default max budget in team set

* feat(proxy_setting_endpoints.py): update team member budget when set via default internal user endpoint

removes need to create a unique budget per user

* feat(proxy_server.py): set team max member budget on startup, if set on config.yaml

* fix(prometheus.py): support custom tags for tracking on prometheus

Allows tracking user agent values on prometheus metrics

* test(test_internal_user_endpoints.py): fix test
2025-07-11 22:54:16 -07:00
Ema Suriano 7b40d6adfe docs: Update github.md (#12509)
Fix wrong model names
2025-07-11 22:19:21 -07:00
Ishaan Jaff d931446a79 [MCP Gateway] Allow using stdio MCPs with LiteLLM (#12530)
* update types

* add STDIO to client

* allow using STDIO with MCP manager

* add Stdio-specific fields to schema.prisma

* fixes for MCP mgmt

* fix for adding stdio MCP to DB

* ui - allow adding stdio MCPs

* fix MCP server manager

* docs stdio MCP

* add_stdio_mcp.png

* new stdio tests

* allow adding MCPs through config.yaml

* fix tool test panel

* use TestMCPClient

* ui fixes for testing circle ci mcp
2025-07-11 20:21:02 -07:00
Ishaan Jaff cb96f1d740 [Feat] - New guardrail - OpenAI Moderations API (#12519)
* add OpenAIModerationGuardrailConfigModel

* add OpenAIGuardrailBase

* _extract_response_text

* fixes for openai moderation guard

* docs OpenAI Moderation

* add OpenAIModerationGuardrailConfigModel

* use literal for model

* fix init openai moderation

* test_openai_moderation_guardrail_adds_to_litellm_callbacks

* show default on on UI

* fix code qa
2025-07-11 11:25:45 -07:00
Krrish Dholakia 68fe7d245d docs(index.md): update doc 2025-07-11 08:08:47 -07:00
Krish Dholakia 569ddde9fe [Enterprise] Support tag based mode for guardrails (#12508)
* feat(custom_guardrail.py): allow admin to run guardrails on specific modes based on request tags

Enables pre-call checks for openwebui but logging for claude code guardrails

* refactor(custom_guardrail.py): move tag based mode to enterprise

* test(test_custom_guardrail.py): update test

* feat(quick_start.md): add doc on tag-based guardrail mode

* docs(quick_start.md): cleanup doc

* docs: cleanup

* docs(openweb_ui.md): add tutorial to doc

* fix(custom_guardrail.py): ensure user is premium user

* test: update test
2025-07-10 22:27:30 -07:00
minghao bee63a1ae7 Added dashscope (alibaba's cloud - qwen) as a provider (#12361)
* Added dashscope as a provider

* Fix some leftover references on nebius

* Porting the dashscope api endpoit international version

* explicit tool_choice = True in config
2025-07-10 18:09:26 -07:00
Rayshard Thompson 8aa616698e Fix typo and import required types (#12487) 2025-07-10 18:03:42 -07:00
Ishaan Jaff b0003bd03c Feat(bedrock): support api key authentication for AWS Bedrock API (#12426) (#12495)
* add support of bearer token for bedrock integration

* fix linting issue

* fix type checking issue

* reoder arguments to address type checking issue

* switch to use get_secret_str to fetch env variable

Co-authored-by: 0x-fang <fanggong@amazon.com>
2025-07-10 15:12:17 -07:00
Ishaan Jaff 610d56ae5d docs stable release 2025-07-10 14:53:29 -07:00
Krish Dholakia 07e8609edb Resolve model group alias on Auth + /v1/messages Fallback support (#12440)
* fix(auth_checks.py): resolve a model group alias when key has access to underlying model

Fixes LIT-293

* feat(anthropic/): add mock_response to anthropic /v1/messages

makes it easy to test fallback logic

* fix(router.py): support fallbacks on /v1/messages

adds working fallbacks on generic api route

* refactor(router.py): point _ageneric_api_call_with_fallbacks to updated function

* test: add unit test for new helper on router

* fix(router.py): use correct metadata variable name

* fix(router.py): use correct metadata field

* docs(config_settings.md): document new param
2025-07-09 22:27:55 -07:00
Krish Dholakia 635367b020 Litellm dev 07 09 2025 p1 (#12462)
* fix(db_spend_update_writer.py): fix db query

* fix(litellm_pre_call_utils.py): support passing anthropic-beta headers when 'forward_client_headers_to_llm_api' is True

allows user to pass along extra headers to vertex ai anthropic models

* docs(config_settings.md): update docs
2025-07-09 21:46:15 -07:00
Ishaan Jaff 35bfa7c9ee [MCP Gateway] - Allow using custom post call MCP hook for cost tracking (#12469)
* add async_post_mcp_tool_call_hook to custom logger

* instrument call_mcp_tool

* add async_post_mcp_tool_call_hook

* fixes for MCP tests

* test fix MCP tests

* allow adding custom cost for MCP response

* fix LiteLLM_MCPTextContent

* add MCPPostCallResponseObject

* fix _handle_local_mcp_tool

* async_post_mcp_tool_call_hook

* fix typing loc

* fix call_mcp_tool

* fix server.py

* fix MCPPostCallResponseObject

* async_post_mcp_tool_call_hook

* docs mcp cost hook

* fix import path
2025-07-09 18:41:08 -07:00
Ishaan Jaff 17ea770ab5 [Feat] SSO - Allow users to run a custom sso login handler (#12465)
* fix return_ui_sso_redirect_response_after_sign_in

* add CustomSSOLoginHandler

* add handle_custom_ui_sso_sign_in

* fix handle_custom_ui_sso_sign_in

* fixes for /sso/key/generate

* add test_handle_custom_ui_sso_sign_in_success

* fixed for loading config

* add example custom handler

* test_custom_ui_sso_sign_in_handler_config_loading

* docs - custom sso

* move to enterprise folder

* EnterpriseCustomSSOHandler

* handle_custom_ui_sso_sign_in

* docs custom sso

* docs sso

* docs custom sso

* get_redirect_response_from_openid

* fix mock tests
2025-07-09 16:36:30 -07:00
Ishaan Jaff afd382d09f [Feat] MCP Gateway - Allow customizing what client side header to use (#12460)
* add _get_mcp_auth_header_from_headers

* test_process_mcp_request_with_custom_auth_header

* Using a different Authentication Header

* fix customize MCP Auth header name
2025-07-09 12:30:20 -07:00
Ishaan Jaff ce2934349f [Feat] Add XInference Image Generation API Provider (#12439)
* add XInferenceImageGenerationConfig

* add get_xinference_image_generation_config

* test_xinference_image_generation

* docs Image Generation xinference

* docs inference

* docs xinference

* fix xinference img gen
2025-07-08 21:17:38 -07:00