From 656dce92d01b7309dd916325d23580449e5719e7 Mon Sep 17 00:00:00 2001 From: Cesar Garcia <128240629+Chesars@users.noreply.github.com> Date: Mon, 10 Nov 2025 22:16:17 -0300 Subject: [PATCH] docs: fix streaming example in README (#16461) * docs: add messages variable definition in streaming example - Add missing messages variable in streaming code example - Makes the example complete and runnable without modifications * docs: capitalize LiteLLM in streaming section * docs: add gpt-4o comment --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6dcebfbd3d9..59034164702 100644 --- a/README.md +++ b/README.md @@ -132,11 +132,15 @@ print(response) ## Streaming ([Docs](https://docs.litellm.ai/docs/completion/stream)) -liteLLM supports streaming the model response back, pass `stream=True` to get a streaming iterator in response. +LiteLLM supports streaming the model response back, pass `stream=True` to get a streaming iterator in response. Streaming is supported for all models (Bedrock, Huggingface, TogetherAI, Azure, OpenAI, etc.) ```python from litellm import completion + +messages = [{"content": "Hello, how are you?", "role": "user"}] + +# gpt-4o response = completion(model="openai/gpt-4o", messages=messages, stream=True) for part in response: print(part.choices[0].delta.content or "")