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]

(azure): Enable stream_options for Azure OpenAI. (#6024) (#6029)

Krish Dholakiaf8d9be130131
diff --git a/litellm/llms/AzureOpenAI/azure.py b/litellm/llms/AzureOpenAI/azure.py
index adf294f74e1..34ba7d7e0e4 100644
--- a/litellm/llms/AzureOpenAI/azure.py
+++ b/litellm/llms/AzureOpenAI/azure.py
@@ -135,6 +135,7 @@ class AzureOpenAIConfig:
"temperature",
"n",
"stream",
+ "stream_options",
"stop",
"max_tokens",
"max_completion_tokens",
@@ -938,6 +939,7 @@ class AzureChatCompletion(BaseLLM):
model=model,
custom_llm_provider="azure",
logging_obj=logging_obj,
+ stream_options=data.get("stream_options", None),
_response_headers=process_azure_headers(headers),
)
return streamwrapper
@@ -1006,6 +1008,7 @@ class AzureChatCompletion(BaseLLM):
model=model,
custom_llm_provider="azure",
logging_obj=logging_obj,
+ stream_options=data.get("stream_options", None),
_response_headers=headers,
)
return streamwrapper ## DO NOT make this into an async for ... loop, it will yield an async generator, which won't raise errors if the response fails