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
test: enforce F811 so a duplicate definition cannot silently replace the first
ryan-crabbe-berrie9d40a8f7375
diff --git a/ruff-tests.toml b/ruff-tests.tomlindex 60438d355f0..c6522d6b335 100644--- a/ruff-tests.toml+++ b/ruff-tests.toml@@ -26,6 +26,9 @@# PT014 the same `parametrize` case listed twice. The copy re-runs an assertion that# already passed and adds no coverage, and it usually marks a case someone meant# to vary and forgot to edit+# F811 a name bound twice where the first binding was never used. Mostly a repeated+# import, but the same rule is what catches a second `def test_x` silently+# replacing the first, and a local that shadows an import the module still calls## No target-version here on purpose: it resolves from requires-python (>=3.10), so# 3.11-only builtins like BaseExceptionGroup are correctly flagged in a tree that@@ -33,4 +36,4 @@line-length = 120-lint.select = ["F821", "B011", "B015", "B017", "B018", "PT011", "PT012", "PT014", "PT015", "PLR0133", "PLW0127"]+lint.select = ["F811", "F821", "B011", "B015", "B017", "B018", "PT011", "PT012", "PT014", "PT015", "PLR0133", "PLW0127"]diff --git a/tests/audio_tests/test_audio_speech.py b/tests/audio_tests/test_audio_speech.pyindex 52a2316a16f..fb9e679699a 100644--- a/tests/audio_tests/test_audio_speech.py+++ b/tests/audio_tests/test_audio_speech.py@@ -12,7 +12,6 @@ from litellm._uuid import uuidfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")@@ -452,7 +451,7 @@ async def test_azure_ava_tts_with_custom_voice():Test that when using a custom Azure voice (en-US-AndrewNeural),the SSML request body contains the selected voice."""- from unittest.mock import AsyncMock, MagicMock, patch+ from unittest.mock import AsyncMock, patchimport httpx# Mock response@@ -497,7 +496,7 @@ async def test_azure_ava_tts_fable_voice_mapping():Test that when using OpenAI voice 'fable',it gets mapped to Azure voice 'en-GB-RyanNeural' in the SSML."""- from unittest.mock import AsyncMock, MagicMock, patch+ from unittest.mock import AsyncMock, patchimport httpx# Mock response@@ -544,7 +543,7 @@ async def test_aws_polly_tts_with_native_voice():Verifies the request is formatted correctly for the Polly API."""import json- from unittest.mock import MagicMock, patch+ from unittest.mock import patchimport httpx# Mock response - Polly returns audio bytes directly@@ -592,7 +591,7 @@ async def test_aws_polly_tts_with_openai_voice_mapping():Verifies that OpenAI voices are correctly mapped to Polly voices."""import json- from unittest.mock import MagicMock, patch+ from unittest.mock import patchimport httpxmock_response_content = b"fake_audio_data"@@ -634,7 +633,7 @@ async def test_aws_polly_tts_with_ssml():Verifies that SSML is detected and TextType is set correctly."""import json- from unittest.mock import MagicMock, patch+ from unittest.mock import patchimport httpxmock_response_content = b"fake_audio_data"diff --git a/tests/audio_tests/test_whisper.py b/tests/audio_tests/test_whisper.pyindex 76f7117d46c..333d806fe41 100644--- a/tests/audio_tests/test_whisper.py+++ b/tests/audio_tests/test_whisper.py@@ -44,7 +44,6 @@ load_dotenv()sys.path.insert(0, os.path.abspath("../")) # Adds the parent directory to the system path-import litellmfrom litellm import Router@@ -146,7 +145,6 @@ async def test_whisper_log_pre_call():from litellm.litellm_core_utils.litellm_logging import Loggingfrom datetime import datetimefrom unittest.mock import patch, MagicMock- from litellm.integrations.custom_logger import CustomLoggercustom_logger = CustomLogger()diff --git a/tests/enterprise/conftest.py b/tests/enterprise/conftest.pyindex 0365bbbcfa0..f23a5664f83 100644--- a/tests/enterprise/conftest.py+++ b/tests/enterprise/conftest.py@@ -35,7 +35,6 @@ def setup_and_teardown():0, os.path.abspath("../..")) # Adds the project directory to the system path- import litellmfrom litellm import Routerimportlib.reload(litellm)diff --git a/tests/enterprise/litellm_enterprise/integrations/test_prometheus.py b/tests/enterprise/litellm_enterprise/integrations/test_prometheus.pyindex bdf73b6ab03..6c4a008c823 100644--- a/tests/enterprise/litellm_enterprise/integrations/test_prometheus.py+++ b/tests/enterprise/litellm_enterprise/integrations/test_prometheus.py@@ -755,7 +755,6 @@ class MockHistogram:@pytest.fixturedef mock_prometheus_logger():"""Create a PrometheusLogger with mocked metrics to test increment logic"""- from unittest.mock import patchcollectors = list(REGISTRY._collector_to_names.keys())for collector in collectors:@@ -1186,7 +1185,7 @@ async def test_langfuse_callback_failure_metric(prometheus_logger):This test verifies that when Langfuse logging fails, thelitellm_callback_logging_failures_metric is incremented with callback_name="langfuse"."""- from unittest.mock import MagicMock, patch+ from unittest.mock import MagicMockfrom litellm.integrations.langfuse.langfuse_prompt_management import (LangfusePromptManagement,@@ -1242,7 +1241,7 @@ async def test_langfuse_otel_callback_failure_metric(prometheus_logger):This test verifies that when Langfuse OTEL logging fails, thelitellm_callback_logging_failures_metric is incremented with callback_name="langfuse_otel"."""- from unittest.mock import MagicMock, patch+ from unittest.mock import MagicMockfrom litellm.integrations.langfuse.langfuse_otel import LangfuseOtelLoggerdiff --git a/tests/enterprise/litellm_enterprise/integrations/test_prometheus_unit_tests.py b/tests/enterprise/litellm_enterprise/integrations/test_prometheus_unit_tests.pyindex 55c4cbae821..f5c39fb86ae 100644--- a/tests/enterprise/litellm_enterprise/integrations/test_prometheus_unit_tests.py+++ b/tests/enterprise/litellm_enterprise/integrations/test_prometheus_unit_tests.py@@ -19,7 +19,7 @@ import ossys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system-path-from unittest.mock import MagicMock, patch+from unittest.mock import MagicMockimport pytestdiff --git a/tests/guardrails_tests/test_custom_guardrail.py b/tests/guardrails_tests/test_custom_guardrail.pyindex af1270756f2..9d7efeecdca 100644--- a/tests/guardrails_tests/test_custom_guardrail.py+++ b/tests/guardrails_tests/test_custom_guardrail.py@@ -26,10 +26,8 @@ from litellm.integrations.custom_guardrail import CustomGuardrailfrom typing import Any, Dict, List, Literal, Optional, Union-import litellmfrom litellm._logging import verbose_proxy_loggerfrom litellm.caching.caching import DualCache-from litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.proxy._types import UserAPIKeyAuthfrom litellm.proxy.guardrails.guardrail_helpers import should_proceed_based_on_metadatafrom litellm.types.guardrails import GuardrailEventHooksdiff --git a/tests/litellm_utils_tests/conftest.py b/tests/litellm_utils_tests/conftest.pyindex 68c281a045f..39ea4299f35 100644--- a/tests/litellm_utils_tests/conftest.py+++ b/tests/litellm_utils_tests/conftest.py@@ -42,7 +42,6 @@ def setup_and_teardown():0, os.path.abspath("../..")) # Adds the project directory to the system path- import litellmimportlib.reload(litellm)diff --git a/tests/litellm_utils_tests/test_aws_secret_manager.py b/tests/litellm_utils_tests/test_aws_secret_manager.pyindex 46e8d004534..787e75eb17b 100644--- a/tests/litellm_utils_tests/test_aws_secret_manager.py+++ b/tests/litellm_utils_tests/test_aws_secret_manager.py@@ -13,8 +13,6 @@ import litellm.types.utilsload_dotenv()import io-import sys-import os# Ensure the project root is in the Python pathsys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../../..")))diff --git a/tests/litellm_utils_tests/test_hashicorp.py b/tests/litellm_utils_tests/test_hashicorp.pyindex fa39a045227..1d98debef2c 100644--- a/tests/litellm_utils_tests/test_hashicorp.py+++ b/tests/litellm_utils_tests/test_hashicorp.py@@ -4,7 +4,6 @@ import pytestfrom dotenv import load_dotenvload_dotenv()-import osimport httpxsys.path.insert(diff --git a/tests/litellm_utils_tests/test_health_check.py b/tests/litellm_utils_tests/test_health_check.pyindex 654fde90f26..9a17aaeea87 100644--- a/tests/litellm_utils_tests/test_health_check.py+++ b/tests/litellm_utils_tests/test_health_check.py@@ -785,19 +785,19 @@ async def test_image_generation_health_check_prompt(monkeypatch):# Default prompt is used when env var is unsetmonkeypatch.delenv("DEFAULT_HEALTH_CHECK_PROMPT", raising=False)- litellm_constants, health_check = reload_modules()- health_check_calls = await run_health_check(health_check)+ reloaded_constants, reloaded_health_check = reload_modules()+ health_check_calls = await run_health_check(reloaded_health_check)assert len(health_check_calls) == 1assert (- health_check_calls[0]["prompt"] == litellm_constants.DEFAULT_HEALTH_CHECK_PROMPT+ health_check_calls[0]["prompt"] == reloaded_constants.DEFAULT_HEALTH_CHECK_PROMPT)# Environment override should change the prompt without code changesoverride_prompt = "environment override prompt"monkeypatch.setenv("DEFAULT_HEALTH_CHECK_PROMPT", override_prompt)- litellm_constants, health_check = reload_modules()- health_check_calls = await run_health_check(health_check)+ _, reloaded_health_check = reload_modules()+ health_check_calls = await run_health_check(reloaded_health_check)assert len(health_check_calls) == 1assert health_check_calls[0]["prompt"] == override_promptdiff --git a/tests/litellm_utils_tests/test_logging_callback_manager.py b/tests/litellm_utils_tests/test_logging_callback_manager.pyindex d9bfca425e4..517ba6befd7 100644--- a/tests/litellm_utils_tests/test_logging_callback_manager.py+++ b/tests/litellm_utils_tests/test_logging_callback_manager.py@@ -243,7 +243,7 @@ async def test_slack_alerting_callback_registration(callback_manager):from litellm.caching.caching import DualCachefrom litellm.proxy.utils import ProxyLoggingfrom litellm.integrations.SlackAlerting.slack_alerting import SlackAlerting- from unittest.mock import AsyncMock, patch+ from unittest.mock import patch# Mock the async HTTP handlerwith patch(diff --git a/tests/litellm_utils_tests/test_proxy_budget_reset.py b/tests/litellm_utils_tests/test_proxy_budget_reset.pyindex a188fcf9d72..83891b55fb5 100644--- a/tests/litellm_utils_tests/test_proxy_budget_reset.py+++ b/tests/litellm_utils_tests/test_proxy_budget_reset.py@@ -8,7 +8,6 @@ import pytestfrom dotenv import load_dotenvload_dotenv()-import osfrom litellm.proxy._types import LiteLLM_BudgetTableFulldiff --git a/tests/litellm_utils_tests/test_secret_manager.py b/tests/litellm_utils_tests/test_secret_manager.pyindex 0f95fd75c53..012889ee00c 100644--- a/tests/litellm_utils_tests/test_secret_manager.py+++ b/tests/litellm_utils_tests/test_secret_manager.py@@ -9,7 +9,6 @@ from dotenv import load_dotenvimport jsonload_dotenv()-import osimport tempfilefrom uuid import uuid4diff --git a/tests/llm_responses_api_testing/base_responses_api.py b/tests/llm_responses_api_testing/base_responses_api.pyindex d5057944ba7..99ca9fb17b5 100644--- a/tests/llm_responses_api_testing/base_responses_api.py+++ b/tests/llm_responses_api_testing/base_responses_api.py@@ -16,7 +16,6 @@ import litellmfrom abc import ABC, abstractmethodfrom litellm.integrations.custom_logger import CustomLogger-import jsonfrom litellm.types.utils import StandardLoggingPayloadfrom litellm.types.llms.openai import (ResponseCompletedEvent,diff --git a/tests/llm_responses_api_testing/conftest.py b/tests/llm_responses_api_testing/conftest.pyindex 1928b540dad..b5884f51275 100644--- a/tests/llm_responses_api_testing/conftest.py+++ b/tests/llm_responses_api_testing/conftest.py@@ -81,7 +81,6 @@ def setup_and_teardown():0, os.path.abspath("../..")) # Adds the project directory to the system path- import litellmimportlib.reload(litellm)diff --git a/tests/llm_responses_api_testing/test_anthropic_responses_api.py b/tests/llm_responses_api_testing/test_anthropic_responses_api.pyindex 68ff22e8938..0ca159219df 100644--- a/tests/llm_responses_api_testing/test_anthropic_responses_api.py+++ b/tests/llm_responses_api_testing/test_anthropic_responses_api.py@@ -24,7 +24,6 @@ from litellm.types.llms.openai import (ResponseAPIUsage,IncompleteDetails,)-import litellmfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandlerfrom base_responses_api import BaseResponsesAPITestfrom openai.types.responses.function_tool import FunctionTooldiff --git a/tests/llm_responses_api_testing/test_azure_responses_api.py b/tests/llm_responses_api_testing/test_azure_responses_api.pyindex ccef8cbf1e7..79990a88496 100644--- a/tests/llm_responses_api_testing/test_azure_responses_api.py+++ b/tests/llm_responses_api_testing/test_azure_responses_api.py@@ -52,7 +52,7 @@ async def test_azure_responses_api_status_error():Test that 'status' field is not sent in the final request body to Azure API.The status field should be filtered out from input messages before making the API call."""- from unittest.mock import AsyncMock, MagicMock+ from unittest.mock import MagicMockimport jsonrequest_data = {@@ -193,7 +193,6 @@ async def test_azure_responses_api_headers_with_llm_provider_prefix():in response._hidden_params["headers"] instead of additional_headers, making themaccessible via completion.headers in the same way as the completion API."""- import jsonimport httpxmock_response_data = {diff --git a/tests/llm_responses_api_testing/test_openai_responses_api.py b/tests/llm_responses_api_testing/test_openai_responses_api.pyindex d19fa09451c..d614c40f5d0 100644--- a/tests/llm_responses_api_testing/test_openai_responses_api.py+++ b/tests/llm_responses_api_testing/test_openai_responses_api.py@@ -13,7 +13,6 @@ import jsonsys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.integrations.custom_logger import CustomLogger-import jsonfrom litellm.types.utils import StandardLoggingPayloadfrom litellm.types.llms.openai import (ResponseCompletedEvent,diff --git a/tests/llm_translation/test_anthropic_completion.py b/tests/llm_translation/test_anthropic_completion.pyindex 7a478e494b1..ab1c67dffbf 100644--- a/tests/llm_translation/test_anthropic_completion.py+++ b/tests/llm_translation/test_anthropic_completion.py@@ -14,7 +14,6 @@ from litellm.llms.anthropic.chat import ModelResponseIteratorload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")@@ -360,7 +359,6 @@ def test_process_anthropic_headers_with_no_matching_headers():)def test_anthropic_tool_use(tool_type, tool_config, message_content):"""Test Anthropic tool use with computer use and web fetch tools."""- from litellm import completionlitellm._turn_on_debug()@@ -951,7 +949,6 @@ def test_anthropic_citations_api():"""Test the citations API"""- from litellm import completiontry:resp = completion(@@ -997,7 +994,6 @@ def test_anthropic_citations_api():def test_anthropic_citations_api_streaming():- from litellm import completionresp = completion(model="claude-sonnet-4-5-20250929",@@ -1044,7 +1040,6 @@ def test_anthropic_citations_api_streaming():],)def test_anthropic_thinking_output(model):- from litellm import completionlitellm._turn_on_debug()@@ -1111,7 +1106,6 @@ def test_anthropic_thinking_output_stream(model):def test_anthropic_custom_headers():- from litellm import completionfrom litellm.llms.custom_httpx.http_handler import HTTPHandlerclient = HTTPHandler()@@ -1528,7 +1522,6 @@ def test_anthropic_tool_cache_control():def test_anthropic_streaming():- from litellm import completionrequest_data = {"messages": [diff --git a/tests/llm_translation/test_azure_ai.py b/tests/llm_translation/test_azure_ai.pyindex d2d893a611b..553f9102246 100644--- a/tests/llm_translation/test_azure_ai.py+++ b/tests/llm_translation/test_azure_ai.py@@ -19,7 +19,6 @@ from litellm.llms.custom_httpx.http_handler import HTTPHandlerload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/llm_translation/test_azure_openai.py b/tests/llm_translation/test_azure_openai.pyindex eb5ba44c410..0deb20900a7 100644--- a/tests/llm_translation/test_azure_openai.py+++ b/tests/llm_translation/test_azure_openai.py@@ -255,7 +255,6 @@ def test_get_azure_ad_token_from_username_password(def test_azure_openai_gpt_4o_naming(monkeypatch):- from openai import AzureOpenAIfrom pydantic import BaseModel, Fieldmonkeypatch.setenv("AZURE_API_VERSION", "2024-10-21")@@ -302,7 +301,6 @@ def test_azure_gpt_4o_with_tool_call_and_response_format(api_version):from pydantic import BaseModelimport litellm- from openai import AzureOpenAIclient = AzureOpenAI(api_key="fake-key",diff --git a/tests/llm_translation/test_bedrock_agents.py b/tests/llm_translation/test_bedrock_agents.pyindex 590e061c60d..6371224def9 100644--- a/tests/llm_translation/test_bedrock_agents.py+++ b/tests/llm_translation/test_bedrock_agents.py@@ -8,7 +8,6 @@ import litellm.typesload_dotenv()import io-import osimport jsonsys.path.insert(@@ -67,7 +66,7 @@ async def test_bedrock_agents_with_streaming():def test_bedrock_agents_with_custom_params():litellm._turn_on_debug()- from unittest.mock import MagicMock, patch+ from unittest.mock import MagicMockfrom litellm.llms.custom_httpx.http_handler import HTTPHandlerclient = HTTPHandler()diff --git a/tests/llm_translation/test_bedrock_completion.py b/tests/llm_translation/test_bedrock_completion.pyindex 9534bc8de3c..6ee6e5d1493 100644--- a/tests/llm_translation/test_bedrock_completion.py+++ b/tests/llm_translation/test_bedrock_completion.py@@ -13,7 +13,6 @@ import litellm.typesload_dotenv()import io-import osimport jsonsys.path.insert(diff --git a/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.py b/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.pyindex 19662ae8ba6..5d2fab15a8f 100644--- a/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.py+++ b/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.py@@ -15,13 +15,7 @@ from litellm.llms.custom_httpx.http_handler import HTTPHandlerfrom unittest.mock import Mockfrom litellm.llms.bedrock.base_aws_llm import BaseAWSLLM-import json-import pytest-from unittest.mock import patch, Mock-import litellm-from litellm.llms.custom_httpx.http_handler import HTTPHandler-from litellm.llms.bedrock.base_aws_llm import BaseAWSLLMdef test_bedrock_completion_with_region_name():diff --git a/tests/llm_translation/test_bedrock_govcloud.py b/tests/llm_translation/test_bedrock_govcloud.pyindex 1e8504648f8..e69a95c714d 100644--- a/tests/llm_translation/test_bedrock_govcloud.py+++ b/tests/llm_translation/test_bedrock_govcloud.py@@ -475,7 +475,6 @@ class TestBedrockGovCloudSupport:@patch("litellm.llms.custom_httpx.http_handler.HTTPHandler.post")def test_govcloud_completion_with_cost_tracking(self, mock_post):"""Test that completion requests with cost tracking use correct pricing for GovCloud models"""- from litellm import completionfrom unittest.mock import Mockimport jsondiff --git a/tests/llm_translation/test_cohere.py b/tests/llm_translation/test_cohere.pyindex 2d719cbde36..0eb0b1b33fe 100644--- a/tests/llm_translation/test_cohere.py+++ b/tests/llm_translation/test_cohere.py@@ -6,7 +6,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")@@ -18,7 +17,6 @@ import pytestimport litellmfrom litellm import RateLimitError, Timeout, completion, completion_cost, embeddingfrom unittest.mock import AsyncMock, patch-from litellm import RateLimitError, Timeout, completion, completion_cost, embeddingfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandlerlitellm.num_retries = 3diff --git a/tests/llm_translation/test_infinity.py b/tests/llm_translation/test_infinity.pyindex 25296290a12..5ca3d377fd7 100644--- a/tests/llm_translation/test_infinity.py+++ b/tests/llm_translation/test_infinity.py@@ -11,11 +11,9 @@ sys.path.insert(import litellm-import jsonimport osimport sys-from datetime import datetime-from unittest.mock import patch, MagicMock, AsyncMock+from unittest.mock import patch, MagicMockimport pytest@@ -23,7 +21,6 @@ sys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system-pathfrom test_rerank import assert_response_shape-import litellmfrom base_embedding_unit_tests import BaseLLMEmbeddingTestfrom litellm.llms.custom_httpx.http_handler import HTTPHandler, AsyncHTTPHandlerdiff --git a/tests/llm_translation/test_minimax_tts.py b/tests/llm_translation/test_minimax_tts.pyindex 2e3e97888e9..e10b32fb39b 100644--- a/tests/llm_translation/test_minimax_tts.py+++ b/tests/llm_translation/test_minimax_tts.py@@ -139,7 +139,6 @@ class TestMinimaxTextToSpeechConfig:# Mock both litellm.api_key and get_secret_str to return Noneimport litellm- from unittest.mock import patchoriginal_api_key = litellm.api_keytry:@@ -274,7 +273,6 @@ class TestMinimaxSpeechIntegration:def test_speech_mock_response(self):"""Test speech synthesis with mocked response"""- from unittest.mock import MagicMock, patch# Create mock audio data (hex-encoded as MiniMax returns)mock_audio_bytes = b"fake audio data for testing"diff --git a/tests/llm_translation/test_mistral_api.py b/tests/llm_translation/test_mistral_api.pyindex 8cf704fbe89..62f69e616ab 100644--- a/tests/llm_translation/test_mistral_api.py+++ b/tests/llm_translation/test_mistral_api.py@@ -11,7 +11,6 @@ from litellm.llms.anthropic.chat import ModelResponseIteratorload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/llm_translation/test_nvidia_nim.py b/tests/llm_translation/test_nvidia_nim.pyindex 80e764147bb..79c792d1644 100644--- a/tests/llm_translation/test_nvidia_nim.py+++ b/tests/llm_translation/test_nvidia_nim.py@@ -11,13 +11,12 @@ sys.path.insert(import httpximport pytest-from unittest.mock import patch, MagicMock, AsyncMock+from unittest.mock import patch, MagicMockimport litellmfrom litellm import Choices, Message, ModelResponse, EmbeddingResponse, Usagefrom litellm import completionfrom base_rerank_unit_tests import BaseLLMRerankTest-import litellmdef test_completion_nvidia_nim():diff --git a/tests/llm_translation/test_openai_o1.py b/tests/llm_translation/test_openai_o1.pyindex fccb1c6f1e3..dbaf20717a0 100644--- a/tests/llm_translation/test_openai_o1.py+++ b/tests/llm_translation/test_openai_o1.py@@ -134,7 +134,6 @@ def test_litellm_responses():"""ensures that type of completion_tokens_details is correctly handled / returned"""- from litellm import ModelResponsefrom litellm.types.utils import CompletionTokensDetailsresponse = ModelResponse(diff --git a/tests/llm_translation/test_rerank.py b/tests/llm_translation/test_rerank.pyindex d784677060a..cb254542009 100644--- a/tests/llm_translation/test_rerank.py+++ b/tests/llm_translation/test_rerank.py@@ -8,7 +8,6 @@ from dotenv import load_dotenvload_dotenv()import io-import osfrom typing import Optional, Dictsys.path.insert(diff --git a/tests/llm_translation/test_text_completion_unit_tests.py b/tests/llm_translation/test_text_completion_unit_tests.pyindex 04145cf6ce0..55026ba0542 100644--- a/tests/llm_translation/test_text_completion_unit_tests.py+++ b/tests/llm_translation/test_text_completion_unit_tests.py@@ -6,7 +6,7 @@ from unittest.mock import AsyncMockimport pytestimport httpxfrom respx import MockRouter-from unittest.mock import patch, MagicMock, AsyncMock+from unittest.mock import patch, MagicMocksys.path.insert(0, os.path.abspath("../..")diff --git a/tests/llm_translation/test_triton.py b/tests/llm_translation/test_triton.pyindex f4a26360a6c..f9ab3bfaff7 100644--- a/tests/llm_translation/test_triton.py+++ b/tests/llm_translation/test_triton.py@@ -15,9 +15,7 @@ sys.path.insert(import pytestimport litellm-import pytestfrom litellm.llms.triton.embedding.transformation import TritonEmbeddingConfig-import litellmfrom tests.fake_openai_endpoint import FAKE_OPENAI_API_BASEdiff --git a/tests/llm_translation/test_unit_test_bedrock_invoke.py b/tests/llm_translation/test_unit_test_bedrock_invoke.pyindex 39f02263f03..586b04384d5 100644--- a/tests/llm_translation/test_unit_test_bedrock_invoke.py+++ b/tests/llm_translation/test_unit_test_bedrock_invoke.py@@ -9,7 +9,6 @@ import jsonload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../.."))from unittest.mock import AsyncMock, Mock, patchdiff --git a/tests/load_tests/conftest.py b/tests/load_tests/conftest.pynew file mode 100644index 00000000000..48a98663e4e--- /dev/null+++ b/tests/load_tests/conftest.py@@ -0,0 +1,5 @@+from tests.load_tests.memory_leak_utils import ( # noqa: F401 # re-exported so pytest resolves these fixtures by name+ limit_memory,+ mock_server,+ test_router,+)diff --git a/tests/load_tests/test_linear_memory_growth.py b/tests/load_tests/test_linear_memory_growth.pyindex 46bab344f4e..f1c36924a2a 100644--- a/tests/load_tests/test_linear_memory_growth.py+++ b/tests/load_tests/test_linear_memory_growth.py@@ -21,12 +21,7 @@ pytest tests/load_tests/test_linear_memory_growth.py -vimport pytest-from tests.load_tests.memory_leak_utils import (- limit_memory, # noqa: F401 # pytest fixture used via dependency injection- mock_server, # noqa: F401 # pytest fixture used via dependency injection- run_memory_baseline_test,- test_router, # noqa: F401 # pytest fixture used via dependency injection-)+from tests.load_tests.memory_leak_utils import run_memory_baseline_test# Memory limit for all linear memory growth testsMEMORY_LIMIT = "40 MB"diff --git a/tests/load_tests/test_memory_usage.py b/tests/load_tests/test_memory_usage.pyindex f273865a29a..347dbf2bb44 100644--- a/tests/load_tests/test_memory_usage.py+++ b/tests/load_tests/test_memory_usage.py@@ -8,7 +8,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")@@ -21,13 +20,11 @@ from litellm.router import Routerfrom typing import Optionalfrom unittest.mock import MagicMock, patch-import asyncioimport pytestimport osimport litellmfrom typing import Callable, Any-import tracemallocimport gcfrom typing import Typefrom pydantic import BaseModeldiff --git a/tests/local_testing/cache_unit_tests.py b/tests/local_testing/cache_unit_tests.pyindex d29eed33687..27eefb79fae 100644--- a/tests/local_testing/cache_unit_tests.py+++ b/tests/local_testing/cache_unit_tests.py@@ -9,7 +9,6 @@ from litellm._uuid import uuidfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_acompletion_fallbacks.py b/tests/local_testing/test_acompletion_fallbacks.pyindex 00c2139f278..2d282f4f4f6 100644--- a/tests/local_testing/test_acompletion_fallbacks.py+++ b/tests/local_testing/test_acompletion_fallbacks.py@@ -12,7 +12,6 @@ sys.path.insert(import concurrentfrom dotenv import load_dotenv-import asyncioimport litellmdiff --git a/tests/local_testing/test_aim_guardrails.py b/tests/local_testing/test_aim_guardrails.pyindex 5e5fb0d5459..a6a4a0ad781 100644--- a/tests/local_testing/test_aim_guardrails.py+++ b/tests/local_testing/test_aim_guardrails.py@@ -463,7 +463,6 @@ async def test_post_call_stream__all_chunks_are_valid(monkeypatch, length: int):@pytest.mark.asyncioasync def test_post_call_stream__blocked_chunks(monkeypatch):- from litellm.proxy.proxy_server import StreamingCallbackErrorinit_guardrails_v2(all_guardrails=[diff --git a/tests/local_testing/test_amazing_vertex_completion.py b/tests/local_testing/test_amazing_vertex_completion.pyindex 9bd64719102..a52b5975f6e 100644--- a/tests/local_testing/test_amazing_vertex_completion.py+++ b/tests/local_testing/test_amazing_vertex_completion.py@@ -6,7 +6,6 @@ from dotenv import load_dotenvload_dotenv()import io-import osfrom test_streaming import streaming_format_testsdiff --git a/tests/local_testing/test_anthropic_prompt_caching.py b/tests/local_testing/test_anthropic_prompt_caching.pyindex ef374de5e2a..3105c0b9eeb 100644--- a/tests/local_testing/test_anthropic_prompt_caching.py+++ b/tests/local_testing/test_anthropic_prompt_caching.py@@ -7,7 +7,6 @@ from dotenv import load_dotenvload_dotenv()import io-import osfrom test_streaming import streaming_format_tests@@ -210,7 +209,6 @@ def anthropic_messages():@pytest.mark.asyncioasync def test_anthropic_vertex_ai_prompt_caching(anthropic_messages, sync_mode):litellm._turn_on_debug()- from litellm.llms.custom_httpx.http_handler import HTTPHandler, AsyncHTTPHandlerload_vertex_ai_credentials()diff --git a/tests/local_testing/test_auth_utils.py b/tests/local_testing/test_auth_utils.pyindex 88e8c02a606..e1444ed562e 100644--- a/tests/local_testing/test_auth_utils.py+++ b/tests/local_testing/test_auth_utils.py@@ -6,7 +6,6 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_azure_openai.py b/tests/local_testing/test_azure_openai.pyindex 1b99140b6e6..2a2b1e7fc35 100644--- a/tests/local_testing/test_azure_openai.py+++ b/tests/local_testing/test_azure_openai.py@@ -7,7 +7,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_basic_python_version.py b/tests/local_testing/test_basic_python_version.pyindex 1f260f86eeb..a710b5e0ff7 100644--- a/tests/local_testing/test_basic_python_version.py+++ b/tests/local_testing/test_basic_python_version.py@@ -215,9 +215,7 @@ def test_locked_aiohttp_version_is_not_pool_poisoning():import osimport subprocess-import time-import pytestimport requestsdiff --git a/tests/local_testing/test_blocked_user_list.py b/tests/local_testing/test_blocked_user_list.pyindex 44265afd890..9b29d3fcfa5 100644--- a/tests/local_testing/test_blocked_user_list.py+++ b/tests/local_testing/test_blocked_user_list.py@@ -14,12 +14,10 @@ from dotenv import load_dotenvfrom fastapi import Requestload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system path-import asyncioimport loggingimport pytest@@ -57,7 +55,6 @@ verbose_proxy_logger.setLevel(level=logging.DEBUG)from starlette.datastructures import URL-from litellm.caching.caching import DualCachefrom litellm.proxy._types import (BlockUsers,DynamoDBArgs,diff --git a/tests/local_testing/test_braintrust.py b/tests/local_testing/test_braintrust.pyindex c6e37af702a..18c210b6d33 100644--- a/tests/local_testing/test_braintrust.py+++ b/tests/local_testing/test_braintrust.py@@ -13,12 +13,10 @@ from dotenv import load_dotenvfrom fastapi import Requestload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system path-import asyncioimport loggingfrom unittest.mock import AsyncMock, MagicMock, patch@@ -29,7 +27,6 @@ from litellm.llms.custom_httpx.http_handler import HTTPHandlerdef test_braintrust_logging():- import litellmlitellm.set_verbose = True@@ -53,7 +50,6 @@ def test_braintrust_logging():def test_braintrust_logging_specific_project_id():- import litellmlitellm.set_verbose = Truediff --git a/tests/local_testing/test_caching.py b/tests/local_testing/test_caching.pyindex 0c7c0157651..90be551ff46 100644--- a/tests/local_testing/test_caching.py+++ b/tests/local_testing/test_caching.py@@ -7,7 +7,6 @@ from litellm._uuid import uuidfrom dotenv import load_dotenvload_dotenv()-import osimport jsonsys.path.insert(@@ -33,7 +32,6 @@ from datetime import timedeltamessages = [{"role": "user", "content": "who is ishaan Github? "}]# comment-import randomimport stringdiff --git a/tests/local_testing/test_caching_ssl.py b/tests/local_testing/test_caching_ssl.pyindex 21782963250..863f227aef1 100644--- a/tests/local_testing/test_caching_ssl.py+++ b/tests/local_testing/test_caching_ssl.py@@ -7,7 +7,6 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_completion.py b/tests/local_testing/test_completion.pyindex 5b0bff65959..c7cd5a1a2d4 100644--- a/tests/local_testing/test_completion.py+++ b/tests/local_testing/test_completion.py@@ -7,7 +7,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")@@ -1380,7 +1379,6 @@ def test_ollama_image():"""import base64- import iofrom PIL import Imagediff --git a/tests/local_testing/test_completion_with_retries.py b/tests/local_testing/test_completion_with_retries.pyindex 4edd51920f3..c9b519b2af8 100644--- a/tests/local_testing/test_completion_with_retries.py+++ b/tests/local_testing/test_completion_with_retries.py@@ -3,7 +3,6 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")@@ -207,7 +206,6 @@ async def test_responses_retry_on_auth_error(sync_mode):This validates that the @client decorator properly handles responses/aresponses retries."""from unittest.mock import patch- import openainum_retries = 2diff --git a/tests/local_testing/test_config.py b/tests/local_testing/test_config.pyindex 0c4c1a39b98..2a5dc3376ee 100644--- a/tests/local_testing/test_config.py+++ b/tests/local_testing/test_config.py@@ -10,7 +10,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_cost_calc.py b/tests/local_testing/test_cost_calc.pyindex 3623af59848..233b67a6072 100644--- a/tests/local_testing/test_cost_calc.py+++ b/tests/local_testing/test_cost_calc.py@@ -6,7 +6,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_dual_cache.py b/tests/local_testing/test_dual_cache.pyindex 5a1cdf86487..cdfa8146420 100644--- a/tests/local_testing/test_dual_cache.py+++ b/tests/local_testing/test_dual_cache.py@@ -7,7 +7,6 @@ from litellm._uuid import uuidfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_dynamic_rate_limit_handler.py b/tests/local_testing/test_dynamic_rate_limit_handler.pyindex fac7ce10397..373949a81ac 100644--- a/tests/local_testing/test_dynamic_rate_limit_handler.py+++ b/tests/local_testing/test_dynamic_rate_limit_handler.py@@ -13,7 +13,6 @@ from typing import Optional, Tuplefrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_embedding.py b/tests/local_testing/test_embedding.pyindex f4c61e99547..ee9d4cdd915 100644--- a/tests/local_testing/test_embedding.py+++ b/tests/local_testing/test_embedding.py@@ -314,7 +314,6 @@ def test_openai_azure_embedding():pytest.fail(f"Error occurred: {e}")-from openai.types.embedding import Embeddingdef _openai_mock_response(*args, **kwargs):@@ -570,7 +569,6 @@ def test_hf_embedding():# test_hf_embedding()-from unittest.mock import MagicMock, patchdef tgi_mock_post(*args, **kwargs):diff --git a/tests/local_testing/test_function_call_parsing.py b/tests/local_testing/test_function_call_parsing.pyindex f9582fcc574..57027c670bb 100644--- a/tests/local_testing/test_function_call_parsing.py+++ b/tests/local_testing/test_function_call_parsing.py@@ -8,7 +8,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_function_calling.py b/tests/local_testing/test_function_calling.pyindex d6adde84400..b5f72264549 100644--- a/tests/local_testing/test_function_calling.py+++ b/tests/local_testing/test_function_calling.py@@ -6,7 +6,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_function_setup.py b/tests/local_testing/test_function_setup.pyindex b5e716c7314..92f49589ca2 100644--- a/tests/local_testing/test_function_setup.py+++ b/tests/local_testing/test_function_setup.py@@ -5,7 +5,7 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import os, io+import iosys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_get_optional_params_embeddings.py b/tests/local_testing/test_get_optional_params_embeddings.pyindex 667207de789..ddf9e877477 100644--- a/tests/local_testing/test_get_optional_params_embeddings.py+++ b/tests/local_testing/test_get_optional_params_embeddings.py@@ -5,7 +5,7 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import os, io+import iosys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_helicone_integration.py b/tests/local_testing/test_helicone_integration.pyindex 4c62ee259a3..9bfa29551e3 100644--- a/tests/local_testing/test_helicone_integration.py+++ b/tests/local_testing/test_helicone_integration.py@@ -131,7 +131,6 @@ def test_helicone_removes_otel_span_from_metadata():to prevent JSON serialization errors."""from litellm.integrations.helicone import HeliconeLogger- from unittest.mock import MagicMock# Create a mock span object (similar to what OpenTelemetry would create)mock_span = MagicMock()diff --git a/tests/local_testing/test_least_busy_routing.py b/tests/local_testing/test_least_busy_routing.pyindex 0f4f6923a19..0a3b5490131 100644--- a/tests/local_testing/test_least_busy_routing.py+++ b/tests/local_testing/test_least_busy_routing.py@@ -11,7 +11,6 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_llm_guard.py b/tests/local_testing/test_llm_guard.pyindex 86fa80ee944..60fe9c0e020 100644--- a/tests/local_testing/test_llm_guard.py+++ b/tests/local_testing/test_llm_guard.py@@ -9,7 +9,6 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_lowest_cost_routing.py b/tests/local_testing/test_lowest_cost_routing.pyindex 4e8b06fb628..6ed1731572a 100644--- a/tests/local_testing/test_lowest_cost_routing.py+++ b/tests/local_testing/test_lowest_cost_routing.py@@ -7,7 +7,7 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import os, copy+import copysys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_lowest_latency_routing.py b/tests/local_testing/test_lowest_latency_routing.pyindex ac84b3ec5e9..0a202e0dfb9 100644--- a/tests/local_testing/test_lowest_latency_routing.py+++ b/tests/local_testing/test_lowest_latency_routing.py@@ -13,7 +13,6 @@ from dotenv import load_dotenvload_dotenv()import copy-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_ollama.py b/tests/local_testing/test_ollama.pyindex 3a997c3d4a8..7ca8e806529 100644--- a/tests/local_testing/test_ollama.py+++ b/tests/local_testing/test_ollama.py@@ -8,7 +8,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_openai_moderations_hook.py b/tests/local_testing/test_openai_moderations_hook.pyindex c4298035443..2e24740c929 100644--- a/tests/local_testing/test_openai_moderations_hook.py+++ b/tests/local_testing/test_openai_moderations_hook.py@@ -9,7 +9,6 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")@@ -42,8 +41,6 @@ async def test_openai_moderation_error_raising(monkeypatch):user_api_key_dict = UserAPIKeyAuth(api_key=_api_key)local_cache = DualCache()- from litellm.proxy.proxy_server import llm_router-llm_router = litellm.Router(model_list=[{diff --git a/tests/local_testing/test_prompt_injection_detection.py b/tests/local_testing/test_prompt_injection_detection.pyindex b1a9aff1584..9f5137630ea 100644--- a/tests/local_testing/test_prompt_injection_detection.py+++ b/tests/local_testing/test_prompt_injection_detection.py@@ -7,7 +7,6 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_pydantic.py b/tests/local_testing/test_pydantic.pyindex 8b410544067..436b9d3dd48 100644--- a/tests/local_testing/test_pydantic.py+++ b/tests/local_testing/test_pydantic.py@@ -6,7 +6,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_router_budget_limiter.py b/tests/local_testing/test_router_budget_limiter.pyindex 4ef99ec8c12..3bdb3116670 100644--- a/tests/local_testing/test_router_budget_limiter.py+++ b/tests/local_testing/test_router_budget_limiter.py@@ -4,7 +4,7 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import os, copy+import copysys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_router_cooldown_handlers.py b/tests/local_testing/test_router_cooldown_handlers.pyindex fdc89fc04ed..55510df5b9e 100644--- a/tests/local_testing/test_router_cooldown_handlers.py+++ b/tests/local_testing/test_router_cooldown_handlers.py@@ -536,7 +536,6 @@ async def test_high_traffic_cooldowns_all_healthy_deployments():all_deployment_ids = router.get_model_ids()- import randomfrom collections import defaultdict# Create a defaultdict to track successes and failures for each model ID@@ -629,7 +628,6 @@ async def test_high_traffic_cooldowns_one_bad_deployment():all_deployment_ids = router.get_model_ids()- import randomfrom collections import defaultdict# Create a defaultdict to track successes and failures for each model ID@@ -727,7 +725,6 @@ async def test_high_traffic_cooldowns_one_rate_limited_deployment():all_deployment_ids = router.get_model_ids()- import randomfrom collections import defaultdict# Create a defaultdict to track successes and failures for each model IDdiff --git a/tests/local_testing/test_router_debug_logs.py b/tests/local_testing/test_router_debug_logs.pyindex ad807539bf2..04e8dc6c77c 100644--- a/tests/local_testing/test_router_debug_logs.py+++ b/tests/local_testing/test_router_debug_logs.py@@ -10,7 +10,6 @@ sys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system path-import asyncioimport loggingimport litellmdiff --git a/tests/local_testing/test_router_timeout.py b/tests/local_testing/test_router_timeout.pyindex cdd9ae5c538..9971e540024 100644--- a/tests/local_testing/test_router_timeout.py+++ b/tests/local_testing/test_router_timeout.py@@ -150,7 +150,6 @@ def test_router_timeout_with_retries_anthropic_model(num_retries, expected_call_If request hits custom timeout, ensure it's retried."""from litellm.llms.custom_httpx.http_handler import HTTPHandler- import timelitellm.num_retries = num_retrieslitellm.request_timeout = 0.000001diff --git a/tests/local_testing/test_sagemaker.py b/tests/local_testing/test_sagemaker.pyindex d4c5a5a857f..bf17d9dce21 100644--- a/tests/local_testing/test_sagemaker.py+++ b/tests/local_testing/test_sagemaker.py@@ -7,7 +7,6 @@ from dotenv import load_dotenvload_dotenv()import io-import osimport litellmfrom test_streaming import streaming_format_tests@@ -20,7 +19,6 @@ from unittest.mock import AsyncMock, MagicMock, patchimport pytest-import litellmfrom litellm import RateLimitError, Timeout, completion, completion_cost, embeddingfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerfrom litellm.litellm_core_utils.prompt_templates.factory import anthropic_messages_ptdiff --git a/tests/local_testing/test_secret_detect_hook.py b/tests/local_testing/test_secret_detect_hook.pyindex ad2e248da1b..8a93b72dce2 100644--- a/tests/local_testing/test_secret_detect_hook.py+++ b/tests/local_testing/test_secret_detect_hook.py@@ -15,7 +15,6 @@ from datetime import datetimefrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")@@ -34,7 +33,6 @@ from litellm_enterprise.enterprise_callbacks.secret_detection import ()from litellm.proxy.proxy_server import chat_completionfrom litellm.proxy.utils import ProxyLogging, hash_token-from litellm.router import Routerfrom tests.fake_openai_endpoint import FAKE_OPENAI_API_BASEdiff --git a/tests/local_testing/test_stream_chunk_builder.py b/tests/local_testing/test_stream_chunk_builder.pyindex 664fd936205..9dab6e60c35 100644--- a/tests/local_testing/test_stream_chunk_builder.py+++ b/tests/local_testing/test_stream_chunk_builder.py@@ -9,11 +9,11 @@ from typing import Listfrom litellm.types.utils import StreamingChoices, ChatCompletionAudioResponse-def check_non_streaming_response(completion):- assert completion.choices[0].message.audio is not None, "Audio response is missing"- print("audio", completion.choices[0].message.audio)+def check_non_streaming_response(response):+ assert response.choices[0].message.audio is not None, "Audio response is missing"+ print("audio", response.choices[0].message.audio)assert isinstance(- completion.choices[0].message.audio, ChatCompletionAudioResponse+ response.choices[0].message.audio, ChatCompletionAudioResponse), "Invalid audio response type"assert len(completion.choices[0].message.audio.data) > 0, "Audio data is empty"@@ -594,7 +594,6 @@ def test_stream_chunk_builder_multiple_tool_calls():def test_stream_chunk_builder_openai_prompt_caching():- from openai import OpenAIfrom pydantic import BaseModelclient = OpenAI(@@ -639,7 +638,6 @@ def test_stream_chunk_builder_openai_prompt_caching():@pytest.mark.flaky(retries=5, delay=2)def test_stream_chunk_builder_openai_audio_output_usage():from pydantic import BaseModel- from openai import OpenAIfrom typing import Optionalclient = OpenAI(@@ -720,7 +718,6 @@ def test_stream_chunk_builder_tool_calls_list():Function,ModelResponseStream,Delta,- StreamingChoices,ChatCompletionDeltaToolCall,)diff --git a/tests/local_testing/test_streaming.py b/tests/local_testing/test_streaming.pyindex 1fe9a1ab297..ba1f4e7d51c 100644--- a/tests/local_testing/test_streaming.py+++ b/tests/local_testing/test_streaming.py@@ -951,7 +951,6 @@ def test_vertex_ai_stream(provider):load_vertex_ai_credentials()litellm.set_verbose = True- import randomtest_models = ["gemini-2.5-flash-lite"]for model in test_models:@@ -2352,7 +2351,6 @@ def test_success_callback_streaming():from typing import List, Optional#### STREAMING + FUNCTION CALLING ###-from pydantic import BaseModelclass Function(BaseModel):@@ -2569,7 +2567,6 @@ def test_azure_streaming_and_function_calling():@pytest.mark.asyncioasync def test_azure_astreaming_and_function_calling():- from litellm._uuid import uuidtools = [{diff --git a/tests/local_testing/test_text_completion.py b/tests/local_testing/test_text_completion.pyindex 63cee71f999..227d8e5096a 100644--- a/tests/local_testing/test_text_completion.py+++ b/tests/local_testing/test_text_completion.py@@ -8,7 +8,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/local_testing/test_tpm_rpm_routing_v2.py b/tests/local_testing/test_tpm_rpm_routing_v2.pyindex 211af566424..c6917775d4b 100644--- a/tests/local_testing/test_tpm_rpm_routing_v2.py+++ b/tests/local_testing/test_tpm_rpm_routing_v2.py@@ -12,7 +12,6 @@ from typing import Dictfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")@@ -399,9 +398,7 @@ async def test_multiple_potential_deployments(sync_mode):def test_single_deployment_tpm_zero():import os- from datetime import datetime- import litellmmodel_list = [{diff --git a/tests/local_testing/test_update_spend.py b/tests/local_testing/test_update_spend.pyindex 2e13c3f82cf..7894f330796 100644--- a/tests/local_testing/test_update_spend.py+++ b/tests/local_testing/test_update_spend.py@@ -14,12 +14,10 @@ from dotenv import load_dotenvfrom fastapi import Requestload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system path-import asyncioimport loggingimport pytest@@ -54,7 +52,6 @@ verbose_proxy_logger.setLevel(level=logging.DEBUG)from starlette.datastructures import URL-from litellm.caching.caching import DualCachefrom litellm.proxy._types import (BlockUsers,DynamoDBArgs,diff --git a/tests/logging_callback_tests/test_alerting.py b/tests/logging_callback_tests/test_alerting.pyindex 7cf88d49e22..83513107ad3 100644--- a/tests/logging_callback_tests/test_alerting.py+++ b/tests/logging_callback_tests/test_alerting.py@@ -19,7 +19,6 @@ from litellm.types.integrations.slack_alerting import AlertType# import logging# logging.basicConfig(level=logging.DEBUG)sys.path.insert(0, os.path.abspath("../.."))-import asyncioimport osimport unittest.mockfrom unittest.mock import AsyncMock, MagicMock, patch@@ -132,8 +131,6 @@ def test_init():print("passed testing slack alerting init")-from datetime import datetime, timedelta-from unittest.mock import AsyncMock, patch@pytest.fixture@@ -342,7 +339,6 @@ async def test_daily_reports_redis_cache_scheduler():# we need this to be 0 so it actualy sends the reportslack_alerting.alerting_args.daily_report_frequency = 0- from litellm.router import AlertingConfigrouter = litellm.Router(model_list=[@@ -382,7 +378,6 @@ async def test_daily_reports_redis_cache_scheduler():@pytest.mark.asyncio@pytest.mark.skip(reason="Local test. Test if slack alerts are sent.")async def test_send_llm_exception_to_slack():- from litellm.router import AlertingConfig# on async successrouter = litellm.Router(diff --git a/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py b/tests/logging_callback_tests/test_built_in_tools_cost_tracking.pyindex 0e73ad834da..942c26438c8 100644--- a/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py+++ b/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py@@ -9,7 +9,6 @@ from fastapi.routing import APIRouteload_dotenv()import io-import osimport timeimport json@@ -102,7 +101,6 @@ async def test_openai_web_search_logging_cost_tracking():"""Test web search cost tracking with different search context sizes"""test_custom_logger = await _setup_web_search_test()- from litellm._uuid import uuidrequest_kwargs = {"model": "openai/gpt-5-search-api",diff --git a/tests/logging_callback_tests/test_gcs_pub_sub.py b/tests/logging_callback_tests/test_gcs_pub_sub.pyindex 3c242a5fe1d..2f6cdb63192 100644--- a/tests/logging_callback_tests/test_gcs_pub_sub.py+++ b/tests/logging_callback_tests/test_gcs_pub_sub.py@@ -15,7 +15,6 @@ from unittest.mock import AsyncMock, patchimport pytest-import litellmfrom litellm import completionfrom litellm._logging import verbose_loggerfrom litellm.integrations.gcs_pubsub.pub_sub import *diff --git a/tests/logging_callback_tests/test_generic_api_callback.py b/tests/logging_callback_tests/test_generic_api_callback.pyindex fbe74d017a6..9ad17b3d6e2 100644--- a/tests/logging_callback_tests/test_generic_api_callback.py+++ b/tests/logging_callback_tests/test_generic_api_callback.py@@ -16,7 +16,6 @@ from unittest.mock import AsyncMock, patchimport pytest-import litellmfrom litellm import completionfrom litellm._logging import verbose_loggerfrom litellm.integrations.gcs_pubsub.pub_sub import *diff --git a/tests/logging_callback_tests/test_moderations_api_logging.py b/tests/logging_callback_tests/test_moderations_api_logging.pyindex 0ae3580917d..9190f2aebe5 100644--- a/tests/logging_callback_tests/test_moderations_api_logging.py+++ b/tests/logging_callback_tests/test_moderations_api_logging.py@@ -9,7 +9,6 @@ from fastapi.routing import APIRouteload_dotenv()import io-import osimport timeimport jsondiff --git a/tests/logging_callback_tests/test_opentelemetry_unit_tests.py b/tests/logging_callback_tests/test_opentelemetry_unit_tests.pyindex e8ca84a78ad..767f840a003 100644--- a/tests/logging_callback_tests/test_opentelemetry_unit_tests.py+++ b/tests/logging_callback_tests/test_opentelemetry_unit_tests.py@@ -9,8 +9,6 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import os-import asynciosys.path.insert(0, os.path.abspath("../..")diff --git a/tests/logging_callback_tests/test_spend_logs.py b/tests/logging_callback_tests/test_spend_logs.pyindex f9c4db7c6d5..709aa81f421 100644--- a/tests/logging_callback_tests/test_spend_logs.py+++ b/tests/logging_callback_tests/test_spend_logs.py@@ -9,7 +9,6 @@ from fastapi.routing import APIRouteload_dotenv()import io-import osimport time# this file is to test litellm/proxydiff --git a/tests/logging_callback_tests/test_token_counting.py b/tests/logging_callback_tests/test_token_counting.pyindex 69200f113db..e2160076b00 100644--- a/tests/logging_callback_tests/test_token_counting.py+++ b/tests/logging_callback_tests/test_token_counting.py@@ -9,7 +9,6 @@ from fastapi.routing import APIRouteload_dotenv()import io-import osimport timeimport jsondiff --git a/tests/logging_callback_tests/test_unit_test_litellm_logging.py b/tests/logging_callback_tests/test_unit_test_litellm_logging.pyindex e01c09951d6..f82813b7475 100644--- a/tests/logging_callback_tests/test_unit_test_litellm_logging.py+++ b/tests/logging_callback_tests/test_unit_test_litellm_logging.py@@ -19,8 +19,6 @@ from litellm._service_logger import ServiceLoggingimport asyncio-from litellm.litellm_core_utils.litellm_logging import Logging-import litellmservice_logger = ServiceLogging()diff --git a/tests/logging_callback_tests/test_view_request_resp_logs.py b/tests/logging_callback_tests/test_view_request_resp_logs.pyindex ea778a44e67..37b65855774 100644--- a/tests/logging_callback_tests/test_view_request_resp_logs.py+++ b/tests/logging_callback_tests/test_view_request_resp_logs.py@@ -10,9 +10,7 @@ import loggingimport tempfilefrom litellm._uuid import uuid-import jsonfrom datetime import datetime, timedelta, timezone-from datetime import datetimeimport pytestdiff --git a/tests/mcp_tests/conftest.py b/tests/mcp_tests/conftest.pyindex 01d5f69974e..a3b425f72c3 100644--- a/tests/mcp_tests/conftest.py+++ b/tests/mcp_tests/conftest.py@@ -33,7 +33,6 @@ def setup_and_teardown():0, os.path.abspath("../..")) # Adds the project directory to the system path- import litellmfrom litellm import Routerimportlib.reload(litellm)diff --git a/tests/mcp_tests/test_mcp_litellm_client.py b/tests/mcp_tests/test_mcp_litellm_client.pyindex 01b0c217573..e197673ab10 100644--- a/tests/mcp_tests/test_mcp_litellm_client.py+++ b/tests/mcp_tests/test_mcp_litellm_client.py@@ -13,7 +13,6 @@ from mcp.client.stdio import stdio_clientimport osfrom litellm import experimental_mcp_clientimport litellm-import pytestimport jsondiff --git a/tests/openai_endpoints_tests/test_openai_batches_endpoint.py b/tests/openai_endpoints_tests/test_openai_batches_endpoint.pyindex db8f75cf640..b6209853d82 100644--- a/tests/openai_endpoints_tests/test_openai_batches_endpoint.py+++ b/tests/openai_endpoints_tests/test_openai_batches_endpoint.py@@ -15,7 +15,6 @@ from unittest.mock import patch, MagicMock, AsyncMockBASE_URL = "http://localhost:4000" # Replace with your actual base URLAPI_KEY = "sk-1234" # Replace with your actual API key-from openai import OpenAIclient = OpenAI(base_url=BASE_URL, api_key=API_KEY)diff --git a/tests/pass_through_unit_tests/test_assemblyai_unit_tests_passthrough.py b/tests/pass_through_unit_tests/test_assemblyai_unit_tests_passthrough.pyindex 67bc4423d8c..6fdd4cc0f24 100644--- a/tests/pass_through_unit_tests/test_assemblyai_unit_tests_passthrough.py+++ b/tests/pass_through_unit_tests/test_assemblyai_unit_tests_passthrough.py@@ -15,20 +15,13 @@ import litellmfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj-import jsonimport osimport sys-from datetime import datetime-from unittest.mock import AsyncMock, Mock, patchsys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system-path-import httpx-import pytest-import litellm-from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjfrom litellm.proxy.pass_through_endpoints.llm_provider_handlers.assembly_passthrough_logging_handler import (AssemblyAIPassthroughLoggingHandler,AssemblyAITranscriptResponse,diff --git a/tests/pass_through_unit_tests/test_unit_test_passthrough_router.py b/tests/pass_through_unit_tests/test_unit_test_passthrough_router.pyindex b133cc2d862..ee1f8772568 100644--- a/tests/pass_through_unit_tests/test_unit_test_passthrough_router.py+++ b/tests/pass_through_unit_tests/test_unit_test_passthrough_router.py@@ -7,7 +7,6 @@ from unittest.mock import AsyncMock, Mock, patch, MagicMocksys.path.insert(0, os.path.abspath("../..")) #import unittest-from unittest.mock import patchfrom litellm.proxy.pass_through_endpoints.passthrough_endpoint_router import (PassthroughEndpointRouter,)diff --git a/tests/pass_through_unit_tests/test_vertex_ai_live_passthrough.py b/tests/pass_through_unit_tests/test_vertex_ai_live_passthrough.pyindex 9e9dd3cbe05..f25d9e7c1d3 100644--- a/tests/pass_through_unit_tests/test_vertex_ai_live_passthrough.py+++ b/tests/pass_through_unit_tests/test_vertex_ai_live_passthrough.py@@ -440,9 +440,6 @@ class TestVertexAILivePassthroughIntegration:def test_vertex_ai_live_route_detection(self):"""Test that the route detection works correctly"""- from litellm.proxy.pass_through_endpoints.success_handler import (- PassThroughEndpointLogging,- )handler = PassThroughEndpointLogging()@@ -464,9 +461,6 @@ class TestVertexAILivePassthroughIntegration:self, mock_handler_class, mock_logging_obj):"""Test the success handler integration with Vertex AI Live"""- from litellm.proxy.pass_through_endpoints.success_handler import (- PassThroughEndpointLogging,- )# Mock the handlermock_handler = MagicMock()diff --git a/tests/proxy_admin_ui_tests/conftest.py b/tests/proxy_admin_ui_tests/conftest.pyindex eca0bc431a5..67365f4745d 100644--- a/tests/proxy_admin_ui_tests/conftest.py+++ b/tests/proxy_admin_ui_tests/conftest.py@@ -22,7 +22,6 @@ def setup_and_teardown():0, os.path.abspath("../..")) # Adds the project directory to the system path- import litellmfrom litellm import Routerimportlib.reload(litellm)diff --git a/tests/proxy_admin_ui_tests/test_key_management.py b/tests/proxy_admin_ui_tests/test_key_management.pyindex 7e8494b77fc..dec7404b3cf 100644--- a/tests/proxy_admin_ui_tests/test_key_management.py+++ b/tests/proxy_admin_ui_tests/test_key_management.py@@ -12,7 +12,6 @@ from unittest.mock import MagicMock, patchload_dotenv()import io-import osimport time# this file is to test litellm/proxy@@ -893,9 +892,6 @@ async def test_key_update_with_model_specific_params(prisma_client):setattr(litellm.proxy.proxy_server, "master_key", "sk-1234")await litellm.proxy.proxy_server.prisma_client.connect()- from litellm.proxy.management_endpoints.key_management_endpoints import (- update_key_fn,- )from litellm.proxy._types import UpdateKeyRequestnew_key = await generate_key_fn(diff --git a/tests/proxy_admin_ui_tests/test_role_based_access.py b/tests/proxy_admin_ui_tests/test_role_based_access.pyindex f9506fb694b..587a1048595 100644--- a/tests/proxy_admin_ui_tests/test_role_based_access.py+++ b/tests/proxy_admin_ui_tests/test_role_based_access.py@@ -14,7 +14,6 @@ from fastapi.routing import APIRouteload_dotenv()import io-import osimport time# this file is to test litellm/proxy@@ -77,7 +76,6 @@ from litellm.proxy.utils import PrismaClient, ProxyLogging, hash_token, update_sverbose_proxy_logger.setLevel(level=logging.DEBUG)-from starlette.datastructures import URLfrom litellm.caching.caching import DualCachefrom litellm.proxy._types import *diff --git a/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py b/tests/proxy_admin_ui_tests/test_route_check_unit_tests.pyindex f0cc6985e66..6396a92cf80 100644--- a/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py+++ b/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py@@ -11,7 +11,6 @@ from fastapi.routing import APIRouteload_dotenv()import io-import osimport time@@ -23,7 +22,7 @@ sys.path.insert(import asyncioimport logging-from fastapi import HTTPException, Request+from fastapi import HTTPExceptionimport pytestfrom litellm.proxy.auth.route_checks import RouteChecksfrom litellm.proxy._types import LiteLLM_UserTable, LitellmUserRoles, UserAPIKeyAuthdiff --git a/tests/proxy_admin_ui_tests/test_usage_endpoints.py b/tests/proxy_admin_ui_tests/test_usage_endpoints.pyindex 54ad136f082..0d1fa3afa0c 100644--- a/tests/proxy_admin_ui_tests/test_usage_endpoints.py+++ b/tests/proxy_admin_ui_tests/test_usage_endpoints.py@@ -25,7 +25,6 @@ from fastapi.routing import APIRouteload_dotenv()import io-import osimport time# this file is to test litellm/proxydiff --git a/tests/proxy_unit_tests/test_aproxy_startup.py b/tests/proxy_unit_tests/test_aproxy_startup.pyindex 4dbf5b462a9..324a881a7c3 100644--- a/tests/proxy_unit_tests/test_aproxy_startup.py+++ b/tests/proxy_unit_tests/test_aproxy_startup.py@@ -5,7 +5,7 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import os, io+import io# this file is to test litellm/proxydiff --git a/tests/proxy_unit_tests/test_audit_logs_proxy.py b/tests/proxy_unit_tests/test_audit_logs_proxy.pyindex 9e2b69176ec..a5332213886 100644--- a/tests/proxy_unit_tests/test_audit_logs_proxy.py+++ b/tests/proxy_unit_tests/test_audit_logs_proxy.py@@ -10,7 +10,6 @@ from fastapi.routing import APIRouteimport io-import osimport time# this file is to test litellm/proxy@@ -24,7 +23,6 @@ import loggingload_dotenv()import pytest-from litellm._uuid import uuidimport litellmfrom litellm._logging import verbose_proxy_loggerdiff --git a/tests/proxy_unit_tests/test_auth_checks.py b/tests/proxy_unit_tests/test_auth_checks.pyindex ef3cbd0ae95..947117bd882 100644--- a/tests/proxy_unit_tests/test_auth_checks.py+++ b/tests/proxy_unit_tests/test_auth_checks.py@@ -6,7 +6,6 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")@@ -478,7 +477,6 @@ async def test_virtual_key_max_budget_check(2. Raises BudgetExceededError when spend >= max_budget"""from litellm.proxy.auth.auth_checks import _virtual_key_max_budget_check- from litellm.proxy.utils import ProxyLogging# Setup test datavalid_token = UserAPIKeyAuth(@@ -836,7 +834,6 @@ async def test_can_user_call_model_with_no_default_models():@pytest.mark.asyncioasync def test_get_fuzzy_user_object():from litellm.proxy.auth.auth_checks import _get_fuzzy_user_object- from litellm.proxy.utils import PrismaClientfrom unittest.mock import AsyncMock, MagicMock# Setup mock Prisma clientdiff --git a/tests/proxy_unit_tests/test_banned_keyword_list.py b/tests/proxy_unit_tests/test_banned_keyword_list.pyindex 90066b74f61..acf4bdbb8e0 100644--- a/tests/proxy_unit_tests/test_banned_keyword_list.py+++ b/tests/proxy_unit_tests/test_banned_keyword_list.py@@ -8,7 +8,6 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py b/tests/proxy_unit_tests/test_e2e_pod_lock_manager.pyindex fd21fbb6742..b1e5fd29cde 100644--- a/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py+++ b/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py@@ -14,7 +14,6 @@ from unittest.mock import MagicMock, patchload_dotenv()import io-import osimport timeimport fakeredisdiff --git a/tests/proxy_unit_tests/test_jwt.py b/tests/proxy_unit_tests/test_jwt.pyindex 686d7021257..abd91113f96 100644--- a/tests/proxy_unit_tests/test_jwt.py+++ b/tests/proxy_unit_tests/test_jwt.py@@ -14,7 +14,6 @@ from litellm._uuid import uuidfrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/proxy_unit_tests/test_key_generate_prisma.py b/tests/proxy_unit_tests/test_key_generate_prisma.pyindex 6a568d94f8c..c845fb35774 100644--- a/tests/proxy_unit_tests/test_key_generate_prisma.py+++ b/tests/proxy_unit_tests/test_key_generate_prisma.py@@ -33,7 +33,6 @@ import httpxload_dotenv()import io-import osimport time# this file is to test litellm/proxydiff --git a/tests/proxy_unit_tests/test_proxy_config_unit_test.py b/tests/proxy_unit_tests/test_proxy_config_unit_test.pyindex 99b0dc4fd13..a567ad2b025 100644--- a/tests/proxy_unit_tests/test_proxy_config_unit_test.py+++ b/tests/proxy_unit_tests/test_proxy_config_unit_test.py@@ -11,7 +11,6 @@ import litellm.proxy.proxy_serverload_dotenv()import io-import os# this file is to test litellm/proxydiff --git a/tests/proxy_unit_tests/test_proxy_custom_auth.py b/tests/proxy_unit_tests/test_proxy_custom_auth.pyindex cffcc2e7f2c..c5b6c1e6209 100644--- a/tests/proxy_unit_tests/test_proxy_custom_auth.py+++ b/tests/proxy_unit_tests/test_proxy_custom_auth.py@@ -6,7 +6,6 @@ from dotenv import load_dotenvload_dotenv()import io-import os# this file is to test litellm/proxydiff --git a/tests/proxy_unit_tests/test_proxy_custom_logger.py b/tests/proxy_unit_tests/test_proxy_custom_logger.pyindex cfcbf61433e..20b9678c7fa 100644--- a/tests/proxy_unit_tests/test_proxy_custom_logger.py+++ b/tests/proxy_unit_tests/test_proxy_custom_logger.py@@ -3,7 +3,7 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import os, io, asyncio+import io, asyncio# this file is to test litellm/proxydiff --git a/tests/proxy_unit_tests/test_proxy_encrypt_decrypt.py b/tests/proxy_unit_tests/test_proxy_encrypt_decrypt.pyindex ab84d21479f..396a34e9b85 100644--- a/tests/proxy_unit_tests/test_proxy_encrypt_decrypt.py+++ b/tests/proxy_unit_tests/test_proxy_encrypt_decrypt.py@@ -6,7 +6,6 @@ from dotenv import load_dotenvload_dotenv()import io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/proxy_unit_tests/test_proxy_exception_mapping.py b/tests/proxy_unit_tests/test_proxy_exception_mapping.pyindex 2487c69d9d3..e9884f8b269 100644--- a/tests/proxy_unit_tests/test_proxy_exception_mapping.py+++ b/tests/proxy_unit_tests/test_proxy_exception_mapping.py@@ -10,7 +10,6 @@ from dotenv import load_dotenvload_dotenv()import asyncioimport io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/proxy_unit_tests/test_proxy_pass_user_config.py b/tests/proxy_unit_tests/test_proxy_pass_user_config.pyindex 6beb86eca72..73998253f32 100644--- a/tests/proxy_unit_tests/test_proxy_pass_user_config.py+++ b/tests/proxy_unit_tests/test_proxy_pass_user_config.py@@ -3,7 +3,7 @@ import tracebackfrom dotenv import load_dotenvload_dotenv()-import os, io+import io# this file is to test litellm/proxydiff --git a/tests/proxy_unit_tests/test_proxy_reject_logging.py b/tests/proxy_unit_tests/test_proxy_reject_logging.pyindex e0b575f4a71..440f2362276 100644--- a/tests/proxy_unit_tests/test_proxy_reject_logging.py+++ b/tests/proxy_unit_tests/test_proxy_reject_logging.py@@ -18,7 +18,6 @@ from datetime import datetimefrom dotenv import load_dotenvload_dotenv()-import ossys.path.insert(0, os.path.abspath("../..")@@ -45,7 +44,6 @@ from litellm.proxy.proxy_server import (embeddings,)from litellm.proxy.utils import ProxyLogging, hash_token-from litellm.router import Routerclass testLogger(CustomLogger):diff --git a/tests/proxy_unit_tests/test_proxy_routes.py b/tests/proxy_unit_tests/test_proxy_routes.pyindex db41bd65409..9d9c02257c2 100644--- a/tests/proxy_unit_tests/test_proxy_routes.py+++ b/tests/proxy_unit_tests/test_proxy_routes.py@@ -5,7 +5,6 @@ from dotenv import load_dotenvload_dotenv()import io-import os# this file is to test litellm/proxydiff --git a/tests/proxy_unit_tests/test_proxy_server.py b/tests/proxy_unit_tests/test_proxy_server.pyindex 04bc80bf0d6..e8f0e6953bc 100644--- a/tests/proxy_unit_tests/test_proxy_server.py+++ b/tests/proxy_unit_tests/test_proxy_server.py@@ -11,7 +11,6 @@ import litellm.proxy.proxy_serverload_dotenv()import ioimport json-import os# this file is to test litellm/proxy@@ -872,7 +871,6 @@ def test_health(client_no_auth):# test_add_new_model()-from litellm.integrations.custom_logger import CustomLoggerclass MyCustomHandler(CustomLogger):@@ -1110,7 +1108,7 @@ async def test_get_team_redis(client_no_auth):import randomfrom litellm._uuid import uuid-from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch+from unittest.mock import PropertyMockfrom litellm.proxy._types import (LitellmUserRoles,@@ -1138,7 +1136,7 @@ def mock_prisma_client():)@pytest.mark.asyncio@pytest.mark.skip(reason="Requires reliable external DB connection (prisma).")-async def test_create_user_default_budget(prisma_client, user_role):+async def test_create_user_default_budget(prisma_client, user_role): # noqa: F811 # pytest fixture, not a redefinitionsetattr(litellm.proxy.proxy_server, "prisma_client", prisma_client)setattr(litellm.proxy.proxy_server, "master_key", "sk-1234")@@ -1179,7 +1177,7 @@ async def test_create_user_default_budget(prisma_client, user_role):@pytest.mark.parametrize("new_member_method", ["user_id", "user_email"])@pytest.mark.asyncio@pytest.mark.skip(reason="Requires reliable external DB connection (prisma).")-async def test_create_team_member_add(prisma_client, new_member_method):+async def test_create_team_member_add(prisma_client, new_member_method): # noqa: F811 # pytest fixture, not a redefinitionimport timefrom fastapi import Request@@ -1291,7 +1289,7 @@ async def test_create_team_member_add(prisma_client, new_member_method):@pytest.mark.parametrize("team_route", ["/team/member_add", "/team/member_delete"])@pytest.mark.asyncioasync def test_create_team_member_add_team_admin_user_api_key_auth(- prisma_client, team_member_role, team_route+ prisma_client, team_member_role, team_route # noqa: F811 # pytest fixture, not a redefinition):import time@@ -1353,7 +1351,7 @@ async def test_create_team_member_add_team_admin_user_api_key_auth(@pytest.mark.parametrize("user_role", ["admin", "user"])@pytest.mark.asyncioasync def test_create_team_member_add_team_admin(- prisma_client, new_member_method, user_role+ prisma_client, new_member_method, user_role # noqa: F811 # pytest fixture, not a redefinition):"""Relevant issue - https://github.com/BerriAI/litellm/issues/5300@@ -1495,7 +1493,7 @@ async def test_create_team_member_add_team_admin(@pytest.mark.asyncio@pytest.mark.skip(reason="Requires reliable external DB connection (prisma).")-async def test_user_info_team_list(prisma_client):+async def test_user_info_team_list(prisma_client): # noqa: F811 # pytest fixture, not a redefinition"""Assert user_info for admin calls team_list function"""from litellm.proxy._types import LiteLLM_UserTable@@ -1535,7 +1533,7 @@ async def test_user_info_team_list(prisma_client):@pytest.mark.skip(reason="Local test")@pytest.mark.asyncio-async def test_add_callback_via_key(prisma_client):+async def test_add_callback_via_key(prisma_client): # noqa: F811 # pytest fixture, not a redefinition"""Test if callback specified in key, is used."""@@ -2151,7 +2149,7 @@ async def test_model_info_alias_without_prisma(hidden):@pytest.mark.parametrize("hidden", [True, False])@pytest.mark.asyncio@pytest.mark.skip(reason="Requires reliable external DB connection (prisma).")-async def test_proxy_model_group_alias_checks(prisma_client, hidden):+async def test_proxy_model_group_alias_checks(prisma_client, hidden): # noqa: F811 # pytest fixture, not a redefinition"""Check if model group alias is returned on@@ -2232,7 +2230,7 @@ async def test_proxy_model_group_alias_checks(prisma_client, hidden):@pytest.mark.asyncio@pytest.mark.skip(reason="Requires reliable external DB connection (prisma).")-async def test_proxy_model_group_info_rerank(prisma_client):+async def test_proxy_model_group_info_rerank(prisma_client): # noqa: F811 # pytest fixture, not a redefinition"""Check if rerank model is returned on the following endpoints@@ -3035,7 +3033,7 @@ async def test_update_config_success_callback_normalization():setattr(proxy_server, "prisma_client", MockPrisma())class MockProxyConfig:- async def add_deployment(self, prisma_client=None, proxy_logging_obj=None):+ async def add_deployment(self, prisma_client=None, proxy_logging_obj=None): # noqa: F811 # pytest fixture, not a redefinitionreturn Nonesetattr(proxy_server, "proxy_config", MockProxyConfig())diff --git a/tests/proxy_unit_tests/test_proxy_setting_guardrails.py b/tests/proxy_unit_tests/test_proxy_setting_guardrails.pyindex d5dac59b3cf..d16546249a4 100644--- a/tests/proxy_unit_tests/test_proxy_setting_guardrails.py+++ b/tests/proxy_unit_tests/test_proxy_setting_guardrails.py@@ -8,7 +8,6 @@ from dotenv import load_dotenvload_dotenv()import asyncioimport io-import ossys.path.insert(0, os.path.abspath("../..")diff --git a/tests/proxy_unit_tests/test_unit_test_proxy_hooks.py b/tests/proxy_unit_tests/test_unit_test_proxy_hooks.pyindex 8f17e34b94a..492b4803af4 100644--- a/tests/proxy_unit_tests/test_unit_test_proxy_hooks.py+++ b/tests/proxy_unit_tests/test_unit_test_proxy_hooks.py@@ -17,7 +17,6 @@ async def test_disable_spend_logs():Test that the spend logs are not written to the database when disable_spend_logs is True"""# Mock the necessary components- import asynciomock_prisma_client = Mock()mock_prisma_client.spend_log_transactions = []diff --git a/tests/proxy_unit_tests/test_user_api_key_auth.py b/tests/proxy_unit_tests/test_user_api_key_auth.pyindex 58dbe3ad370..eaff71a8f58 100644--- a/tests/proxy_unit_tests/test_user_api_key_auth.py+++ b/tests/proxy_unit_tests/test_user_api_key_auth.py@@ -559,7 +559,6 @@ def test_get_api_key_from_custom_header_different_casing():)-from litellm.proxy._types import LitellmUserRoles@pytest.mark.parametrize(diff --git a/tests/router_unit_tests/conftest.py b/tests/router_unit_tests/conftest.pyindex 6a8f3e589f4..db6a722a926 100644--- a/tests/router_unit_tests/conftest.py+++ b/tests/router_unit_tests/conftest.py@@ -48,7 +48,6 @@ def setup_and_teardown():0, os.path.abspath("../..")) # Adds the project directory to the system path- import litellmfrom litellm.litellm_core_utils.logging_worker import GLOBAL_LOGGING_WORKERdiff --git a/tests/router_unit_tests/test_router_cooldown_utils.py b/tests/router_unit_tests/test_router_cooldown_utils.pyindex 6bcb0d9bf84..a51b0dc21af 100644--- a/tests/router_unit_tests/test_router_cooldown_utils.py+++ b/tests/router_unit_tests/test_router_cooldown_utils.py@@ -27,10 +27,6 @@ from litellm.router_utils.router_callbacks.track_deployment_metrics import (increment_deployment_successes_for_current_minute,)-import pytest-from unittest.mock import patch-from litellm import Router-from litellm.router_utils.cooldown_handlers import _should_cooldown_deploymentload_dotenv()diff --git a/tests/router_unit_tests/test_router_index_management.py b/tests/router_unit_tests/test_router_index_management.pyindex 983fc0c4c3b..3f0a185e8bf 100644--- a/tests/router_unit_tests/test_router_index_management.py+++ b/tests/router_unit_tests/test_router_index_management.py@@ -2,7 +2,6 @@ import sysimport osimport pytestimport ast-import astsys.path.insert(0, os.path.abspath("../..")diff --git a/tests/store_model_in_db_tests/test_callbacks_in_db.py b/tests/store_model_in_db_tests/test_callbacks_in_db.pyindex e92aeb6ebc4..6497e4064b7 100644--- a/tests/store_model_in_db_tests/test_callbacks_in_db.py+++ b/tests/store_model_in_db_tests/test_callbacks_in_db.py@@ -14,7 +14,6 @@ import aiohttpimport osimport dotenvfrom dotenv import load_dotenv-import pytestfrom openai import AsyncOpenAI, APIConnectionErrorfrom openai.types.chat import ChatCompletiondiff --git a/tests/store_model_in_db_tests/test_team_models.py b/tests/store_model_in_db_tests/test_team_models.pyindex 83822433a63..b303dfcb7e6 100644--- a/tests/store_model_in_db_tests/test_team_models.py+++ b/tests/store_model_in_db_tests/test_team_models.py@@ -5,7 +5,6 @@ import jsonfrom openai import AsyncOpenAIfrom litellm._uuid import uuidfrom httpx import AsyncClient-from litellm._uuid import uuidimport osTEST_MASTER_KEY = "sk-1234"diff --git a/tests/test_callbacks_on_proxy.py b/tests/test_callbacks_on_proxy.pyindex 17c0db9260f..130ce773b1f 100644--- a/tests/test_callbacks_on_proxy.py+++ b/tests/test_callbacks_on_proxy.py@@ -13,7 +13,6 @@ import reimport dotenvfrom collections import Counterfrom dotenv import load_dotenv-import pytestload_dotenv()diff --git a/tests/test_fallbacks.py b/tests/test_fallbacks.pyindex bc9aa4c64c8..7d6deaddd9e 100644--- a/tests/test_fallbacks.py+++ b/tests/test_fallbacks.py@@ -289,10 +289,8 @@ async def test_chat_completion_client_fallbacks_with_custom_message(has_access):pytest.fail("Expected this to work: {}".format(str(e)))-import asynciofrom openai import AsyncOpenAIfrom typing import List-import timeasync def make_request(client: AsyncOpenAI, model: str) -> bool:diff --git a/tests/test_litellm/caching/test_caching_handler.py b/tests/test_litellm/caching/test_caching_handler.pyindex 38019fc0fee..9684e82f550 100644--- a/tests/test_litellm/caching/test_caching_handler.py+++ b/tests/test_litellm/caching/test_caching_handler.py@@ -14,7 +14,7 @@ sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathfrom datetime import datetime-from unittest.mock import AsyncMock, MagicMock+from unittest.mock import AsyncMockfrom litellm.caching.caching_handler import LLMCachingHandlerdiff --git a/tests/test_litellm/google_genai/test_google_genai_adapter.py b/tests/test_litellm/google_genai/test_google_genai_adapter.pyindex f21564546a8..8f5f4d41f3c 100644--- a/tests/test_litellm/google_genai/test_google_genai_adapter.py+++ b/tests/test_litellm/google_genai/test_google_genai_adapter.py@@ -15,11 +15,9 @@ sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system path-import jsonimport osimport sys-import pytestimport litellmdiff --git a/tests/test_litellm/google_genai/test_google_genai_main.py b/tests/test_litellm/google_genai/test_google_genai_main.pyindex 8f56b4e4bc0..8441b62e559 100644--- a/tests/test_litellm/google_genai/test_google_genai_main.py+++ b/tests/test_litellm/google_genai/test_google_genai_main.py@@ -13,11 +13,9 @@ sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system path-import jsonimport osimport sys-import pytestimport litellmdiff --git a/tests/test_litellm/integrations/test_galileo.py b/tests/test_litellm/integrations/test_galileo.pyindex 0533b7ca7d1..8905795bbc6 100644--- a/tests/test_litellm/integrations/test_galileo.py+++ b/tests/test_litellm/integrations/test_galileo.py@@ -112,7 +112,6 @@ def test_galileo_input_text_from_messages():def test_galileo_get_output_str_responses_api(galileo_v2_env):- from litellm.types.llms.openai import ResponsesAPIResponselogger = GalileoObserve()resp_dict = {diff --git a/tests/test_litellm/integrations/test_langfuse.py b/tests/test_litellm/integrations/test_langfuse.pyindex 3c7dd51bff8..73a62e5594d 100644--- a/tests/test_litellm/integrations/test_langfuse.py+++ b/tests/test_litellm/integrations/test_langfuse.py@@ -14,7 +14,6 @@ from litellm.integrations.langfuse import langfuse as langfuse_modulefrom litellm.integrations.langfuse.langfuse import LangFuseLoggersys.path.insert(0, os.path.abspath("../.."))-from litellm.integrations.langfuse.langfuse import LangFuseLogger# Import LangfuseUsageDetails directly from the module where it's definedfrom litellm.types.integrations.langfuse import *diff --git a/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_factory.py b/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_factory.pyindex 08d8c17cc2e..a10dc46eb42 100644--- a/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_factory.py+++ b/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_factory.py@@ -332,7 +332,6 @@ def test_bedrock_get_document_format_fallback_mimes():This tests the fallback mechanism when mimetypes.guess_all_extensions returns empty results,which can happen in Docker containers where mimetypes depends on OS-installed MIME types."""- from unittest.mock import patch# Test DOCX fallbackdocx_mime = (diff --git a/tests/test_litellm/litellm_core_utils/test_token_counter.py b/tests/test_litellm/litellm_core_utils/test_token_counter.pyindex eec4b307c87..bd373f87eea 100644--- a/tests/test_litellm/litellm_core_utils/test_token_counter.py+++ b/tests/test_litellm/litellm_core_utils/test_token_counter.py@@ -13,7 +13,7 @@ import tiktokensys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system path-from unittest.mock import AsyncMock, MagicMock, patch+from unittest.mock import AsyncMock, patchimport litellmfrom litellm import create_pretrained_tokenizer, decode, encode, get_modified_max_tokens@@ -634,7 +634,6 @@ def test_token_counter():import unittest-from unittest.mock import MagicMock, patchfrom litellm.utils import _select_tokenizer_helper, claude_json_str, encodingdiff --git a/tests/test_litellm/llms/anthropic/batches/test_transformation.py b/tests/test_litellm/llms/anthropic/batches/test_transformation.pyindex 4a2adb01ea5..1635abcefd8 100644--- a/tests/test_litellm/llms/anthropic/batches/test_transformation.py+++ b/tests/test_litellm/llms/anthropic/batches/test_transformation.py@@ -619,7 +619,6 @@ def test_transform_response_reraises_unexpected_error(config):# automatically. See base_batches_config_test.py.# --------------------------------------------------------------------------- #-from litellm.types.utils import LlmProviders # noqa: E402from tests.test_litellm.llms.base_llm.batches.base_batches_config_test import ( # noqa: E402BatchesConfigContractTests,)diff --git a/tests/test_litellm/llms/azure/image_generation/test_azure_image_generation_init.py b/tests/test_litellm/llms/azure/image_generation/test_azure_image_generation_init.pyindex a211a69b9c7..857ed9d22a6 100644--- a/tests/test_litellm/llms/azure/image_generation/test_azure_image_generation_init.py+++ b/tests/test_litellm/llms/azure/image_generation/test_azure_image_generation_init.py@@ -312,7 +312,6 @@ def test_azure_image_generation_base_model_vs_deployment_name():model: azure/gpt-image-15 # deployment name (URL only)base_model: gpt-image-1.5 # optional, for LiteLLM metadata"""- from unittest.mock import MagicMock# Setup test parametersazure_chat_completion = AzureChatCompletion()@@ -385,7 +384,6 @@ async def test_azure_aimage_generation_base_model_vs_deployment_name():Async variant of test_azure_image_generation_base_model_vs_deployment_name:deployment in URL, no ``model`` in the JSON body sent to Azure."""- from unittest.mock import MagicMock# Setup test parametersazure_chat_completion = AzureChatCompletion()diff --git a/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_text_completion_transformation.py b/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_text_completion_transformation.pyindex 9fe76d142ce..4f76a39684a 100644--- a/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_text_completion_transformation.py+++ b/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_text_completion_transformation.py@@ -18,7 +18,6 @@ from litellm.llms.fireworks_ai.completion.transformation import (def force_local_model_cost(monkeypatch):"""Force local model cost map usage for all tests in this file."""monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")- import litellmfrom litellm.litellm_core_utils.get_model_cost_map import get_model_cost_maplitellm.model_cost = get_model_cost_map(url=litellm.model_cost_map_url)diff --git a/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.py b/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.pyindex 52f1a6a99b8..51cffd5e51a 100644--- a/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.py+++ b/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.py@@ -11,7 +11,6 @@ import pytestsys.path.insert(0, os.path.abspath("../.."))import httpx-import pytestfrom respx import MockRouterimport litellmdiff --git a/tests/test_litellm/llms/ollama/test_ollama_chat_transformation.py b/tests/test_litellm/llms/ollama/test_ollama_chat_transformation.pyindex 906c51d8064..8f3dbf7b0d9 100644--- a/tests/test_litellm/llms/ollama/test_ollama_chat_transformation.py+++ b/tests/test_litellm/llms/ollama/test_ollama_chat_transformation.py@@ -86,7 +86,6 @@ class TestOllamaChatConfigResponseFormat:def test_transform_request_loads_config_parameters(self):"""Test that transform_request loads config parameters without overriding existing optional_params"""# Set config parameters on the class- import litellmlitellm.OllamaChatConfig(num_ctx=8000, temperature=0.0)@@ -383,7 +382,6 @@ class TestOllamaToolCalling:import jsonfrom unittest.mock import MagicMock- import litellmfrom litellm.types.utils import Choices, Message, ModelResponseconfig = OllamaChatConfig()diff --git a/tests/test_litellm/llms/openai/chat/test_openai_gpt_transformation.py b/tests/test_litellm/llms/openai/chat/test_openai_gpt_transformation.pyindex 45f1bdbfa85..101c5363bf7 100644--- a/tests/test_litellm/llms/openai/chat/test_openai_gpt_transformation.py+++ b/tests/test_litellm/llms/openai/chat/test_openai_gpt_transformation.py@@ -16,7 +16,6 @@ from litellm.llms.openai.chat.gpt_transformation import (OpenAIChatCompletionStreamingHandler,OpenAIGPTConfig,)-from litellm.llms.openai.chat.gpt_5_transformation import OpenAIGPT5Configclass TestOpenAIGPTConfig:diff --git a/tests/test_litellm/llms/openai/realtime/test_openai_realtime_handler.py b/tests/test_litellm/llms/openai/realtime/test_openai_realtime_handler.pyindex e9798f45dce..2633e76b0f3 100644--- a/tests/test_litellm/llms/openai/realtime/test_openai_realtime_handler.py+++ b/tests/test_litellm/llms/openai/realtime/test_openai_realtime_handler.py@@ -97,7 +97,6 @@ def test_openai_realtime_handler_model_parameter_inclusion():import asyncio-from unittest.mock import AsyncMock, MagicMock, patchimport pytestdiff --git a/tests/test_litellm/llms/vertex_ai/gemini/test_vertex_and_google_ai_studio_gemini.py b/tests/test_litellm/llms/vertex_ai/gemini/test_vertex_and_google_ai_studio_gemini.pyindex b7265ed62e9..3d882deeb52 100644--- a/tests/test_litellm/llms/vertex_ai/gemini/test_vertex_and_google_ai_studio_gemini.py+++ b/tests/test_litellm/llms/vertex_ai/gemini/test_vertex_and_google_ai_studio_gemini.py@@ -5273,7 +5273,6 @@ class TestModelResponseIteratorCleanup:return objdef test_aclose_closes_iterator_and_response(self):- import asynciofrom unittest.mock import AsyncMock, MagicMockfrom litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini import (@@ -5323,7 +5322,6 @@ class TestModelResponseIteratorCleanup:mock_response.close.assert_called_once()def test_aclose_without_response_does_not_raise(self):- import asynciofrom unittest.mock import AsyncMock, MagicMockfrom litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini import (@@ -5345,7 +5343,6 @@ class TestModelResponseIteratorCleanup:mock_iterator.aclose.assert_awaited_once()def test_aclose_tolerates_iterator_error(self):- import asynciofrom unittest.mock import AsyncMock, MagicMockfrom litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini import (@@ -5372,7 +5369,6 @@ class TestModelResponseIteratorCleanup:def test_custom_stream_wrapper_aclose_triggers_model_response_iterator_aclose(self):"""CustomStreamWrapper.aclose() must propagate to ModelResponseIterator.aclose()."""- import asynciofrom unittest.mock import AsyncMock, MagicMockfrom litellm.litellm_core_utils.streaming_handler import CustomStreamWrapperdiff --git a/tests/test_litellm/llms/watsonx/test_watsonx_common_utils.py b/tests/test_litellm/llms/watsonx/test_watsonx_common_utils.pyindex 8b7a297ec67..be74dc40eda 100644--- a/tests/test_litellm/llms/watsonx/test_watsonx_common_utils.py+++ b/tests/test_litellm/llms/watsonx/test_watsonx_common_utils.py@@ -41,9 +41,9 @@ class TestGenerateIAMToken:# Verify get_secret_str was called with correct keys in order# Note: get_watsonx_iam_url() also calls get_secret_str("WATSONX_IAM_URL")calls = [- call[0][0]- for call in mock_get_secret_str.call_args_list- if call[0][0] != "WATSONX_IAM_URL"+ recorded[0][0]+ for recorded in mock_get_secret_str.call_args_list+ if recorded[0][0] != "WATSONX_IAM_URL"]assert "WX_API_KEY" in callsassert "WATSONX_API_KEY" in calls@@ -155,9 +155,9 @@ class TestGenerateIAMToken:# Verify get_secret_str was called with expected keys (checking short-circuit behavior)# Note: get_watsonx_iam_url() also calls get_secret_str("WATSONX_IAM_URL"), so we filter that outactual_calls = [- call[0][0]- for call in mock_get_secret_str.call_args_list- if call[0][0] != "WATSONX_IAM_URL"+ recorded[0][0]+ for recorded in mock_get_secret_str.call_args_list+ if recorded[0][0] != "WATSONX_IAM_URL"]assert (actual_calls == expected_calls@@ -189,9 +189,9 @@ class TestGenerateIAMToken:# Verify get_secret_str was NOT called for API keys (since api_key was provided)# Note: get_watsonx_iam_url() calls get_secret_str("WATSONX_IAM_URL"), which is expectedapi_key_calls = [- call[0][0]- for call in mock_get_secret_str.call_args_list- if call[0][0] not in ["WATSONX_IAM_URL"]+ recorded[0][0]+ for recorded in mock_get_secret_str.call_args_list+ if recorded[0][0] not in ["WATSONX_IAM_URL"]]assert (len(api_key_calls) == 0@@ -219,9 +219,9 @@ class TestGenerateIAMToken:# Verify get_secret_str was called for all possible API keys# Note: get_watsonx_iam_url() also calls get_secret_str("WATSONX_IAM_URL")calls = [- call[0][0]- for call in mock_get_secret_str.call_args_list- if call[0][0] != "WATSONX_IAM_URL"+ recorded[0][0]+ for recorded in mock_get_secret_str.call_args_list+ if recorded[0][0] != "WATSONX_IAM_URL"]assert "WX_API_KEY" in callsassert "WATSONX_API_KEY" in callsdiff --git a/tests/test_litellm/passthrough/test_passthrough_main.py b/tests/test_litellm/passthrough/test_passthrough_main.pyindex 965f9fd8f7d..e43e4be8bcc 100644--- a/tests/test_litellm/passthrough/test_passthrough_main.py+++ b/tests/test_litellm/passthrough/test_passthrough_main.py@@ -14,7 +14,6 @@ sys.path.insert() # Adds the parent directory to the system path-from unittest.mock import MagicMock, patchimport litellmfrom litellm.passthrough.main import allm_passthrough_route, llm_passthrough_routediff --git a/tests/test_litellm/proxy/auth/test_model_checks.py b/tests/test_litellm/proxy/auth/test_model_checks.pyindex 5161554b969..62073f4bf51 100644--- a/tests/test_litellm/proxy/auth/test_model_checks.py+++ b/tests/test_litellm/proxy/auth/test_model_checks.py@@ -700,7 +700,6 @@ def test_expand_wildcard_deployments_non_wildcard_passthrough():def test_expand_wildcard_deployments_openai_wildcard():"""openai/* should expand into ≥1 known openai model entries."""- from unittest.mock import patchfrom litellm.proxy.auth.model_checks import (expand_wildcard_deployments_for_model_info,diff --git a/tests/test_litellm/proxy/auth/test_route_checks.py b/tests/test_litellm/proxy/auth/test_route_checks.pyindex 636c5480d67..b3b73723726 100644--- a/tests/test_litellm/proxy/auth/test_route_checks.py+++ b/tests/test_litellm/proxy/auth/test_route_checks.py@@ -1791,7 +1791,6 @@ def test_proxy_admin_viewer_can_access_global_spend_tags():# Routes returning proxy-wide spend across every team / customer / api_key.# Sourced from `LiteLLMRoutes.global_spend_tracking_routes` so any future# additions to that list are exercised by these tests automatically.-from litellm.proxy._types import LiteLLMRoutesGLOBAL_SPEND_ROUTES = LiteLLMRoutes.global_spend_tracking_routes.value@@ -2617,10 +2616,7 @@ def test_available_roles_accessible_to_non_admin_users(user_role):# ── _user_is_org_admin tests ──────────────────────────────────────────────────-from datetime import datetime-from litellm.proxy._types import LiteLLM_OrganizationMembershipTable-from litellm.proxy.auth.auth_checks_organization import _user_is_org_admindef _make_org_admin_user(org_id: str) -> LiteLLM_UserTable:diff --git a/tests/test_litellm/proxy/client/cli/test_keys_commands.py b/tests/test_litellm/proxy/client/cli/test_keys_commands.pyindex 977aec9f5b7..5d88b031eac 100644--- a/tests/test_litellm/proxy/client/cli/test_keys_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_keys_commands.py@@ -124,7 +124,6 @@ def test_async_keys_generate_error_handling(mock_keys_client, cli_runner):def test_async_keys_delete_error_handling(mock_keys_client, cli_runner):- import requests# Mock a connection error that would normally happen in CImock_keys_client.return_value.delete.side_effect = (@@ -146,7 +145,6 @@ def test_async_keys_delete_error_handling(mock_keys_client, cli_runner):def test_async_keys_delete_http_error_handling(mock_keys_client, cli_runner):from unittest.mock import Mock- import requests# Create a mock response object for HTTPErrormock_response = Mock()diff --git a/tests/test_litellm/proxy/db/test_db_spend_update_writer.py b/tests/test_litellm/proxy/db/test_db_spend_update_writer.pyindex f3c2ca65d02..4113d708196 100644--- a/tests/test_litellm/proxy/db/test_db_spend_update_writer.py+++ b/tests/test_litellm/proxy/db/test_db_spend_update_writer.py@@ -197,7 +197,7 @@ def test_enqueue_tool_registry_upsert_reads_every_choice():db_writer._enqueue_tool_registry_upsert(kwargs={}, completion_response=response)- enqueued = [call.args[0]["tool_name"] for call in db_writer.tool_discovery_queue.add_update.call_args_list]+ enqueued = [c.args[0]["tool_name"] for c in db_writer.tool_discovery_queue.add_update.call_args_list]assert enqueued == ["tool_alpha", "tool_beta"]diff --git a/tests/test_litellm/proxy/db/test_exception_handler.py b/tests/test_litellm/proxy/db/test_exception_handler.pyindex 84a9ddfacff..a656d5edcbc 100644--- a/tests/test_litellm/proxy/db/test_exception_handler.py+++ b/tests/test_litellm/proxy/db/test_exception_handler.py@@ -6,7 +6,7 @@ from unittest.mock import MagicMock, patchimport httpximport pytest-from fastapi import HTTPException, Request, status+from fastapi import HTTPException, Requestfrom prisma import errors as prisma_errorsfrom prisma.errors import (ClientNotConnectedError,diff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.pyindex 14c0d2f9435..613cbbce8b4 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.py@@ -1964,7 +1964,6 @@ async def test_model_armor_guardrail_status_intervened_vs_failed():def mock_open(read_data=""):"""Helper to create a mock file object"""- import iofrom unittest.mock import MagicMockfile_object = io.StringIO(read_data)diff --git a/tests/test_litellm/proxy/guardrails/test_qostodian_nexus_guardrail.py b/tests/test_litellm/proxy/guardrails/test_qostodian_nexus_guardrail.pyindex 6daa3e1430d..2753d8dd134 100644--- a/tests/test_litellm/proxy/guardrails/test_qostodian_nexus_guardrail.py+++ b/tests/test_litellm/proxy/guardrails/test_qostodian_nexus_guardrail.py@@ -16,7 +16,6 @@ from unittest.mock import MagicMockdef test_qostodian_nexus_initialization_with_defaults():"""Test QostodianNexus initializes with default values."""- import osfrom unittest.mock import patchfrom litellm.proxy.guardrails.guardrail_hooks.qohash import QostodianNexus@@ -171,7 +170,6 @@ def test_qostodian_nexus_get_config_model():def test_qostodian_nexus_env_vars():"""Test that QOSTODIAN_NEXUS_API_BASE env var is picked up correctly."""- import osfrom unittest.mock import patchfrom litellm.proxy.guardrails.guardrail_hooks.qohash import QostodianNexusdiff --git a/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py b/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.pyindex 831f659051c..e576ba87e88 100644--- a/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py+++ b/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py@@ -1321,7 +1321,6 @@ def test_get_callback_identifier_string_and_object_with_callback_name():- Object with callback_name attribute- Object with empty/None callback_name (should fall through to other checks)"""- from litellm.proxy.health_endpoints._health_endpoints import get_callback_identifier# Test 1: String callback should be returned as-isassert get_callback_identifier("datadog") == "datadog"@@ -1353,7 +1352,6 @@ def test_get_callback_identifier_custom_logger_registry_and_fallback():- Object with callback_name that matches registry entry- Fallback to callback_name() helper function"""- from litellm.proxy.health_endpoints._health_endpoints import get_callback_identifierfrom litellm.litellm_core_utils.custom_logger_registry import CustomLoggerRegistry# Test 1: Object registered in CustomLoggerRegistry (without callback_name attribute)diff --git a/tests/test_litellm/proxy/hooks/test_parallel_request_limiter_v3.py b/tests/test_litellm/proxy/hooks/test_parallel_request_limiter_v3.pyindex fee892ad342..a72871310c7 100644--- a/tests/test_litellm/proxy/hooks/test_parallel_request_limiter_v3.py+++ b/tests/test_litellm/proxy/hooks/test_parallel_request_limiter_v3.py@@ -1575,7 +1575,6 @@ async def test_async_increment_tokens_with_ttl_preservation():3. Second call: Increment same keys4. Verify TTL decreased but wasn't reset to 60s"""- import osimport timefrom litellm.caching.redis_cache import RedisCachediff --git a/tests/test_litellm/proxy/management_endpoints/scim/test_scim_v2_endpoints.py b/tests/test_litellm/proxy/management_endpoints/scim/test_scim_v2_endpoints.pyindex 0a9efd40b48..5f6c1a2375b 100644--- a/tests/test_litellm/proxy/management_endpoints/scim/test_scim_v2_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/scim/test_scim_v2_endpoints.py@@ -58,7 +58,6 @@ from litellm.types.proxy.management_endpoints.scim_v2 import (SCIMUserGroup,SCIMUserName,)-from litellm.proxy._types import ProxyException@pytest.mark.asynciodiff --git a/tests/test_litellm/proxy/management_endpoints/test_auto_router_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_auto_router_endpoints.pyindex 6165e869989..5c61f8c557c 100644--- a/tests/test_litellm/proxy/management_endpoints/test_auto_router_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_auto_router_endpoints.py@@ -482,7 +482,6 @@ class TestAutoRouterBenchmarks:from datetime import datetime, timedelta, timezonefrom unittest.mock import AsyncMock, MagicMock-from fastapi import HTTPExceptionfrom litellm.proxy.management_endpoints.auto_router_endpoints import (get_shadow_eval_job,diff --git a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.pyindex e39b09ae073..a4c2b7c06bf 100644--- a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py@@ -4529,7 +4529,6 @@ async def test_new_team_org_scoped_budget_bypasses_user_limit():from fastapi import Requestfrom litellm.proxy._types import (- LiteLLM_OrganizationTable,LiteLLM_UserTable,NewTeamRequest,UserAPIKeyAuth,@@ -4674,7 +4673,6 @@ async def test_new_team_org_scoped_models_bypasses_user_limit():from fastapi import Requestfrom litellm.proxy._types import (- LiteLLM_OrganizationTable,LiteLLM_UserTable,NewTeamRequest,UserAPIKeyAuth,@@ -4964,7 +4962,6 @@ async def test_new_team_org_scoped_budget_exceeds_org_limit():from litellm.proxy._types import (LiteLLM_BudgetTable,- LiteLLM_OrganizationTable,NewTeamRequest,ProxyException,UserAPIKeyAuth,@@ -5044,7 +5041,6 @@ async def test_new_team_org_scoped_models_not_in_org_models():from litellm.proxy._types import (LiteLLM_BudgetTable,- LiteLLM_OrganizationTable,NewTeamRequest,ProxyException,UserAPIKeyAuth,@@ -5633,7 +5629,6 @@ async def test_update_team_org_scoped_budget_exceeds_org_limit():from litellm.proxy._types import (LiteLLM_BudgetTable,- LiteLLM_OrganizationTable,ProxyException,UpdateTeamRequest,UserAPIKeyAuth,@@ -5813,7 +5808,6 @@ async def test_update_team_org_scoped_budget_bypasses_user_limit(from litellm.proxy._types import (LiteLLM_BudgetTable,- LiteLLM_OrganizationTable,LiteLLM_UserTable,UpdateTeamRequest,UserAPIKeyAuth,@@ -5929,7 +5923,6 @@ async def test_update_team_org_scoped_models_bypasses_user_limit(from fastapi import Requestfrom litellm.proxy._types import (- LiteLLM_OrganizationTable,UpdateTeamRequest,UserAPIKeyAuth,)@@ -6031,7 +6024,6 @@ async def test_update_team_org_scoped_models_not_in_org_models():from fastapi import Requestfrom litellm.proxy._types import (- LiteLLM_OrganizationTable,ProxyException,UpdateTeamRequest,UserAPIKeyAuth,@@ -6120,7 +6112,6 @@ async def test_update_team_org_scoped_models_with_all_proxy_models(from fastapi import Requestfrom litellm.proxy._types import (- LiteLLM_OrganizationTable,SpecialModelNames,UpdateTeamRequest,UserAPIKeyAuth,@@ -6403,7 +6394,6 @@ async def test_new_team_org_scoped_tpm_exceeds_org_limit():from litellm.proxy._types import (LiteLLM_BudgetTable,- LiteLLM_OrganizationTable,NewTeamRequest,ProxyException,UserAPIKeyAuth,@@ -6479,7 +6469,6 @@ async def test_new_team_org_scoped_rpm_exceeds_org_limit():from litellm.proxy._types import (LiteLLM_BudgetTable,- LiteLLM_OrganizationTable,NewTeamRequest,ProxyException,UserAPIKeyAuth,@@ -6556,7 +6545,6 @@ async def test_new_team_org_scoped_tpm_rpm_bypasses_user_limit():from litellm.proxy._types import (LiteLLM_BudgetTable,- LiteLLM_OrganizationTable,LiteLLM_TeamTable,NewTeamRequest,UserAPIKeyAuth,@@ -6665,7 +6653,6 @@ async def test_update_team_org_scoped_tpm_exceeds_org_limit():from litellm.proxy._types import (LiteLLM_BudgetTable,- LiteLLM_OrganizationTable,ProxyException,UpdateTeamRequest,UserAPIKeyAuth,@@ -6752,7 +6739,6 @@ async def test_update_team_org_scoped_rpm_exceeds_org_limit():from litellm.proxy._types import (LiteLLM_BudgetTable,- LiteLLM_OrganizationTable,ProxyException,UpdateTeamRequest,UserAPIKeyAuth,@@ -6842,7 +6828,6 @@ async def test_update_team_org_scoped_tpm_rpm_bypasses_user_limit(from litellm.proxy._types import (LiteLLM_BudgetTable,- LiteLLM_OrganizationTable,LiteLLM_TeamTable,UpdateTeamRequest,UserAPIKeyAuth,@@ -6948,7 +6933,6 @@ async def test_update_team_guardrails_with_org_id(from fastapi import Requestfrom litellm.proxy._types import (- LiteLLM_OrganizationTable,LiteLLM_TeamTable,UpdateTeamRequest,UserAPIKeyAuth,diff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py b/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.pyindex d3237f5f49d..6568f6aeacf 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py@@ -2405,9 +2405,6 @@ class TestMilvusProxyRoute:"""Test successful Milvus proxy route with valid managed vector store index"""- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- milvus_proxy_route,- )collection_name = "dall-e-6"vector_store_name = "milvus-store-1"@@ -2518,9 +2515,6 @@ class TestMilvusProxyRoute:"""from fastapi import HTTPException- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- milvus_proxy_route,- )mock_request = MagicMock(spec=Request)mock_response = MagicMock(spec=Response)@@ -2555,9 +2549,6 @@ class TestMilvusProxyRoute:"""from fastapi import HTTPException- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- milvus_proxy_route,- )mock_request = MagicMock(spec=Request)mock_response = MagicMock(spec=Response)@@ -2587,9 +2578,6 @@ class TestMilvusProxyRoute:"""from fastapi import HTTPException- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- milvus_proxy_route,- )collection_name = "test-collection"@@ -2629,9 +2617,6 @@ class TestMilvusProxyRoute:"""from fastapi import HTTPException- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- milvus_proxy_route,- )collection_name = "unmanaged-collection"@@ -2672,9 +2657,6 @@ class TestMilvusProxyRoute:"""Test that missing vector store raises Exception"""- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- milvus_proxy_route,- )collection_name = "test-collection"vector_store_name = "missing-store"@@ -2731,9 +2713,6 @@ class TestMilvusProxyRoute:"""Test that missing api_base raises Exception"""- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- milvus_proxy_route,- )collection_name = "test-collection"vector_store_name = "milvus-store-1"@@ -2797,9 +2776,6 @@ class TestMilvusProxyRoute:"""Test that endpoint without leading slash is handled correctly"""- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- milvus_proxy_route,- )collection_name = "test-collection"vector_store_name = "milvus-store-1"@@ -2877,9 +2853,6 @@ class TestOpenAIPassthroughRoute:This verifies the fix for issue #18865 where /openai/v1/responses was beingrouted to LiteLLM's native implementation instead of passthrough"""- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- openai_proxy_route,- )# Mock request for Responses APImock_request = MagicMock(spec=Request)@@ -2931,9 +2904,6 @@ class TestOpenAIPassthroughRoute:"""Test that /openai_passthrough works for chat completions"""- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- openai_proxy_route,- )mock_request = MagicMock(spec=Request)mock_request.method = "POST"@@ -2976,9 +2946,6 @@ class TestOpenAIPassthroughRoute:"""Test that missing OPENAI_API_KEY raises an exception"""- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- openai_proxy_route,- )mock_request = MagicMock(spec=Request)mock_response = MagicMock(spec=Response)@@ -3003,9 +2970,6 @@ class TestOpenAIPassthroughRoute:"""Test that /openai_passthrough works for Assistants API endpoints"""- from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (- openai_proxy_route,- )mock_request = MagicMock(spec=Request)mock_request.method = "POST"diff --git a/tests/test_litellm/proxy/prompts/test_prompt_endpoints.py b/tests/test_litellm/proxy/prompts/test_prompt_endpoints.pyindex 57ad6acae3b..6ebb10eff76 100644--- a/tests/test_litellm/proxy/prompts/test_prompt_endpoints.py+++ b/tests/test_litellm/proxy/prompts/test_prompt_endpoints.py@@ -206,7 +206,7 @@ class TestPromptVersionsEndpoint:"""Test that get_prompt_versions returns all versions of a prompt sorted by version number"""- from unittest.mock import MagicMock, patch+ from unittest.mock import patchfrom litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuthfrom litellm.proxy.prompts.prompt_endpoints import get_prompt_versionsdiff --git a/tests/test_litellm/proxy/test_common_request_processing.py b/tests/test_litellm/proxy/test_common_request_processing.pyindex 716fba370df..8074f475af2 100644--- a/tests/test_litellm/proxy/test_common_request_processing.py+++ b/tests/test_litellm/proxy/test_common_request_processing.py@@ -28,7 +28,6 @@ from litellm.proxy.common_request_processing import (_get_cost_breakdown_from_logging_obj,_has_attribute_error_in_chain,_is_azure_model_router_request,- _UpstreamClosingStreamingResponse,open_sse_before_first_byte,ttft_keepalive_interval,_override_openai_response_model,diff --git a/tests/test_litellm/proxy/test_litellm_pre_call_utils.py b/tests/test_litellm/proxy/test_litellm_pre_call_utils.pyindex 636974d5deb..d14c89342e9 100644--- a/tests/test_litellm/proxy/test_litellm_pre_call_utils.py+++ b/tests/test_litellm/proxy/test_litellm_pre_call_utils.py@@ -2736,10 +2736,8 @@ def test_add_headers_to_llm_call_by_model_group_existing_headers_in_data():litellm.model_group_settings = original_model_group_settings-import jsonimport timefrom typing import Optional-from unittest.mock import AsyncMockfrom fastapi.responses import Responsediff --git a/tests/test_litellm/proxy/test_proxy_server.py b/tests/test_litellm/proxy/test_proxy_server.pyindex 83e9095c8ec..343b274cd8c 100644--- a/tests/test_litellm/proxy/test_proxy_server.py+++ b/tests/test_litellm/proxy/test_proxy_server.py@@ -3344,7 +3344,7 @@ async def test_write_config_to_file(monkeypatch):"""Do not write config to file if store_model_in_db is True"""- from unittest.mock import AsyncMock, MagicMock, mock_open, patch+ from unittest.mock import AsyncMock, MagicMock, patchfrom litellm.proxy.proxy_server import ProxyConfig@@ -3392,7 +3392,7 @@ async def test_write_config_to_file_when_store_model_in_db_false(monkeypatch):"""Test that config IS written to file when store_model_in_db is False"""- from unittest.mock import AsyncMock, MagicMock, mock_open, patch+ from unittest.mock import AsyncMock, MagicMock, patchfrom litellm.proxy.proxy_server import ProxyConfigdiff --git a/tests/test_litellm/responses/litellm_completion_transformation/test_session_handler_with_cold_storage.py b/tests/test_litellm/responses/litellm_completion_transformation/test_session_handler_with_cold_storage.pyindex e579890255c..f2fbcda59a4 100644--- a/tests/test_litellm/responses/litellm_completion_transformation/test_session_handler_with_cold_storage.py+++ b/tests/test_litellm/responses/litellm_completion_transformation/test_session_handler_with_cold_storage.py@@ -36,7 +36,6 @@ class TestColdStorageObjectKeyIntegration:This test verifies that the StandardLoggingMetadata TypedDict has thecold_storage_object_key field for storing S3/GCS object keys."""- from litellm.types.utils import StandardLoggingMetadata# Create a StandardLoggingMetadata instance with cold_storage_object_keymetadata = StandardLoggingMetadata(diff --git a/tests/test_litellm/router_strategy/test_base_routing_strategy.py b/tests/test_litellm/router_strategy/test_base_routing_strategy.pyindex 02a6ce4be2a..70259605b2f 100644--- a/tests/test_litellm/router_strategy/test_base_routing_strategy.py+++ b/tests/test_litellm/router_strategy/test_base_routing_strategy.py@@ -12,7 +12,6 @@ sys.path.insert(import asynciofrom unittest.mock import MagicMock, patch-import pytestfrom litellm.caching.caching import DualCachefrom litellm.caching.redis_cache import RedisPipelineIncrementOperationdiff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.pyindex 075b455e4b5..a9ddade98ea 100644--- a/tests/test_litellm/test_utils.py+++ b/tests/test_litellm/test_utils.py@@ -1374,7 +1374,7 @@ def test_get_provider_rerank_config():Test the get_provider_rerank_config function for various providers"""from litellm import HostedVLLMRerankConfig- from litellm.utils import LlmProviders, ProviderConfigManager+ from litellm.utils import LlmProviders# Test for hosted_vllm providerconfig = ProviderConfigManager.get_provider_rerank_config(@@ -1497,7 +1497,7 @@ def test_get_model_info_shows_supports_computer_use():def test_pre_process_non_default_params(model, custom_llm_provider):from pydantic import BaseModel- from litellm.utils import ProviderConfigManager, pre_process_non_default_params+ from litellm.utils import pre_process_non_default_paramsprovider_config = ProviderConfigManager.get_provider_chat_config(model=model, provider=LlmProviders(custom_llm_provider)@@ -2364,7 +2364,6 @@ def test_anthropic_claude_4_invoke_chat_provider_config():from litellm.llms.bedrock.chat.invoke_transformations.anthropic_claude3_transformation import (AmazonAnthropicClaudeConfig,)- from litellm.utils import ProviderConfigManagerconfig = ProviderConfigManager.get_provider_chat_config(model="invoke/us.anthropic.claude-sonnet-4-20250514-v1:0",@@ -3251,7 +3250,6 @@ class TestProxyLoggingBudgetAlerts:def test_azure_ai_claude_provider_config():"""Test that Azure AI Claude models return AzureAnthropicConfig for proper tool transformation."""from litellm import AzureAIStudioConfig, AzureAnthropicConfig- from litellm.utils import ProviderConfigManager# Claude models should return AzureAnthropicConfigconfig = ProviderConfigManager.get_provider_chat_config(@@ -4319,7 +4317,6 @@ class TestGetOptionalParamsTencent:from litellm.llms.tencent.messages.transformation import (TencentAnthropicMessagesConfig,)- from litellm.utils import ProviderConfigManagerconfig = ProviderConfigManager.get_provider_anthropic_messages_config(model="deepseek-v4-pro",diff --git a/tests/test_litellm/vector_stores/test_vector_store_registry.py b/tests/test_litellm/vector_stores/test_vector_store_registry.pyindex 9f4c5a905b3..85ff8a1bcae 100644--- a/tests/test_litellm/vector_stores/test_vector_store_registry.py+++ b/tests/test_litellm/vector_stores/test_vector_store_registry.py@@ -13,7 +13,7 @@ sys.path.insert() # Adds the parent directory to the system pathfrom datetime import datetime, timezone-from unittest.mock import MagicMock, patch+from unittest.mock import MagicMockimport litellmfrom litellm.types.vector_stores import LiteLLM_ManagedVectorStorediff --git a/tests/test_team_logging.py b/tests/test_team_logging.pyindex 9e89d945eda..86b357d9d4a 100644--- a/tests/test_team_logging.py+++ b/tests/test_team_logging.py@@ -7,7 +7,6 @@ import aiohttpimport osimport dotenvfrom dotenv import load_dotenv-import pytestload_dotenv()diff --git a/tests/test_users.py b/tests/test_users.pyindex 57fbb0483e4..a6d3d0a7dc3 100644--- a/tests/test_users.py+++ b/tests/test_users.py@@ -7,7 +7,6 @@ import timefrom openai import AsyncOpenAIfrom tests.test_team import list_teamsfrom typing import Optional-from tests.test_keys import generate_keyfrom fastapi import HTTPException@@ -320,7 +319,6 @@ async def test_user_model_access():import jsonfrom litellm._uuid import uuidimport pytest-import aiohttpfrom typing import Dict, Tuplediff --git a/tests/unified_google_tests/conftest.py b/tests/unified_google_tests/conftest.pyindex c6b3fb82d0e..d2c6830c273 100644--- a/tests/unified_google_tests/conftest.py+++ b/tests/unified_google_tests/conftest.py@@ -150,7 +150,6 @@ def setup_and_teardown(request):0, os.path.abspath("../..")) # Adds the project directory to the system path- import litellmif "google_genai_proxy_url" not in request.fixturenames:importlib.reload(litellm)diff --git a/tests/vector_store_tests/base_vector_store_test.py b/tests/vector_store_tests/base_vector_store_test.pyindex 4ca643f085a..4093ea7b43b 100644--- a/tests/vector_store_tests/base_vector_store_test.py+++ b/tests/vector_store_tests/base_vector_store_test.py@@ -15,7 +15,6 @@ sys.path.insert(import litellmfrom abc import ABC, abstractmethodfrom litellm.integrations.custom_logger import CustomLogger-import jsonfrom litellm.types.utils import StandardLoggingPayloaddiff --git a/tests/vector_store_tests/conftest.py b/tests/vector_store_tests/conftest.pyindex b3561d8a626..41da685895b 100644--- a/tests/vector_store_tests/conftest.py+++ b/tests/vector_store_tests/conftest.py@@ -22,7 +22,6 @@ def setup_and_teardown():0, os.path.abspath("../..")) # Adds the project directory to the system path- import litellmfrom litellm import Routerimportlib.reload(litellm)