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]

Litellm dev 02 07 2025 p3 (#8387)

Krish Dholakiac83498f0cd87
diff --git a/litellm/llms/openai/chat/o_series_transformation.py b/litellm/llms/openai/chat/o_series_transformation.py
index d643b076802..3cc05b3c955 100644
--- a/litellm/llms/openai/chat/o_series_transformation.py
+++ b/litellm/llms/openai/chat/o_series_transformation.py
@@ -54,7 +54,7 @@ class OpenAIOSeriesConfig(OpenAIGPTConfig):
if model is None:
return True
- supported_stream_models = ["o1-mini", "o1-preview"]
+ supported_stream_models = ["o1-mini", "o1-preview", "o3-mini"]
for supported_model in supported_stream_models:
if supported_model in model:
return False
diff --git a/tests/llm_translation/test_openai_o1.py b/tests/llm_translation/test_openai_o1.py
index c4eec4ca5f7..16b86414c2f 100644
--- a/tests/llm_translation/test_openai_o1.py
+++ b/tests/llm_translation/test_openai_o1.py
@@ -204,3 +204,26 @@ def test_o3_reasoning_effort():
reasoning_effort="high",
)
assert resp.choices[0].message.content is not None
+
+
+def test_streaming_response():
+ """Test that streaming response is returned correctly"""
+ from litellm import completion
+
+ response = completion(
+ model="o3-mini",
+ messages=[
+ {"role": "system", "content": "Be a good bot!"},
+ {"role": "user", "content": "Hello!"},
+ ],
+ stream=True,
+ )
+
+ assert response is not None
+
+ chunks = []
+ for chunk in response:
+ chunks.append(chunk)
+
+ resp = litellm.stream_chunk_builder(chunks=chunks)
+ print(resp)