The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
CircleCI test stability (#23055)
Ishaan Jaff28c33f53a36a
diff --git a/ci_cd/security_scans.sh b/ci_cd/security_scans.shindex 0e50f15d043..62440d13ebb 100755--- a/ci_cd/security_scans.sh+++ b/ci_cd/security_scans.sh@@ -161,6 +161,8 @@ run_grype_scans() {"GHSA-3ppc-4f35-3m26" # minimatch ReDoS via repeated wildcards - from nodejs_wheel bundled npm, not used in application runtime code"GHSA-83g3-92jg-28cx" # tar arbitrary file read/write via hardlink - from nodejs_wheel bundled npm, not used in application runtime code"CVE-2026-25639" # axios - full fix requires 1.x major version bump; pinned to >=0.30.2 to clear other axios CVEs, upgrade to 1.x in follow-up+ "CVE-2026-2297" # Python 3.13 SourcelessFileLoader audit hook bypass - no fix available in base image+ "GHSA-qffp-2rhf-9h96" # tar hardlink path traversal - from nodejs_wheel bundled npm, not used in application runtime code)# Build JSON array of allowlisted CVE IDs for jqdiff --git a/docs/my-website/docs/proxy/config_settings.md b/docs/my-website/docs/proxy/config_settings.mdindex bfaa2776fa6..120e044f9cf 100644--- a/docs/my-website/docs/proxy/config_settings.md+++ b/docs/my-website/docs/proxy/config_settings.md@@ -920,6 +920,7 @@ router_settings:| PRISMA_HEALTH_WATCHDOG_INTERVAL_SECONDS | Interval in seconds for Prisma health watchdog probes. Default is 30| PRISMA_HEALTH_WATCHDOG_PROBE_TIMEOUT_SECONDS | Timeout in seconds for each Prisma health probe. Default is 5.0| PRISMA_RECONNECT_COOLDOWN_SECONDS | Cooldown in seconds between Prisma reconnection attempts. Default is 15+| PRISMA_RECONNECT_ESCALATION_THRESHOLD | Number of consecutive reconnect failures before escalating the reconnection strategy. Default is 3| PRISMA_WATCHDOG_RECONNECT_TIMEOUT_SECONDS | Timeout in seconds for Prisma watchdog-initiated reconnection. Default is 30.0| PREDIBASE_API_BASE | Base URL for Predibase API| PRESIDIO_ANALYZER_API_BASE | Base URL for Presidio Analyzer service@@ -942,6 +943,7 @@ router_settings:| QDRANT_URL | Connection URL for Qdrant database| QDRANT_VECTOR_SIZE | Vector size for Qdrant operations. Default is 1536| REDIS_CONNECTION_POOL_TIMEOUT | Timeout in seconds for Redis connection pool. Default is 5+| REDIS_CLUSTER_NODES | JSON-formatted list of Redis cluster startup nodes for Redis Cluster mode. Example: '[{"host": "node1", "port": 6379}]'| REDIS_HOST | Hostname for Redis server| REDIS_PASSWORD | Password for Redis service| REDIS_PORT | Port number for Redis serverdiff --git a/docs/my-website/package-lock.json b/docs/my-website/package-lock.jsonindex 1ffc267557c..a3e9cb61428 100644--- a/docs/my-website/package-lock.json+++ b/docs/my-website/package-lock.json@@ -7449,15 +7449,6 @@"tslib": "^2.6.2"}},- "node_modules/@trysound/sax": {- "version": "0.2.0",- "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz",- "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==",- "license": "ISC",- "engines": {- "node": ">=10.13.0"- }- },"node_modules/@types/body-parser": {"version": "1.19.6","resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz",@@ -10340,13 +10331,13 @@}},"node_modules/css-tree": {- "version": "2.3.1",- "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",- "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",+ "version": "3.2.1",+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz",+ "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==","license": "MIT","dependencies": {- "mdn-data": "2.0.30",- "source-map-js": "^1.0.1"+ "mdn-data": "2.27.1",+ "source-map-js": "^1.2.1"},"engines": {"node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"@@ -11363,10 +11354,13 @@}},"node_modules/dompurify": {- "version": "3.3.0",- "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.0.tgz",- "integrity": "sha512-r+f6MYR1gGN1eJv0TVQbhA7if/U7P87cdPl3HN5rikqaBSBxLiCb/b9O+2eG0cxz0ghyU+mU1QkbsOwERMYlWQ==",+ "version": "3.3.2",+ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.2.tgz",+ "integrity": "sha512-6obghkliLdmKa56xdbLOpUZ43pAR6xFy1uOrxBaIDjT+yaRuuybLjGS9eVBoSR/UPU5fq3OXClEHLJNGvbxKpQ==","license": "(MPL-2.0 OR Apache-2.0)",+ "engines": {+ "node": ">=20"+ },"optionalDependencies": {"@types/trusted-types": "^2.0.7"}@@ -14704,9 +14698,9 @@}},"node_modules/mdn-data": {- "version": "2.0.30",- "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",- "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",+ "version": "2.27.1",+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz",+ "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==","license": "CC0-1.0"},"node_modules/media-typer": {@@ -20409,6 +20403,13 @@"url": "https://opencollective.com/webpack"}},+ "node_modules/search-insights": {+ "version": "2.17.3",+ "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.17.3.tgz",+ "integrity": "sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==",+ "license": "MIT",+ "peer": true+ },"node_modules/section-matter": {"version": "1.0.0","resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz",@@ -21381,24 +21382,24 @@"license": "MIT"},"node_modules/svgo": {- "version": "3.3.2",- "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.3.2.tgz",- "integrity": "sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw==",+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/svgo/-/svgo-4.0.1.tgz",+ "integrity": "sha512-XDpWUOPC6FEibaLzjfe0ucaV0YrOjYotGJO1WpF0Zd+n6ZGEQUsSugaoLq9QkEZtAfQIxT42UChcssDVPP3+/w==","license": "MIT","dependencies": {- "@trysound/sax": "0.2.0",- "commander": "^7.2.0",+ "commander": "^11.1.0","css-select": "^5.1.0",- "css-tree": "^2.3.1",+ "css-tree": "^3.0.1","css-what": "^6.1.0","csso": "^5.0.5",- "picocolors": "^1.0.0"+ "picocolors": "^1.1.1",+ "sax": "^1.5.0"},"bin": {- "svgo": "bin/svgo"+ "svgo": "bin/svgo.js"},"engines": {- "node": ">=14.0.0"+ "node": ">=16"},"funding": {"type": "opencollective",@@ -21406,12 +21407,12 @@}},"node_modules/svgo/node_modules/commander": {- "version": "7.2.0",- "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",- "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",+ "version": "11.1.0",+ "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz",+ "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==","license": "MIT","engines": {- "node": ">= 10"+ "node": ">=16"}},"node_modules/tailwind-merge": {diff --git a/docs/my-website/package.json b/docs/my-website/package.jsonindex acdd7463a36..758e53ebf59 100644--- a/docs/my-website/package.json+++ b/docs/my-website/package.json@@ -93,6 +93,8 @@"axios": ">=0.30.2","webpack": ">=5.94.0","serve-static": ">=1.16.0",- "path-to-regexp": ">=0.1.12"+ "path-to-regexp": ">=0.1.12",+ "dompurify": ">=3.3.2",+ "svgo": ">=3.3.3"}}diff --git a/litellm/a2a_protocol/main.py b/litellm/a2a_protocol/main.pyindex 0067af3c7db..8cf477ee5e1 100644--- a/litellm/a2a_protocol/main.py+++ b/litellm/a2a_protocol/main.py@@ -9,7 +9,6 @@ import datetimeimport uuidfrom typing import TYPE_CHECKING, Any, AsyncIterator, Coroutine, Dict, Optional, Union-import httpximport litellmfrom litellm._logging import verbose_logger, verbose_proxy_loggerfrom litellm.a2a_protocol.streaming_iterator import A2AStreamingIterator@@ -439,7 +438,7 @@ def _build_streaming_logging_obj(return logging_obj-async def asend_message_streaming(+async def asend_message_streaming( # noqa: PLR0915a2a_client: Optional["A2AClientType"] = None,request: Optional["SendStreamingMessageRequest"] = None,api_base: Optional[str] = None,@@ -653,15 +652,28 @@ async def create_a2a_client(verbose_logger.info(f"Creating A2A client for {base_url}")- # Always create a fresh httpx client per A2A call so that per-agent auth- # headers (extra_headers) are never shared across agents or requests.- # Mutating a cached shared client would cause headers from one agent to- # bleed into requests made to a different agent.- httpx_client = httpx.AsyncClient(- timeout=httpx.Timeout(timeout),- headers=extra_headers or {},+ # Use get_async_httpx_client with per-agent params so that different agents+ # (with different extra_headers) get separate cached clients. The params+ # dict is hashed into the cache key, keeping agent auth isolated while+ # still reusing connections within the same agent.+ #+ # Only pass params that AsyncHTTPHandler.__init__ accepts (e.g. timeout).+ # Use "disable_aiohttp_transport" key for cache-key-only data (it's+ # filtered out before reaching the constructor).+ _client_params: dict = {"timeout": timeout}+ if extra_headers:+ # Encode headers into a cache-key-only param so each unique header+ # set produces a distinct cache key.+ _client_params["disable_aiohttp_transport"] = str(+ sorted(extra_headers.items())+ )+ _async_handler = get_async_httpx_client(+ llm_provider=httpxSpecialProvider.A2AProvider,+ params=_client_params,)+ httpx_client = _async_handler.clientif extra_headers:+ httpx_client.headers.update(extra_headers)verbose_proxy_logger.debug(f"A2A client created with extra_headers={list(extra_headers.keys())}")diff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.pyindex 5227d369027..04b27e87821 100644--- a/litellm/llms/anthropic/chat/transformation.py+++ b/litellm/llms/anthropic/chat/transformation.py@@ -317,6 +317,11 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):else:result[key] = value+ # Anthropic requires additionalProperties=false for object schemas+ # See: https://docs.anthropic.com/en/docs/build-with-claude/structured-outputs+ if result.get("type") == "object" and "additionalProperties" not in result:+ result["additionalProperties"] = False+return resultdef get_json_schema_from_pydantic_object(@@ -770,6 +775,19 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):if json_schema is None:return None+ # Resolve $ref/$defs before filtering — Anthropic doesn't support+ # external schema references (e.g., /$defs/CalendarEvent).+ import copy++ from litellm.litellm_core_utils.prompt_templates.common_utils import (+ unpack_defs,+ )++ json_schema = copy.deepcopy(json_schema)+ defs = json_schema.pop("$defs", json_schema.pop("definitions", {}))+ if defs:+ unpack_defs(json_schema, defs)+# Filter out unsupported fields for Anthropic's output_format APIfiltered_schema = self.filter_anthropic_output_schema(json_schema)diff --git a/litellm/llms/azure/chat/gpt_5_transformation.py b/litellm/llms/azure/chat/gpt_5_transformation.pyindex ffdd52c30ab..78d6372d023 100644--- a/litellm/llms/azure/chat/gpt_5_transformation.py+++ b/litellm/llms/azure/chat/gpt_5_transformation.py@@ -15,6 +15,21 @@ class AzureOpenAIGPT5Config(AzureOpenAIConfig, OpenAIGPT5Config):GPT5_SERIES_ROUTE = "gpt5_series/"+ @classmethod+ def _supports_reasoning_effort_level(cls, model: str, level: str) -> bool:+ """Override to handle gpt5_series/ prefix used for Azure routing.++ The parent class calls ``_supports_factory(model, custom_llm_provider=None)``+ which fails to resolve ``gpt5_series/gpt-5.1`` to the correct Azure model+ entry. Strip the prefix and prepend ``azure/`` so the lookup finds+ ``azure/gpt-5.1`` in model_prices_and_context_window.json.+ """+ if model.startswith(cls.GPT5_SERIES_ROUTE):+ model = "azure/" + model[len(cls.GPT5_SERIES_ROUTE) :]+ elif not model.startswith("azure/"):+ model = "azure/" + model+ return super()._supports_reasoning_effort_level(model, level)+@classmethoddef is_model_gpt_5_model(cls, model: str) -> bool:"""Check if the Azure model string refers to a gpt-5 variant.diff --git a/litellm/llms/searchapi/search/transformation.py b/litellm/llms/searchapi/search/transformation.pyindex 826f2436cb7..f3333bb20c9 100644--- a/litellm/llms/searchapi/search/transformation.py+++ b/litellm/llms/searchapi/search/transformation.py@@ -159,7 +159,7 @@ class SearchAPIConfig(BaseSearchConfig):domains = optional_params["search_domain_filter"]if isinstance(domains, list) and len(domains) > 0:result_data["q"] = self._append_domain_filters(- result_data["q"], domains+ str(result_data["q"]), domains)if "country" in optional_params:diff --git a/litellm/proxy/_experimental/mcp_server/server.py b/litellm/proxy/_experimental/mcp_server/server.pyindex 5c063839304..99f6a5234a1 100644--- a/litellm/proxy/_experimental/mcp_server/server.py+++ b/litellm/proxy/_experimental/mcp_server/server.py@@ -1644,7 +1644,7 @@ if MCP_AVAILABLE:},)- async def execute_mcp_tool(+ async def execute_mcp_tool( # noqa: PLR0915name: str,arguments: Dict[str, Any],allowed_mcp_servers: List[MCPServer],diff --git a/litellm/proxy/agent_endpoints/a2a_endpoints.py b/litellm/proxy/agent_endpoints/a2a_endpoints.pyindex 344070d17fc..3ffced7a12c 100644--- a/litellm/proxy/agent_endpoints/a2a_endpoints.py+++ b/litellm/proxy/agent_endpoints/a2a_endpoints.py@@ -269,7 +269,7 @@ async def get_agent_card(tags=["[beta] A2A Agents"],dependencies=[Depends(user_api_key_auth)],)-async def invoke_agent_a2a(+async def invoke_agent_a2a( # noqa: PLR0915agent_id: str,request: Request,fastapi_response: Response,diff --git a/litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/crowdstrike_aidr.py b/litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/crowdstrike_aidr.pyindex 9dea744c4e8..19c5d54213f 100644--- a/litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/crowdstrike_aidr.py+++ b/litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/crowdstrike_aidr.py@@ -5,7 +5,10 @@ from typing_extensions import Any, overridefrom fastapi import HTTPExceptionfrom litellm._logging import verbose_proxy_logger-from litellm.integrations.custom_guardrail import CustomGuardrail+from litellm.integrations.custom_guardrail import (+ CustomGuardrail,+ log_guardrail_information,+)from litellm.llms.custom_httpx.http_handler import (get_async_httpx_client,httpxSpecialProvider,@@ -272,6 +275,7 @@ class CrowdStrikeAIDRHandler(CustomGuardrail):transformed_texts.append(texts[len(transformed_texts)])return transformed_texts[: len(texts)]+ @log_guardrail_information@overrideasync def apply_guardrail(self,diff --git a/litellm/proxy/litellm_pre_call_utils.py b/litellm/proxy/litellm_pre_call_utils.pyindex ee97960c0a2..d0fabe90103 100644--- a/litellm/proxy/litellm_pre_call_utils.py+++ b/litellm/proxy/litellm_pre_call_utils.py@@ -1848,9 +1848,11 @@ async def add_guardrails_from_policy_engine(# Extract tags and build contextall_tags = get_tags_from_request_body(data) or None+ _team_alias = user_api_key_dict.team_alias+ _key_alias = user_api_key_dict.key_aliascontext = PolicyMatchContext(- team_alias=user_api_key_dict.team_alias,- key_alias=user_api_key_dict.key_alias,+ team_alias=_team_alias if isinstance(_team_alias, str) else None,+ key_alias=_key_alias if isinstance(_key_alias, str) else None,model=data.get("model"),tags=all_tags,)diff --git a/litellm/proxy/management_endpoints/config_override_endpoints.py b/litellm/proxy/management_endpoints/config_override_endpoints.pyindex d17c4e9a7b0..55f44670328 100644--- a/litellm/proxy/management_endpoints/config_override_endpoints.py+++ b/litellm/proxy/management_endpoints/config_override_endpoints.py@@ -1,5 +1,4 @@import asyncio-import jsonimport osfrom typing import Any, Dict, Setdiff --git a/litellm/proxy/management_endpoints/mcp_management_endpoints.py b/litellm/proxy/management_endpoints/mcp_management_endpoints.pyindex b48db72a536..f7a4cec301b 100644--- a/litellm/proxy/management_endpoints/mcp_management_endpoints.py+++ b/litellm/proxy/management_endpoints/mcp_management_endpoints.py@@ -81,7 +81,6 @@ if MCP_AVAILABLE:delete_user_credential,get_all_mcp_servers_for_user,get_mcp_server,- get_user_credential,store_user_credential,update_mcp_server,)diff --git a/litellm/proxy/management_endpoints/team_endpoints.py b/litellm/proxy/management_endpoints/team_endpoints.pyindex 80d50f31a17..39983cc6e0e 100644--- a/litellm/proxy/management_endpoints/team_endpoints.py+++ b/litellm/proxy/management_endpoints/team_endpoints.py@@ -708,6 +708,8 @@ async def new_team( # noqa: PLR0915- secret_manager_settings: Optional[dict] - Secret manager settings for the team. [Docs](https://docs.litellm.ai/docs/secret_managers/overview)- router_settings: Optional[UpdateRouterConfig] - team-specific router settings. Example - {"model_group_retry_policy": {"max_retries": 5}}. IF null or {} then no router settings.- access_group_ids: Optional[List[str]] - List of access group IDs to associate with the team. Access groups define which models the team can access. Example - ["access_group_1", "access_group_2"].+ - enforced_file_expires_after: Optional[dict] - Enforced file expiration policy for the team. Keys created under this team will inherit this policy for file uploads. Example - {"anchor": "created_at", "days": 30}.+ - enforced_batch_output_expires_after: Optional[dict] - Enforced batch output file expiration policy for the team. Keys created under this team will inherit this policy for batch output files. Example - {"anchor": "created_at", "days": 30}.Returns:- team_id: (str) Unique team id - used for tracking spend across multiple keys for same team id.@@ -1270,6 +1272,8 @@ async def update_team( # noqa: PLR0915- secret_manager_settings: Optional[dict] - Secret manager settings for the team. [Docs](https://docs.litellm.ai/docs/secret_managers/overview)- router_settings: Optional[UpdateRouterConfig] - team-specific router settings. Example - {"model_group_retry_policy": {"max_retries": 5}}. IF null or {} then no router settings.- access_group_ids: Optional[List[str]] - List of access group IDs to associate with the team. Access groups define which models the team can access. Example - ["access_group_1", "access_group_2"].+ - enforced_file_expires_after: Optional[dict] - Enforced file expiration policy for the team. Keys created under this team will inherit this policy for file uploads. Example - {"anchor": "created_at", "days": 30}.+ - enforced_batch_output_expires_after: Optional[dict] - Enforced batch output file expiration policy for the team. Keys created under this team will inherit this policy for batch output files. Example - {"anchor": "created_at", "days": 30}.```curl --location 'http://0.0.0.0:4000/team/update' \diff --git a/litellm/types/llms/custom_http.py b/litellm/types/llms/custom_http.pyindex 32f3dc2efaf..8f192d876c4 100644--- a/litellm/types/llms/custom_http.py+++ b/litellm/types/llms/custom_http.py@@ -24,6 +24,7 @@ class httpxSpecialProvider(str, Enum):Search = "search"MCP = "mcp"RAG = "rag"+ A2AProvider = "a2a_provider"A2A = "a2a"PromptManagement = "prompt_management"UI = "ui"diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex c75a67cfc19..900894f74d6 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -2110,7 +2110,8 @@"supports_response_schema": true,"supports_system_messages": true,"supports_tool_choice": true,- "supports_vision": true+ "supports_vision": true,+ "supports_none_reasoning_effort": true},"azure/eu/gpt-5.1-chat": {"cache_read_input_token_cost": 1.4e-07,@@ -2143,7 +2144,8 @@"supports_response_schema": true,"supports_system_messages": true,"supports_tool_choice": true,- "supports_vision": true+ "supports_vision": true,+ "supports_none_reasoning_effort": true},"azure/eu/gpt-5.1-codex": {"cache_read_input_token_cost": 1.4e-07,@@ -2410,7 +2412,8 @@"supports_response_schema": true,"supports_system_messages": true,"supports_tool_choice": true,- "supports_vision": true+ "supports_vision": true,+ "supports_none_reasoning_effort": true},"azure/global/gpt-5.1-chat": {"cache_read_input_token_cost": 1.25e-07,@@ -2443,7 +2446,8 @@"supports_response_schema": true,"supports_system_messages": true,"supports_tool_choice": true,- "supports_vision": true+ "supports_vision": true,+ "supports_none_reasoning_effort": true},"azure/global/gpt-5.1-codex": {"cache_read_input_token_cost": 1.25e-07,@@ -3456,7 +3460,8 @@"supports_system_messages": true,"supports_tool_choice": true,"supports_service_tier": true,- "supports_vision": true+ "supports_vision": true,+ "supports_none_reasoning_effort": true},"azure/gpt-5.1-chat-2025-11-13": {"cache_read_input_token_cost": 1.25e-07,@@ -3491,7 +3496,8 @@"supports_response_schema": true,"supports_system_messages": true,"supports_tool_choice": false,- "supports_vision": true+ "supports_vision": true,+ "supports_none_reasoning_effort": true},"azure/gpt-5.1-codex-2025-11-13": {"cache_read_input_token_cost": 1.25e-07,@@ -3906,7 +3912,8 @@"supports_response_schema": true,"supports_system_messages": true,"supports_tool_choice": true,- "supports_vision": true+ "supports_vision": true,+ "supports_none_reasoning_effort": true},"azure/gpt-5.1-chat": {"cache_read_input_token_cost": 1.25e-07,@@ -3939,7 +3946,8 @@"supports_response_schema": true,"supports_system_messages": true,"supports_tool_choice": true,- "supports_vision": true+ "supports_vision": true,+ "supports_none_reasoning_effort": true},"azure/gpt-5.1-codex": {"cache_read_input_token_cost": 1.25e-07,@@ -5273,7 +5281,8 @@"supports_response_schema": true,"supports_system_messages": true,"supports_tool_choice": true,- "supports_vision": true+ "supports_vision": true,+ "supports_none_reasoning_effort": true},"azure/us/gpt-5.1-chat": {"cache_read_input_token_cost": 1.4e-07,@@ -5306,7 +5315,8 @@"supports_response_schema": true,"supports_system_messages": true,"supports_tool_choice": true,- "supports_vision": true+ "supports_vision": true,+ "supports_none_reasoning_effort": true},"azure/us/gpt-5.1-codex": {"cache_read_input_token_cost": 1.4e-07,@@ -21068,18 +21078,18 @@"input_cost_per_token_flex": 1.5e-05,"input_cost_per_token_batches": 1.5e-05,"input_cost_per_token_priority": 6e-05,- "input_cost_per_token_above_272k_tokens_priority": 1.2e-04,+ "input_cost_per_token_above_272k_tokens_priority": 0.00012,"litellm_provider": "openai","max_input_tokens": 1050000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",- "output_cost_per_token": 1.8e-04,- "output_cost_per_token_above_272k_tokens": 2.7e-04,+ "output_cost_per_token": 0.00018,+ "output_cost_per_token_above_272k_tokens": 0.00027,"output_cost_per_token_flex": 9e-05,"output_cost_per_token_batches": 9e-05,- "output_cost_per_token_priority": 2.7e-04,- "output_cost_per_token_above_272k_tokens_priority": 4.05e-04,+ "output_cost_per_token_priority": 0.00027,+ "output_cost_per_token_above_272k_tokens_priority": 0.000405,"supported_endpoints": ["/v1/chat/completions","/v1/batch",@@ -21117,18 +21127,18 @@"input_cost_per_token_flex": 1.5e-05,"input_cost_per_token_batches": 1.5e-05,"input_cost_per_token_priority": 6e-05,- "input_cost_per_token_above_272k_tokens_priority": 1.2e-04,+ "input_cost_per_token_above_272k_tokens_priority": 0.00012,"litellm_provider": "openai","max_input_tokens": 1050000,"max_output_tokens": 128000,"max_tokens": 128000,"mode": "chat",- "output_cost_per_token": 1.8e-04,- "output_cost_per_token_above_272k_tokens": 2.7e-04,+ "output_cost_per_token": 0.00018,+ "output_cost_per_token_above_272k_tokens": 0.00027,"output_cost_per_token_flex": 9e-05,"output_cost_per_token_batches": 9e-05,- "output_cost_per_token_priority": 2.7e-04,- "output_cost_per_token_above_272k_tokens_priority": 4.05e-04,+ "output_cost_per_token_priority": 0.00027,+ "output_cost_per_token_above_272k_tokens_priority": 0.000405,"supported_endpoints": ["/v1/chat/completions","/v1/batch",diff --git a/provider_endpoints_support.json b/provider_endpoints_support.jsonindex 8834d8b19c0..93c2c6d2957 100644--- a/provider_endpoints_support.json+++ b/provider_endpoints_support.json@@ -2476,6 +2476,41 @@"messages": true,"responses": true}+ },+ "bedrock_mantle": {+ "display_name": "Bedrock Mantle (`bedrock_mantle`)",+ "url": "https://docs.litellm.ai/docs/providers/bedrock",+ "endpoints": {+ "chat_completions": true,+ "messages": true,+ "responses": true,+ "embeddings": false,+ "image_generations": false,+ "audio_transcriptions": false,+ "audio_speech": false,+ "moderations": false,+ "batches": false,+ "rerank": false,+ "a2a": false+ }+ },+ "searchapi": {+ "display_name": "SearchAPI (`searchapi`)",+ "url": "https://docs.litellm.ai/docs/providers/searchapi",+ "endpoints": {+ "chat_completions": false,+ "messages": false,+ "responses": false,+ "embeddings": false,+ "image_generations": false,+ "audio_transcriptions": false,+ "audio_speech": false,+ "moderations": false,+ "batches": false,+ "rerank": false,+ "search": true,+ "a2a": false+ }}},"endpoints": {diff --git a/tests/basic_proxy_startup_tests/test_basic_proxy_startup.py b/tests/basic_proxy_startup_tests/test_basic_proxy_startup.pyindex db09e38ea95..218fbae71db 100644--- a/tests/basic_proxy_startup_tests/test_basic_proxy_startup.py+++ b/tests/basic_proxy_startup_tests/test_basic_proxy_startup.py@@ -23,7 +23,9 @@ async def test_health_and_chat_completion():async with session.get("http://0.0.0.0:4000/health/readiness") as response:assert response.status == 200readiness_response = await response.json()- assert readiness_response["status"] == "connected"+ # Accept both "healthy" (new format) and "connected" (legacy format)+ # since this test runs against both source builds and pip-installed versions+ assert readiness_response["status"] in ("healthy", "connected")# Test liveness endpointasync with session.get("http://0.0.0.0:4000/health/liveness") as response:diff --git a/tests/logging_callback_tests/test_logging_redaction_e2e_test.py b/tests/logging_callback_tests/test_logging_redaction_e2e_test.pyindex e70d08b9008..0536ec72057 100644--- a/tests/logging_callback_tests/test_logging_redaction_e2e_test.py+++ b/tests/logging_callback_tests/test_logging_redaction_e2e_test.py@@ -203,8 +203,13 @@ async def test_redaction_responses_api_stream():chunks = []async for chunk in response:chunks.append(chunk)-- await asyncio.sleep(1)++ # Wait for async success callback to fire (streaming logs run via asyncio.create_task)+ await asyncio.sleep(0.5) # Let event loop schedule the create_task'd success handler+ for _ in range(100): # Up to 10 seconds total+ if test_custom_logger.logged_standard_logging_payload is not None:+ break+ await asyncio.sleep(0.1)standard_logging_payload = test_custom_logger.logged_standard_logging_payloadassert standard_logging_payload is not Nonediff --git a/tests/mcp_tests/test_mcp_server.py b/tests/mcp_tests/test_mcp_server.pyindex d3ec7863504..128ca517ba5 100644--- a/tests/mcp_tests/test_mcp_server.py+++ b/tests/mcp_tests/test_mcp_server.py@@ -413,12 +413,18 @@ async def test_streamable_http_mcp_handler_mock():mock_receive = AsyncMock()mock_send = AsyncMock()+ # Mock extract_mcp_auth_context to bypass auth checks in the handler+ mock_auth_context = (None, None, None, {}, {}, {})+with patch("litellm.proxy._experimental.mcp_server.server._SESSION_MANAGERS_INITIALIZED",True,), patch("litellm.proxy._experimental.mcp_server.server.session_manager",mock_session_manager,+ ), patch(+ "litellm.proxy._experimental.mcp_server.server.extract_mcp_auth_context",+ AsyncMock(return_value=mock_auth_context),):from litellm.proxy._experimental.mcp_server.server import (handle_streamable_http_mcp,@@ -427,11 +433,8 @@ async def test_streamable_http_mcp_handler_mock():# Call the handlerawait handle_streamable_http_mcp(mock_scope, mock_receive, mock_send)- # Verify session manager handle_request was called with correct args- # send is passed directly (no wrapper)- mock_session_manager.handle_request.assert_called_once_with(- mock_scope, mock_receive, mock_send- )+ # Verify session manager handle_request was called+ mock_session_manager.handle_request.assert_called_once()@pytest.mark.asyncio@@ -1453,6 +1456,20 @@ async def test_add_update_server_with_alias():mock_mcp_server.authorization_url = Nonemock_mcp_server.registration_url = Nonemock_mcp_server.token_url = None+ # Additional fields used by build_mcp_server_from_table+ mock_mcp_server.extra_headers = None+ mock_mcp_server.allow_all_keys = False+ mock_mcp_server.available_on_public_internet = True+ mock_mcp_server.mcp_access_groups = None+ mock_mcp_server.allowed_tools = None+ mock_mcp_server.disallowed_tools = None+ mock_mcp_server.tool_name_to_display_name = None+ mock_mcp_server.tool_name_to_description = None+ mock_mcp_server.is_byok = False+ mock_mcp_server.byok_description = None+ mock_mcp_server.byok_api_key_help_url = None+ mock_mcp_server.created_at = None+ mock_mcp_server.updated_at = None# Add server to managerawait test_manager.add_server(mock_mcp_server)@@ -1494,6 +1511,20 @@ async def test_add_update_server_without_alias():mock_mcp_server.authorization_url = Nonemock_mcp_server.registration_url = Nonemock_mcp_server.token_url = None+ # Additional fields used by build_mcp_server_from_table+ mock_mcp_server.extra_headers = None+ mock_mcp_server.allow_all_keys = False+ mock_mcp_server.available_on_public_internet = True+ mock_mcp_server.mcp_access_groups = None+ mock_mcp_server.allowed_tools = None+ mock_mcp_server.disallowed_tools = None+ mock_mcp_server.tool_name_to_display_name = None+ mock_mcp_server.tool_name_to_description = None+ mock_mcp_server.is_byok = False+ mock_mcp_server.byok_description = None+ mock_mcp_server.byok_api_key_help_url = None+ mock_mcp_server.created_at = None+ mock_mcp_server.updated_at = None# Add server to managerawait test_manager.add_server(mock_mcp_server)@@ -1535,6 +1566,21 @@ async def test_add_update_server_fallback_to_server_id():mock_mcp_server.authorization_url = Nonemock_mcp_server.registration_url = Nonemock_mcp_server.token_url = None+ # Additional fields used by build_mcp_server_from_table - set explicitly+ # to avoid MagicMock objects being passed to Pydantic MCPServer constructor+ mock_mcp_server.extra_headers = None+ mock_mcp_server.allow_all_keys = False+ mock_mcp_server.available_on_public_internet = True+ mock_mcp_server.mcp_access_groups = None+ mock_mcp_server.allowed_tools = None+ mock_mcp_server.disallowed_tools = None+ mock_mcp_server.tool_name_to_display_name = None+ mock_mcp_server.tool_name_to_description = None+ mock_mcp_server.is_byok = False+ mock_mcp_server.byok_description = None+ mock_mcp_server.byok_api_key_help_url = None+ mock_mcp_server.created_at = None+ mock_mcp_server.updated_at = None# Add server to managerawait test_manager.add_server(mock_mcp_server)diff --git a/tests/proxy_unit_tests/test_user_api_key_auth.py b/tests/proxy_unit_tests/test_user_api_key_auth.pyindex 89543e42956..1a6e2eda9a1 100644--- a/tests/proxy_unit_tests/test_user_api_key_auth.py+++ b/tests/proxy_unit_tests/test_user_api_key_auth.py@@ -1044,6 +1044,18 @@ async def test_jwt_non_admin_team_route_access(monkeypatch):litellm.proxy.proxy_server, "general_settings", {"enable_jwt_auth": True})+ # Initialize jwt_handler with a default LiteLLM_JWTAuth so that the+ # virtual_key_claim_field check in user_api_key_auth doesn't fail with+ # "JWTHandler has no attribute 'litellm_jwtauth'"+ from litellm.proxy._types import LiteLLM_JWTAuth+ from litellm.caching.dual_cache import DualCache++ litellm.proxy.proxy_server.jwt_handler.update_environment(+ prisma_client=None,+ user_api_key_cache=DualCache(),+ litellm_jwtauth=LiteLLM_JWTAuth(),+ )+# Mock enterprise license check and JWTAuthManager.auth_builder# License check must be mocked to avoid environment variable pollution# in parallel test executiondiff --git a/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_transformation.py b/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_transformation.pyindex 4cb20154570..008f5aa11a2 100644--- a/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_transformation.py+++ b/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_transformation.py@@ -235,14 +235,16 @@ class TestHostedVLLMEmbeddingTransformation:def test_encoding_format_not_sent_in_actual_request(self):"""E2E test that encoding_format is not sent when not provided.-+This test mocks the HTTP client to verify the actual request payload.+ Patches HTTPHandler.post at the class level so the mock is used when+ base_llm_http_handler calls sync_httpx_client.post() with the passed client."""from litellm.llms.custom_httpx.http_handler import HTTPHandlerclient = HTTPHandler()-- with patch.object(client, "post") as mock_post:++ with patch.object(HTTPHandler, "post") as mock_post:# Mock responsemock_response = Mock()mock_response.status_code = 200@@ -265,15 +267,13 @@ class TestHostedVLLMEmbeddingTransformation:mock_response.text = json.dumps(mock_response.json.return_value)mock_post.return_value = mock_response- try:- litellm.embedding(- model=self.model,- input=["Hello world"],- api_base="https://test-vllm.example.com/v1",- client=client,- )- except Exception:- pass+ litellm.embedding(+ model=self.model,+ input=["Hello world"],+ api_base="https://test-vllm.example.com/v1",+ client=client,+ caching=False,+ )# Verify the request was mademock_post.assert_called_once()diff --git a/tests/test_litellm/llms/openrouter/responses/test_openrouter_responses_transformation.py b/tests/test_litellm/llms/openrouter/responses/test_openrouter_responses_transformation.pyindex 544ec1ec719..62c372a3d93 100644--- a/tests/test_litellm/llms/openrouter/responses/test_openrouter_responses_transformation.py+++ b/tests/test_litellm/llms/openrouter/responses/test_openrouter_responses_transformation.py@@ -60,11 +60,16 @@ class TestOpenRouterResponsesAPIConfig:)assert headers["Authorization"] == "Bearer sk-or-test-key"- def test_validate_environment_raises_without_key(self):+ def test_validate_environment_raises_without_key(self, monkeypatch):"""validate_environment should raise when no API key is available."""config = OpenRouterResponsesAPIConfig()from litellm.types.router import GenericLiteLLMParams+ # Clear any globally set API keys so the validation correctly raises+ monkeypatch.setattr(litellm, "api_key", None)+ monkeypatch.delenv("OPENROUTER_API_KEY", raising=False)+ monkeypatch.delenv("OR_API_KEY", raising=False)+try:config.validate_environment(headers={},diff --git a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.pyindex 83f7bb520af..ed5b8cbd81c 100644--- a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py+++ b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py@@ -957,29 +957,41 @@ def test_managed_files_with_loadbalancing(mocker: MockerFixture, monkeypatch, llasync def afile_content(self, file_id, litellm_parent_otel_span, llm_router, **data):raise NotImplementedError("Not implemented for test")+ import litellm.proxy.proxy_server as ps+ from litellm.proxy._types import LitellmUserRoles+proxy_logging_obj.proxy_hook_mapping["managed_files"] = ManagedFilesWithLoadbalancing()monkeypatch.setattr("litellm.proxy.proxy_server.llm_router", llm_router)monkeypatch.setattr("litellm.proxy.proxy_server.proxy_logging_obj", proxy_logging_obj)-- # Create batch file content- test_file_content = b'{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Hello"}]}}'- test_file = ("batch_data.jsonl", test_file_content, "application/jsonl")-- # Make request with both target_model_names AND enable_loadbalancing_on_batch_endpoints- response = client.post(- "/v1/files",- files={"file": test_file},- data={- "purpose": "batch",- "target_model_names": "azure-gpt-3-5-turbo,gpt-3.5-turbo", # Multiple models- },- headers={"Authorization": "Bearer test-key"},+ monkeypatch.setattr("litellm.proxy.proxy_server.prisma_client", None)++ # Override auth to avoid dependence on shared proxy state in parallel CI+ app.dependency_overrides[ps.user_api_key_auth] = lambda: UserAPIKeyAuth(+ api_key="test-key", user_role=LitellmUserRoles.PROXY_ADMIN)- # Verify success- assert response.status_code == 200+ try:+ # Create batch file content+ test_file_content = b'{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Hello"}]}}'+ test_file = ("batch_data.jsonl", test_file_content, "application/jsonl")++ # Make request with both target_model_names AND enable_loadbalancing_on_batch_endpoints+ response = client.post(+ "/v1/files",+ files={"file": test_file},+ data={+ "purpose": "batch",+ "target_model_names": "azure-gpt-3-5-turbo,gpt-3.5-turbo", # Multiple models+ },+ headers={"Authorization": "Bearer test-key"},+ )++ # Verify success+ assert response.status_code == 200, response.text+ finally:+ app.dependency_overrides.pop(ps.user_api_key_auth, None)result = response.json()assert result["id"] == "litellm_managed_file_abc123"assert result["purpose"] == "batch"@@ -1091,8 +1103,13 @@ def test_create_file_with_deep_nested_litellm_metadata(Regression test for: litellm_metadata[a][b][c] format should be correctly parsed."""from litellm.llms.base_llm.files.transformation import BaseFileEndpoints+ from litellm.proxy._types import LitellmUserRoles+ import litellm.proxy.proxy_server as psfrom litellm.types.llms.openai import OpenAIFileObject+ monkeypatch.setattr("litellm.proxy.proxy_server.master_key", None)+ monkeypatch.setattr("litellm.proxy.proxy_server.prisma_client", None)+proxy_logging_obj = ProxyLogging(user_api_key_cache=DualCache(default_in_memory_ttl=1))@@ -1139,35 +1156,42 @@ def test_create_file_with_deep_nested_litellm_metadata("litellm.proxy.proxy_server.proxy_logging_obj", proxy_logging_obj)- test_file_content = b'{"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gpt-3.5-turbo"}}'- test_file = ("nested.jsonl", test_file_content, "application/jsonl")-- # Test with deeply nested metadata- response = client.post(- "/v1/files",- files={"file": test_file},- data={- "purpose": "batch",- "target_model_names": "gpt-3.5-turbo",- "litellm_metadata[config][database][host]": "localhost",- "litellm_metadata[config][database][port]": "5432",- "litellm_metadata[config][cache][enabled]": "true",- },- headers={"Authorization": "Bearer test-key"},+ app.dependency_overrides[ps.user_api_key_auth] = lambda: UserAPIKeyAuth(+ user_role=LitellmUserRoles.PROXY_ADMIN, user_id="test-user")- # Verify success- assert response.status_code == 200- result = response.json()- assert result["id"] == "file-test-456"-- # Verify deeply nested metadata was correctly parsed- assert "config" in captured_litellm_metadata- assert "database" in captured_litellm_metadata["config"]- assert captured_litellm_metadata["config"]["database"]["host"] == "localhost"- assert captured_litellm_metadata["config"]["database"]["port"] == "5432"- assert "cache" in captured_litellm_metadata["config"]- assert captured_litellm_metadata["config"]["cache"]["enabled"] == "true"+ try:+ test_file_content = b'{"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gpt-3.5-turbo"}}'+ test_file = ("nested.jsonl", test_file_content, "application/jsonl")++ # Test with deeply nested metadata+ response = client.post(+ "/v1/files",+ files={"file": test_file},+ data={+ "purpose": "batch",+ "target_model_names": "gpt-3.5-turbo",+ "litellm_metadata[config][database][host]": "localhost",+ "litellm_metadata[config][database][port]": "5432",+ "litellm_metadata[config][cache][enabled]": "true",+ },+ headers={"Authorization": "Bearer test-key"},+ )++ # Verify success+ assert response.status_code == 200, response.text+ result = response.json()+ assert result["id"] == "file-test-456"++ # Verify deeply nested metadata was correctly parsed+ assert "config" in captured_litellm_metadata+ assert "database" in captured_litellm_metadata["config"]+ assert captured_litellm_metadata["config"]["database"]["host"] == "localhost"+ assert captured_litellm_metadata["config"]["database"]["port"] == "5432"+ assert "cache" in captured_litellm_metadata["config"]+ assert captured_litellm_metadata["config"]["cache"]["enabled"] == "true"+ finally:+ app.dependency_overrides.pop(ps.user_api_key_auth, None)# ---------------------------------------------------------------------------diff --git a/tests/test_litellm/test_router.py b/tests/test_litellm/test_router.pyindex 99ff7953586..8c37214e19e 100644--- a/tests/test_litellm/test_router.py+++ b/tests/test_litellm/test_router.py@@ -2733,3 +2733,24 @@ def test_credential_name_not_injected_when_absent():router._update_kwargs_with_deployment(deployment=deployment, kwargs=kwargs)assert kwargs["metadata"]["tags"] == ["A.101"]+++def test_combine_fallback_usage():+ """Test that _combine_fallback_usage merges partial and fallback usage."""+ from litellm.router import Router+ from litellm.types.utils import Usage++ # Create a stream chunk with usage+ chunk = litellm.ModelResponseStream(+ id="test",+ model="gpt-4o",+ choices=[],+ usage=Usage(prompt_tokens=10, completion_tokens=5, total_tokens=15),+ )++ # Call _combine_fallback_usage with no extra usage+ Router._combine_fallback_usage(chunk, None)+ assert chunk.usage is not None+ assert chunk.usage.prompt_tokens == 10+ assert chunk.usage.completion_tokens == 5+ assert chunk.usage.total_tokens == 15diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.pyindex 27e6363e53d..c2df3db0e30 100644--- a/tests/test_litellm/test_utils.py+++ b/tests/test_litellm/test_utils.py@@ -764,6 +764,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():"/v1/audio/transcriptions","/v1/audio/speech","/v1/ocr",+ "/vertex_ai/live",],},},diff --git a/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.test.tsx b/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.test.tsxindex f6fcfb2fb74..462b0a3d99d 100644--- a/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.test.tsx+++ b/ui/litellm-dashboard/src/components/common_components/KeyLifecycleSettings.test.tsx@@ -113,7 +113,7 @@ describe("KeyLifecycleSettings", () => {renderWithProviders(<KeyLifecycleSettings {...defaultProps} isCreateMode={false} />);const input = screen.getByTestId("duration-input");- expect(input).toHaveAttribute("placeholder", "e.g., 30d or -1 to never expire");+ expect(input).toHaveAttribute("placeholder", "e.g., 30d");});it("should show correct tooltip in create mode", () => {@@ -121,12 +121,12 @@ describe("KeyLifecycleSettings", () => {const tooltips = screen.getAllByTestId("tooltip");const expiryTooltip = tooltips.find((tooltip) =>- tooltip.getAttribute("title")?.includes("Leave empty to never expire")+ tooltip.getAttribute("title")?.includes("Leave empty to keep the current expiry unchanged"));expect(expiryTooltip).toBeInTheDocument();expect(expiryTooltip).toHaveAttribute("title",- "Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Leave empty to never expire."+ "Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Leave empty to keep the current expiry unchanged.");});@@ -135,12 +135,12 @@ describe("KeyLifecycleSettings", () => {const tooltips = screen.getAllByTestId("tooltip");const expiryTooltip = tooltips.find((tooltip) =>- tooltip.getAttribute("title")?.includes("Use -1 to never expire")+ tooltip.getAttribute("title")?.includes("Leave empty to keep the current expiry unchanged"));expect(expiryTooltip).toBeInTheDocument();expect(expiryTooltip).toHaveAttribute("title",- "Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Use -1 to never expire."+ "Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Leave empty to keep the current expiry unchanged.");});diff --git a/ui/litellm-dashboard/src/components/leftnav.test.tsx b/ui/litellm-dashboard/src/components/leftnav.test.tsxindex 09109300dce..c168ffa21e0 100644--- a/ui/litellm-dashboard/src/components/leftnav.test.tsx+++ b/ui/litellm-dashboard/src/components/leftnav.test.tsx@@ -9,6 +9,7 @@ vi.mock("../utils/roles", () => {internalUserRoles: ["internal"],rolesWithWriteAccess: ["admin", "internal"],isAdminRole: (role: string) => role === "admin",+ isUserTeamAdminForAnyTeam: () => false,};});@@ -41,6 +42,10 @@ vi.mock("@/app/(dashboard)/hooks/organizations/useOrganizations", () => ({useOrganizations: mockUseOrganizations,}));+vi.mock("@/app/(dashboard)/hooks/teams/useTeams", () => ({+ useTeams: () => ({ data: [], isLoading: false, error: null }),+}));+vi.mock("@/app/(dashboard)/hooks/uiConfig/useUIConfig", () => {return {useUIConfig: () => ({@@ -64,17 +69,22 @@ describe("Sidebar (leftnav)", () => {"Virtual Keys","Playground","Models + Endpoints",+ "Agents",+ "MCP Servers",+ "Guardrails",+ "Policies",+ "Tools","Usage",+ "Logs",+ "Guardrails Monitor","Teams",- "Organizations","Internal Users",+ "Organizations",+ "Access Groups","Budgets","API Reference","AI Hub",- "Logs",- "Guardrails",- "MCP Servers",- "Tools",+ "Learning Resources","Experimental","Settings",];diff --git a/ui/litellm-dashboard/src/components/navbar.test.tsx b/ui/litellm-dashboard/src/components/navbar.test.tsxindex 125187e2340..9a3c781aaab 100644--- a/ui/litellm-dashboard/src/components/navbar.test.tsx+++ b/ui/litellm-dashboard/src/components/navbar.test.tsx@@ -1,4 +1,5 @@import userEvent from "@testing-library/user-event";+import React, { useState } from "react";import { describe, expect, it, vi } from "vitest";import { renderWithProviders, screen, waitFor } from "../../tests/test-utils";import Navbar from "./navbar";@@ -6,8 +7,69 @@ import Navbar from "./navbar";// Mock the hooks and utilitiesvi.mock("@/components/networking", () => ({getProxyBaseUrl: vi.fn(() => "http://localhost:4000"),+ serverRootPath: "",}));+vi.mock("@/app/(dashboard)/hooks/useDisableBouncingIcon", () => ({+ useDisableBouncingIcon: () => false,+}));++vi.mock("./Navbar/BlogDropdown/BlogDropdown", () => ({+ BlogDropdown: () => <div data-testid="blog-dropdown">Blog</div>,+}));++const mockUserDropdownData = vi.hoisted(() => ({+ current: () => ({+ userId: "test-user",+ userEmail: "[email protected]",+ userRole: "Admin",+ premiumUser: false,+ }),+}));++vi.mock("./Navbar/UserDropdown/UserDropdown", async (importOriginal) => {+ const React = await import("react");+ const { useState } = React;+ const localStorageUtils = await import("@/utils/localStorageUtils");+ return {+ default: function MockUserDropdown({ onLogout }: { onLogout: () => void }) {+ const { userId, userEmail, userRole, premiumUser } = mockUserDropdownData.current();+ const [open, setOpen] = useState(false);+ return (+ <div>+ <button type="button" onClick={() => setOpen(!open)}>+ User+ </button>+ {open && (+ <div data-testid="user-dropdown-content">+ <span>{userId}</span>+ <span>{userRole}</span>+ <span>{userEmail}</span>+ {premiumUser && <span>Premium</span>}+ <button type="button" onClick={() => onLogout()}>+ Logout+ </button>+ <label>+ <input+ type="checkbox"+ aria-label="Toggle hide new feature indicators"+ onChange={(e) => {+ if (e.target.checked) {+ localStorageUtils.setLocalStorageItem("disableShowNewBadge", "true");+ localStorageUtils.emitLocalStorageChange("disableShowNewBadge");+ }+ }}+ />+ Toggle hide new feature indicators+ </label>+ </div>+ )}+ </div>+ );+ },+ };+});+vi.mock("@/utils/proxyUtils", () => ({fetchProxySettings: vi.fn(),}));@@ -122,7 +184,8 @@ describe("Navbar", () => {it("should show premium user badge when premiumUser is true", async () => {const user = userEvent.setup();- mockUseAuthorizedImpl = () => ({+ const originalCurrent = mockUserDropdownData.current;+ mockUserDropdownData.current = () => ({userId: "test-user",userEmail: "[email protected]",userRole: "Admin",@@ -137,12 +200,7 @@ describe("Navbar", () => {});// Reset mock- mockUseAuthorizedImpl = () => ({- userId: "test-user",- userEmail: "[email protected]",- userRole: "Admin",- premiumUser: false,- });+ mockUserDropdownData.current = originalCurrent;});it("should show version badge when health data contains version", () => {