Learning resourcesReviewed · Ollama

Ollama Streaming Guide

Ollama's Streaming guide is a short reference for developers building AI chat interfaces, but its conversation-history examples need correction. It explains incremental text, thinking fields and tool calls, with Python and JavaScript examples and different streaming defaults for REST and SDKs.

Researched 15 Nov 2026

In short.

Ollama's Streaming guide is a practical introduction for developers displaying AI responses as they arrive, but its sample conversation-history code contains defects. It documents REST and SDK defaults and demonstrates accumulating thinking and answer text. Tool execution and follow-up requests are described without a complete implementation. No code was executed, and compatibility, performance and costs remain unassessed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete selected page at [https://docs.ollama.com/capabilities/streaming.md], including its streaming defaults, concepts, history note and both code examples. The introductory notice points to [https://docs.ollama.com/llms.txt]; that index and all linked pages are excluded. No code was executed. Installation, model compatibility, actual streamed responses, follow-up conversations, tool execution, performance and operating costs remain unverified.

The overview

identity

Streaming is an Ollama documentation page at [https://docs.ollama.com/capabilities/streaming.md]. The resource is a feature guide covering incremental model responses, with Python and JavaScript examples.

assessment

The guide is useful for understanding which streamed fields an application must display and retain. Its strongest practical point is that rendering chunks is only part of the work: accumulated fields must also support subsequent conversation turns.

Treat the examples as material to adapt carefully. Their history-building statements need correction, and neither demonstrates a complete follow-up conversation or tool execution cycle.

users

The guide suits developers adding incremental output to chat interfaces, separating thinking text from answers, or planning streamed tool integrations. Python developers receive a synchronous iteration example; JavaScript developers receive an asynchronous iteration example.

Beginners can learn the basic pattern, but the page assumes familiarity with package imports, model requests and conversation messages. It does not supply a first-time installation walkthrough.

capabilities

The page describes three streaming concerns: partial assistant content, a thinking field from models that support it, and tool_calls that an application must execute and answer through conversation history.

It states that REST streaming is enabled by default, while SDK streaming is disabled by default. Both examples explicitly enable streaming and accumulate thinking and content into separate strings. Streamed tool handling is described but not implemented.

Using it

requirements

The imports and requests imply a Python or JavaScript environment, the corresponding ollama package, and access through Ollama to the named qwen3 model. Showing thinking text requires a model that emits the thinking field.

Package versions, model provisioning, service configuration, operating-system support and hardware requirements are not specified.

mechanism

A streaming chat call provides chunks that the application consumes in a loop. The examples print incoming thinking or answer text immediately and concatenate it into buffers so the complete text remains available afterward.

For continued conversations, the page says to retain accumulated fields, including tool calls and executed tool results where applicable. It does not provide a complete tool-message schema or a subsequent request demonstrating that history.

setup

The Python example imports chat from ollama and passes stream=True. The JavaScript example imports ollama and passes stream: true to ollama.chat. Both select qwen3 and provide one user message.

These are request-level instructions. Installation, connection setup and model acquisition are absent, so the page alone does not establish a complete working environment.

example

Both examples ask qwen3 to calculate 17 × 23. They use an in_thinking or inThinking flag to label thinking output and then switch to an answer label when content appears.

Python flushes printed fragments; JavaScript writes fragments through process.stdout.write. The page supplies no captured response, timing measurement or successful execution result.

Assessment & evidence

limitations

In the Python history statement, role is an undefined name in the shown script, while thinking and content are variable expressions used as dictionary keys. Those keys should be literal field names. This is a visible code defect, not an observed execution result.

The JavaScript example assigns new_messages without declaring it. Its import statement makes the snippet an ES module, where that undeclared assignment would fail if reached. Neither example actually appends the constructed assistant message to the original conversation and sends another request.

Both examples use mutually exclusive thinking and content branches. If a chunk contains both nonempty fields, its content would be skipped. Tool-call accumulation, cancellation and recovery from interrupted streams are not demonstrated.

reasoning

Displaying chunks allows an interface to present available text before the full response is complete. That explains the guide's practical value, but the page provides no evidence of faster model generation or measured latency improvements.

The thinking field is presented as a separate output an interface can show or hide. The examples illustrate its display and accumulation; they do not establish thinking support across models or any improvement in answer quality.

alternatives

Within the page, REST and SDK access are alternative routes, and Python and JavaScript provide language-specific examples. For applications that do not need incremental output, the documented SDK default leaves streaming disabled.

No competing libraries, services or tutorials are compared. Their relative suitability is unknown from this page.

evidence

The evidence is the complete captured page at [https://docs.ollama.com/capabilities/streaming.md], retained as selected-page.txt. Its source SHA-256 is 776a8c05db03d802fdb706fad10caa669b1728ed44c4097c142d3c0a54f7a3e3.

Findings about defaults and field handling come from the page's prose; findings about example defects come from static inspection of the supplied snippets. No code was executed, and runtime behavior was not verified.

Access & freshness

costs

The page provides no prices, usage charges, hosting estimates or hardware-cost information. The cost of following the examples or operating an application with this approach is unknown; no free-use claim is established.

rights

The supplied page contains no explicit licence or redistribution permission for its text or examples. Documentation, SDK and model usage rights are not established by this evidence.

freshness

The supplied snapshot was captured on 2026-11-15 at 16:34:18.141 UTC. That timestamp identifies the snapshot, not the page's publication or last-update date.

The page names no Ollama or SDK release versions. Compatibility with particular installed releases and changes after capture are unknown.

actions

Before adapting the examples, correct Python's dictionary keys and declare the JavaScript history variable. Preserve the original conversation and append the completed assistant message before making a follow-up request.

Handle thinking and content independently when both may occur. If adding tools, implement accumulation of tool calls and the return of tool results. Verify these paths with the intended model and SDK versions; this page supplies no execution evidence for them.

Evidence for this report

selected-page.txtselected · checked 2026-11-15