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(llms): migrate phase 6 provider unit tests to tests/unit
yunenge1d2789d2965
diff --git a/tests/test_litellm/llms/fal_ai/test_cost_calculator.py b/tests/test_litellm/llms/fal_ai/test_cost_calculator.pydeleted file mode 100644index 419aff42059..00000000000--- a/tests/test_litellm/llms/fal_ai/test_cost_calculator.py+++ /dev/null@@ -1,19 +0,0 @@-import pytest--import litellm-from litellm.litellm_core_utils.llm_cost_calc.utils import CostCalculatorUtils-from litellm.llms.fal_ai.cost_calculator import cost_calculator-from litellm.types.utils import ImageObject, ImageResponse--[email protected](autouse=True)-def _use_local_model_cost_map(monkeypatch):- monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")- monkeypatch.setattr(litellm, "model_cost", litellm.get_model_cost_map(url=""))- litellm.get_model_info.cache_clear()- yield- litellm.get_model_info.cache_clear()---def _image_response(num_images: int = 1) -> ImageResponse:- return ImageResponse(data=[ImageObject(url="https://example.com/img.png") for _ in range(num_images)])diff --git a/tests/test_litellm/llms/chatgpt/chat/test_streaming_utils.py b/tests/unit/llms/chatgpt/chat/test_streaming_utils.pysimilarity index 100%rename from tests/test_litellm/llms/chatgpt/chat/test_streaming_utils.pyrename to tests/unit/llms/chatgpt/chat/test_streaming_utils.pydiff --git a/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py b/tests/unit/llms/chatgpt/responses/test_chatgpt_responses_transformation.pysimilarity index 97%rename from tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.pyrename to tests/unit/llms/chatgpt/responses/test_chatgpt_responses_transformation.pyindex 9bf3eec61f9..c01ec312796 100644--- a/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py+++ b/tests/unit/llms/chatgpt/responses/test_chatgpt_responses_transformation.py@@ -19,6 +19,15 @@ from litellm.types.utils import LlmProvidersfrom litellm.utils import ProviderConfigManager+def local_model_cost_map(monkeypatch):+ monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")+ monkeypatch.setattr(litellm, "model_cost", litellm.get_model_cost_map(url=""))+ litellm.get_model_info.cache_clear()+ yield+ litellm.get_model_info.cache_clear()++class TestChatGPTResponsesAPITransformation:@pytest.mark.parametrize("model_name",diff --git a/tests/test_litellm/llms/cloudflare/test_cloudflare_transformation.py b/tests/unit/llms/cloudflare/test_cloudflare_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/cloudflare/test_cloudflare_transformation.pyrename to tests/unit/llms/cloudflare/test_cloudflare_transformation.pydiff --git a/tests/test_litellm/llms/cohere/chat/test_cohere_transformation.py b/tests/unit/llms/cohere/chat/test_cohere_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/cohere/chat/test_cohere_transformation.pyrename to tests/unit/llms/cohere/chat/test_cohere_transformation.pydiff --git a/tests/test_litellm/llms/cohere/embed/test_v1_transformation.py b/tests/unit/llms/cohere/embed/test_v1_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/cohere/embed/test_v1_transformation.pyrename to tests/unit/llms/cohere/embed/test_v1_transformation.pydiff --git a/tests/test_litellm/llms/cohere/ocr/test_cohere_parse_transformation.py b/tests/unit/llms/cohere/ocr/test_cohere_parse_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/cohere/ocr/test_cohere_parse_transformation.pyrename to tests/unit/llms/cohere/ocr/test_cohere_parse_transformation.pydiff --git a/tests/test_litellm/llms/cohere/rerank/test_rerank_guardrail_handler.py b/tests/unit/llms/cohere/rerank/test_rerank_guardrail_handler.pysimilarity index 100%rename from tests/test_litellm/llms/cohere/rerank/test_rerank_guardrail_handler.pyrename to tests/unit/llms/cohere/rerank/test_rerank_guardrail_handler.pydiff --git a/tests/test_litellm/llms/crusoe/test_crusoe.py b/tests/unit/llms/crusoe/test_crusoe.pysimilarity index 100%rename from tests/test_litellm/llms/crusoe/test_crusoe.pyrename to tests/unit/llms/crusoe/test_crusoe.pydiff --git a/tests/test_litellm/llms/databricks/chat/test_databricks_chat_transformation.py b/tests/unit/llms/databricks/chat/test_databricks_chat_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/databricks/chat/test_databricks_chat_transformation.pyrename to tests/unit/llms/databricks/chat/test_databricks_chat_transformation.pydiff --git a/tests/test_litellm/llms/databricks/responses/test_databricks_responses_transformation.py b/tests/unit/llms/databricks/responses/test_databricks_responses_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/databricks/responses/test_databricks_responses_transformation.pyrename to tests/unit/llms/databricks/responses/test_databricks_responses_transformation.pydiff --git a/tests/test_litellm/llms/datarobot/chat/test_datarobot_chat_transformation.py b/tests/unit/llms/datarobot/chat/test_datarobot_chat_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/datarobot/chat/test_datarobot_chat_transformation.pyrename to tests/unit/llms/datarobot/chat/test_datarobot_chat_transformation.pydiff --git a/tests/test_litellm/llms/datarobot/test_datarobot.py b/tests/unit/llms/datarobot/test_datarobot.pysimilarity index 75%rename from tests/test_litellm/llms/datarobot/test_datarobot.pyrename to tests/unit/llms/datarobot/test_datarobot.pyindex d9f42960601..c98faf0151e 100644--- a/tests/test_litellm/llms/datarobot/test_datarobot.py+++ b/tests/unit/llms/datarobot/test_datarobot.py@@ -78,27 +78,3 @@ def test_completion_datarobot_with_deployment():except Exception as e:pytest.fail(f"Error occurred: {e}")--def test_completion_datarobot_with_environment_variables():- """Allow the test to run with environment variables if they are set for integrations."""- # If keys are not set, the test will be skipped- if os.environ.get("DATAROBOT_API_TOKEN") is None:- return-- messages = [- {"role": "user", "content": "What's the weather like in San Francisco?"}- ]- try:- response = completion(- model="datarobot/vertex_ai/gemini-1.5-flash-002",- messages=messages,- max_tokens=5,- clientId="custom-model",- )- print(response)- assert response["object"] == "chat.completion"- assert response["model"] == "gemini-1.5-flash-002"- assert len(response["choices"]) == 1- assert len(response["choices"][0]["message"]["content"]) > 0- except Exception as e:- pytest.fail(f"Error occurred: {e}")diff --git a/tests/test_litellm/llms/deepseek/chat/test_deepseek_chat_transformation.py b/tests/unit/llms/deepseek/chat/test_deepseek_chat_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/deepseek/chat/test_deepseek_chat_transformation.pyrename to tests/unit/llms/deepseek/chat/test_deepseek_chat_transformation.pydiff --git a/tests/test_litellm/llms/deepseek/messages/test_deepseek_anthropic_messages_transformation.py b/tests/unit/llms/deepseek/messages/test_deepseek_anthropic_messages_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/deepseek/messages/test_deepseek_anthropic_messages_transformation.pyrename to tests/unit/llms/deepseek/messages/test_deepseek_anthropic_messages_transformation.pydiff --git a/tests/test_litellm/llms/deepseek/test_deepseek_cost_calculator.py b/tests/unit/llms/deepseek/test_deepseek_cost_calculator.pysimilarity index 91%rename from tests/test_litellm/llms/deepseek/test_deepseek_cost_calculator.pyrename to tests/unit/llms/deepseek/test_deepseek_cost_calculator.pyindex c3a4cdad0ac..cde4a8a4244 100644--- a/tests/test_litellm/llms/deepseek/test_deepseek_cost_calculator.py+++ b/tests/unit/llms/deepseek/test_deepseek_cost_calculator.py@@ -7,6 +7,16 @@ import litellmfrom litellm._internal_context import pinned_billing_timefrom litellm.types.utils import ModelResponse, PromptTokensDetailsWrapper, Usage++def local_model_cost_map(monkeypatch):+ monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")+ monkeypatch.setattr(litellm, "model_cost", litellm.get_model_cost_map(url=""))+ litellm.get_model_info.cache_clear()+ yield+ litellm.get_model_info.cache_clear()++PEAK_MOMENTS: Final = (pytest.param(datetime(2026, 9, 22, 8, 0, tzinfo=timezone.utc), id="tuesday-08:00"),pytest.param(datetime(2026, 9, 25, 9, 59, tzinfo=timezone.utc), id="friday-09:59"),diff --git a/tests/test_litellm/llms/docker_model_runner/test_docker_model_runner_chat_transformation.py b/tests/unit/llms/docker_model_runner/test_docker_model_runner_chat_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/docker_model_runner/test_docker_model_runner_chat_transformation.pyrename to tests/unit/llms/docker_model_runner/test_docker_model_runner_chat_transformation.pydiff --git a/tests/test_litellm/llms/elevenlabs/test_elevenlabs_text_to_speech_transformation.py b/tests/unit/llms/elevenlabs/test_elevenlabs_text_to_speech_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/elevenlabs/test_elevenlabs_text_to_speech_transformation.pyrename to tests/unit/llms/elevenlabs/test_elevenlabs_text_to_speech_transformation.pydiff --git a/tests/test_litellm/llms/fastcrw/search/test_transformation.py b/tests/unit/llms/fastcrw/search/test_transformation.pysimilarity index 100%rename from tests/test_litellm/llms/fastcrw/search/test_transformation.pyrename to tests/unit/llms/fastcrw/search/test_transformation.py