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_ai): route only cohere parse deployment names to Cohere Parse

mateo-berrid3a179f98871
diff --git a/litellm/llms/azure_ai/ocr/common_utils.py b/litellm/llms/azure_ai/ocr/common_utils.py
index a4cd0c7a30b..2ca2ad9ec2f 100644
--- a/litellm/llms/azure_ai/ocr/common_utils.py
+++ b/litellm/llms/azure_ai/ocr/common_utils.py
@@ -25,7 +25,8 @@ def is_azure_document_intelligence_model(model: str) -> bool:
def is_azure_cohere_parse_model(model: str) -> bool:
- return "parse" in model.lower()
+ lowered: Final = model.lower()
+ return "cohere" in lowered and "parse" in lowered
def get_azure_ai_ocr_config(model: str) -> Optional["BaseOCRConfig"]:
diff --git a/tests/test_litellm/llms/azure_ai/ocr/test_azure_ai_cohere_parse_transformation.py b/tests/test_litellm/llms/azure_ai/ocr/test_azure_ai_cohere_parse_transformation.py
index 01e1f59184c..8c4dd25aa77 100644
--- a/tests/test_litellm/llms/azure_ai/ocr/test_azure_ai_cohere_parse_transformation.py
+++ b/tests/test_litellm/llms/azure_ai/ocr/test_azure_ai_cohere_parse_transformation.py
@@ -40,7 +40,9 @@ def disable_aiohttp_transport(monkeypatch):
[
("Cohere-parse-v5", AzureAICohereParseConfig),
("cohere-parse-v5", AzureAICohereParseConfig),
- ("parse-v5", AzureAICohereParseConfig),
+ ("cohere/parse-v5", AzureAICohereParseConfig),
+ ("invoice-parser", AzureAIOCRConfig),
+ ("parse-v5", AzureAIOCRConfig),
("mistral-ocr-4-0", AzureAIOCRConfig),
("mistral-document-ai-2512", AzureAIOCRConfig),
("doc-intelligence/prebuilt-read", AzureDocumentIntelligenceOCRConfig),