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 fixes

Ishaan Jaffer723203977988
diff --git a/tests/llm_translation/test_azure_openai.py b/tests/llm_translation/test_azure_openai.py
index 970e68e478b..09097c6b27d 100644
--- a/tests/llm_translation/test_azure_openai.py
+++ b/tests/llm_translation/test_azure_openai.py
@@ -123,6 +123,9 @@ import os
def test_azure_extra_headers(input, call_type, header_value):
from litellm import embedding, image_generation
+ # Clear the LLM clients cache to ensure the new http_client is used
+ litellm.in_memory_llm_clients_cache.flush_cache()
+
http_client = Client()
messages = [{"role": "user", "content": "Hello world"}]
@@ -470,8 +473,12 @@ def test_map_openai_params():
def test_azure_max_retries_0(
mock_make_sync_azure_openai_chat_completion_request, max_retries, stream
):
+ import litellm
from litellm import completion
+ # Clear the LLM clients cache to ensure max_retries is set correctly
+ litellm.in_memory_llm_clients_cache.flush_cache()
+
try:
completion(
model="azure/gpt-4.1-mini",
@@ -498,8 +505,12 @@ def test_azure_max_retries_0(
async def test_async_azure_max_retries_0(
make_azure_openai_chat_completion_request, max_retries, stream
):
+ import litellm
from litellm import acompletion
+ # Clear the LLM clients cache to ensure max_retries is set correctly
+ litellm.in_memory_llm_clients_cache.flush_cache()
+
try:
await acompletion(
model="azure/gpt-4.1-mini",
@@ -527,8 +538,12 @@ async def test_async_azure_max_retries_0(
async def test_azure_instruct(
mock_select_azure_base_url_or_endpoint, max_retries, stream, sync_mode
):
+ import litellm
from litellm import completion, acompletion
+ # Clear the LLM clients cache to ensure select_azure_base_url_or_endpoint is called
+ litellm.in_memory_llm_clients_cache.flush_cache()
+
args = {
"model": "azure_text/instruct-model",
"messages": [
@@ -562,8 +577,12 @@ async def test_azure_instruct(
async def test_azure_embedding_max_retries_0(
mock_select_azure_base_url_or_endpoint, max_retries, sync_mode
):
+ import litellm
from litellm import aembedding, embedding
+ # Clear the LLM clients cache to ensure select_azure_base_url_or_endpoint is called
+ litellm.in_memory_llm_clients_cache.flush_cache()
+
args = {
"model": "azure/text-embedding-ada-002",
"input": "Hello world",