Skip to content

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]

test: remove redundant tests

Krrish Dholakia3ba683be88bd
diff --git a/tests/local_testing/test_router.py b/tests/local_testing/test_router.py
index 5003499ba9e..20a2f28c958 100644
--- a/tests/local_testing/test_router.py
+++ b/tests/local_testing/test_router.py
@@ -320,91 +320,6 @@ def test_router_order():
assert response._hidden_params["model_id"] == "1"
[email protected]("num_retries", [None, 2])
[email protected]("max_retries", [None, 4])
-def test_router_num_retries_init(num_retries, max_retries):
- """
- - test when num_retries set v/s not
- - test client value when max retries set v/s not
- """
- router = Router(
- model_list=[
- {
- "model_name": "gpt-3.5-turbo", # openai model name
- "litellm_params": { # params for litellm completion/embedding call
- "model": "azure/chatgpt-v-2",
- "api_key": "bad-key",
- "api_version": os.getenv("AZURE_API_VERSION"),
- "api_base": os.getenv("AZURE_API_BASE"),
- "max_retries": max_retries,
- },
- "model_info": {"id": 12345},
- },
- ],
- num_retries=num_retries,
- )
-
- if num_retries is not None:
- assert router.num_retries == num_retries
- else:
- assert router.num_retries == openai.DEFAULT_MAX_RETRIES
-
- model_client = router._get_client(
- {"model_info": {"id": 12345}}, client_type="async", kwargs={}
- )
-
- if max_retries is not None:
- assert getattr(model_client, "max_retries") == max_retries
- else:
- assert getattr(model_client, "max_retries") == 0
-
-
- "timeout", [10, 1.0, httpx.Timeout(timeout=300.0, connect=20.0)]
-)
[email protected]("ssl_verify", [True, False])
-def test_router_timeout_init(timeout, ssl_verify):
- """
- Allow user to pass httpx.Timeout
-
- related issue - https://github.com/BerriAI/litellm/issues/3162
- """
- litellm.ssl_verify = ssl_verify
-
- router = Router(
- model_list=[
- {
- "model_name": "test-model",
- "litellm_params": {
- "model": "azure/chatgpt-v-2",
- "api_key": os.getenv("AZURE_API_KEY"),
- "api_base": os.getenv("AZURE_API_BASE"),
- "api_version": os.getenv("AZURE_API_VERSION"),
- "timeout": timeout,
- },
- "model_info": {"id": 1234},
- }
- ]
- )
-
- model_client = router._get_client(
- deployment={"model_info": {"id": 1234}}, client_type="sync_client", kwargs={}
- )
-
- assert getattr(model_client, "timeout") == timeout
-
- print(f"vars model_client: {vars(model_client)}")
- http_client = getattr(model_client, "_client")
- print(f"http client: {vars(http_client)}, ssl_Verify={ssl_verify}")
- if ssl_verify == False:
- assert http_client._transport._pool._ssl_context.verify_mode.name == "CERT_NONE"
- else:
- assert (
- http_client._transport._pool._ssl_context.verify_mode.name
- == "CERT_REQUIRED"
- )
-
-
@pytest.mark.parametrize("sync_mode", [False, True])
@pytest.mark.asyncio
async def test_router_retries(sync_mode):