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(azure): respect DEFAULT_MAX_RETRIES in initialize_azure_sdk_client

Praveena5e7cb8980651
diff --git a/litellm/llms/azure/common_utils.py b/litellm/llms/azure/common_utils.py
index 6cb7d09cec4..f20cc37572b 100644
--- a/litellm/llms/azure/common_utils.py
+++ b/litellm/llms/azure/common_utils.py
@@ -582,7 +582,11 @@ class BaseAzureLLM(BaseOpenAILLM):
if scope is None:
scope = "https://cognitiveservices.azure.com/.default"
- max_retries: Final = litellm_params.get("max_retries")
+ max_retries = litellm_params.get("max_retries")
+ if max_retries is None:
+ from litellm.constants import DEFAULT_MAX_RETRIES
+
+ max_retries = DEFAULT_MAX_RETRIES
timeout: Final = litellm_params.get("timeout")
if not api_key and azure_ad_token_provider is None and tenant_id and client_id and client_secret:
verbose_logger.debug("Using Azure AD Token Provider from Entra ID for Azure Auth")