thinking field that separates their reasoning trace from the final answer.
Use this capability to audit model steps, animate the model thinking in a UI, or hide the trace entirely when you only need the final response.
See the full list of thinking models.
Discover a model’s thinking controls
Thinking controls vary by model. Use/api/show to discover the values a model supports and the value Ollama uses by default:
thinking object:
valuescan contain booleans (trueorfalse) for on/off controls. It can also contain model-defined strings for named levels.defaultis used whenthinkis not set.values: [false]means the model does not support thinking.- If
thinkingis omitted, the model has no thinking metadata. The model might conduct thinking based on its existing behavior.
Enable thinking in API calls
Set thethink field on a chat or generate request:
true: request thinking output.false: request no thinking output, if the model permits it.null: use the model default.- A string: select a supported level from
thinking.values. Use the exact value from/api/show. Numbers are not supported.
/api/show metadata, Ollama applies supported names exactly. Unsupported names use the model default.
The reasoning output and answer use separate fields. Chat returns message.thinking and message.content. Generate returns thinking and response.
- cURL
- Python
- JavaScript
Stream the reasoning trace
Thinking streams interleave reasoning tokens before answer tokens. Detect the firstthinking chunk to render a “thinking” section, then switch to the final reply once message.content arrives.
- Python
- JavaScript

