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(utils.py): fix is_azure_openai_model helper function

Krrish Dholakia1e78b3bf5455
diff --git a/litellm/utils.py b/litellm/utils.py
index 4c5fc6fd48e..b157ac456e0 100644
--- a/litellm/utils.py
+++ b/litellm/utils.py
@@ -4491,7 +4491,7 @@ def _is_azure_openai_model(model: str) -> bool:
if (
model in litellm.open_ai_chat_completion_models
or model in litellm.open_ai_text_completion_models
- or litellm.open_ai_embedding_models
+ or model in litellm.open_ai_embedding_models
):
return True
except Exception:
@@ -4630,6 +4630,11 @@ def get_llm_provider(
dynamic_api_key = api_key or get_secret("AZURE_AI_API_KEY")
if _is_azure_openai_model(model=model):
+ verbose_logger.debug(
+ "Model={} is Azure OpenAI model. Setting custom_llm_provider='azure'.".format(
+ model
+ )
+ )
custom_llm_provider = "azure"
elif custom_llm_provider == "github":
api_base = api_base or get_secret("GITHUB_API_BASE") or "https://models.inference.ai.azure.com" # type: ignore