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_completion_azure_ai_gpt_4o_with_flexible_api_base

Ishaan Jaffer74106589d011
diff --git a/tests/llm_translation/test_azure_ai.py b/tests/llm_translation/test_azure_ai.py
index 6a5bd2dcf94..94d02ef9bca 100644
--- a/tests/llm_translation/test_azure_ai.py
+++ b/tests/llm_translation/test_azure_ai.py
@@ -340,3 +340,28 @@ def test_completion_azure():
print("Cost for azure completion request", cost)
except Exception as e:
pytest.fail(f"Error occurred: {e}")
+
+
+ "api_base",
+ [
+ "https://ci-cd-foundry.cognitiveservices.azure.com/",
+ "https://ci-cd-foundry.cognitiveservices.azure.com/openai/deployments/gpt-4.1-mini/chat/completions?api-version=2023-03-15-preview",
+ ],
+)
+def test_completion_azure_ai_gpt_4o_with_flexible_api_base(api_base):
+ try:
+ litellm.set_verbose = True
+
+ response = completion(
+ model="azure_ai/gpt-4.1-mini",
+ api_base=api_base,
+ api_key=os.getenv("AZURE_API_KEY"),
+ messages=[{"role": "user", "content": "What is the meaning of life?"}],
+ )
+
+ print(response)
+ except litellm.Timeout as e:
+ pass
+ except Exception as e:
+ pytest.fail(f"Error occurred: {e}")
\ No newline at end of file
diff --git a/tests/local_testing/test_completion.py b/tests/local_testing/test_completion.py
index 9c6060c979c..8f6b19c83cd 100644
--- a/tests/local_testing/test_completion.py
+++ b/tests/local_testing/test_completion.py
@@ -132,49 +132,6 @@ def test_null_role_response():
assert response.choices[0].message.role == "assistant"
[email protected](reason="Cohere having RBAC issues")
-def test_completion_azure_command_r():
- try:
- litellm._turn_on_debug()
-
- response = completion(
- model="azure/command-r-plus",
- api_base="https://Cohere-command-r-plus-gylpd-serverless.eastus2.inference.ai.azure.com",
- api_key="AO89xyvmOLLMgoMI7WaiEaP0t6M09itr",
- messages=[{"role": "user", "content": "What is the meaning of life?"}],
- )
-
- print(response)
- except litellm.Timeout as e:
- pass
- except Exception as e:
- pytest.fail(f"Error occurred: {e}")
-
-
- "api_base",
- [
- "https://litellm8397336933.openai.azure.com",
- "https://litellm8397336933.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2023-03-15-preview",
- ],
-)
-def test_completion_azure_ai_gpt_4o(api_base):
- try:
- litellm.set_verbose = True
-
- response = completion(
- model="azure_ai/gpt-4o",
- api_base=api_base,
- api_key=os.getenv("AZURE_AI_OPENAI_KEY"),
- messages=[{"role": "user", "content": "What is the meaning of life?"}],
- )
-
- print(response)
- except litellm.Timeout as e:
- pass
- except Exception as e:
- pytest.fail(f"Error occurred: {e}")
-
def predibase_mock_post(url, data=None, json=None, headers=None, timeout=None):
mock_response = MagicMock()