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]

fix(router.py): add new test

Krrish Dholakiac2f01b0fdc9c
diff --git a/tests/local_testing/test_router_utils.py b/tests/local_testing/test_router_utils.py
index a94f5ceca94..bb748d27afa 100644
--- a/tests/local_testing/test_router_utils.py
+++ b/tests/local_testing/test_router_utils.py
@@ -436,3 +436,18 @@ def test_router_get_async_openai_model_client():
deployment=MagicMock(), kwargs={}
)
assert model_client is None
+
+
+def test_router_get_deployment_credentials():
+ router = Router(
+ model_list=[
+ {
+ "model_name": "gemini/*",
+ "litellm_params": {"model": "gemini/*", "api_key": "123"},
+ "model_info": {"id": "1"},
+ }
+ ]
+ )
+ credentials = router.get_deployment_credentials(model_id="1")
+ assert credentials is not None
+ assert credentials["api_key"] == "123"