docs: clarify thinking controls

This commit is contained in:
ParthSareen
2026-09-16 19:14:29 -07:00
parent 60559c78f3
commit c6b0355795
+12 -14
View File
@@ -29,15 +29,23 @@ The response includes a top-level `thinking` object:
}
```
The `values` array can contain booleans (`true` or `false`) for on/off controls or model-defined strings for named levels. The default is used when `think` is not set. A response with `[false]` means the model does not support thinking. If `thinking` is omitted, Ollama has no model-specific metadata and keeps its existing behavior.
- `values` can contain booleans (`true` or `false`) for on/off controls. It can also contain model-defined strings for named levels.
- `default` is used when `think` is not set.
- `values: [false]` means the model does not support thinking.
- If `thinking` is omitted, the model has no thinking metadata. Ollama keeps its existing behavior.
## Enable thinking in API calls
Set the `think` field on chat or generate requests. `think` can be `true`, `false`, `null`, or a model-defined string. Numbers are not supported. Use exact string values from `/api/show` when they are available. `true` requests thinking and `false` requests no thinking output, subject to each model's controls.
Set the `think` field on a chat or generate request:
When a model uses its `/api/show` metadata to resolve named levels, supported names are applied exactly and unsupported names resolve to the model default. GPT-OSS keeps its existing request behavior; use its advertised `low`, `medium`, or `high` values, with `medium` as the default.
- `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.
The `message.thinking` (chat endpoint) or `thinking` (generate endpoint) field contains the reasoning trace while `message.content` / `response` holds the final answer.
If the model resolves named levels from `/api/show` metadata, Ollama applies supported names exactly. Unsupported names use the model default. GPT-OSS supports `low`, `medium`, and `high`, with `medium` as the default.
The reasoning output and answer use separate fields. Chat returns `message.thinking` and `message.content`. Generate returns `thinking` and `response`.
<Tabs>
<Tab title="cURL">
@@ -158,13 +166,3 @@ Thinking streams interleave reasoning tokens before answer tokens. Detect the fi
```
</Tab>
</Tabs>
## CLI quick reference
- Enable thinking for a single run: `ollama run deepseek-r1 --think "Where should I visit in Lisbon?"`
- Disable thinking: `ollama run deepseek-r1 --think=false "Summarize this article"`
- Hide the trace while still using a thinking model: `ollama run deepseek-r1 --hidethinking "Is 9.9 bigger or 9.11?"`
- Inside interactive sessions, toggle with `/set think` or `/set nothink`.
- Set a level for GPT-OSS: `ollama run gpt-oss --think=low "Draft a headline"` (replace `low` with `medium` or `high` as needed).
<Note>Thinking defaults are model-specific. Use `/api/show` to see the supported values and default when a model exposes metadata. For thinking-capable local models, `ollama show` also lists the available values and default.</Note>