Controlling thinking models in Ollama for predictable latency and cost
The think field in an Ollama request controls whether a reasoning model produces a thinking trace before its answer, and at what depth where the model supports it. Thinking behavior varies by model, so a setting that works for one model may not apply to another. Ollama's Thinking documentation describes thinking-capable models returning the reasoning in a separate thinking field, with /api/show reporting the thinking values each model supports and its default, and requests setting think to change that behavior. A team that has put a reasoning model on a self-hosted server needs this control when answers must be predictable, when response times must fit an interactive workflow, or when token use must stay within a planned budget. Reasoning tokens consume generation time and capacity, so the default that suits a chat prototype may not suit a batch job or a shared server.
Before writing application code, check each model you plan to run. Call /api/show for the model name and record the thinking values it reports and its default, then test requests with the think field set to each value you intend to allow. Confirm the response shape too: the reasoning should arrive in the separate thinking field, so your client must read the answer from its own field and not from the combined output. Keep the results in your model inventory, because a model update or a different quantized build can change the supported values. Also record the default for each model, since requests that omit think will use it.
The local API at localhost:11434 does not require authentication, so anyone who can reach the server can send requests that set or omit think. Controlling thinking is a model behavior decision, while access control is a separate decision that belongs to your network design and the proxy or gateway in front of the server. Confirm with your own tests how much latency and token use changes under each setting on your hardware, and decide which values applications may send before the server is shared with users.
How to discover each model's thinking controls
Before a team commits to a reasoning model, it should confirm which thinking values that model accepts and which one applies when the request leaves the setting out. Ollama's Thinking documentation describes the /api/show endpoint as the place where a model reports the thinking values it supports and its default. Run the check against the exact model tag your team plans to use, since a different tag or quantization can change the answer. The outcome of this check should be a short written record, not a memory of what the model did in a demo.
- Query the exact tag: Send a request to
/api/showon the server that will host the model, using the full name with its tag, so the answer reflects the artifact you will run. - Note the supported values: Record every thinking value the response lists for that model, so the application knows which settings are valid.
- Note the default: Record the default behavior, because a request that omits the
thinkfield will use it. - Test one request: Confirm the separate thinking output appears when expected and check the latency and token counts on a representative prompt.
- Set the owner: Name the person who re-runs this check when a model is updated.
Before approval, confirm the exact response field names and value formats against the Thinking documentation, because this page does not list them.
An application that accepts several models should not hard-code thinking behavior for one of them. Instead, the client should read each model's supported values at startup or when a model is first selected, then choose a request setting the model accepts. This keeps the application working when the team adds a model that handles thinking differently, and it avoids sending a value that the model rejects or ignores. The client should treat the lookup as configuration, not as a per-request guess.
- Cache the lookup: Store the supported values and default per model in the client's configuration or in a small cache, and refresh it when the model tag changes.
- Map a team policy to supported values: Translate an internal setting such as fast or deep into a value the specific model accepts, and fall back to the model default when no match exists.
- Separate the trace from the answer: Read the thinking field and the answer field separately, so the interface can hide or log reasoning without altering the final text.
- Handle missing support: Treat a model without thinking controls as a normal model, with no thinking field expected.
- Log the applied setting: Record which value was sent with each request, so later latency or cost questions can be traced.
Test the client with every model in the catalog before release, and confirm the lookup behavior against the Thinking documentation for your Ollama version.
A shared model catalog drifts when models are pulled, replaced or updated without anyone recording their thinking behavior. An audit compares what the catalog says with what each model's /api/show response reports on the running server. The audit is most useful when it runs on the same Ollama version and hardware that users reach, because the catalog should describe the deployed service, not a developer laptop. Results should feed the catalog owner's change process, so the record stays current.
- Inventory the models: List every model the server exposes and match each entry to a catalog record.
- Compare supported values: Flag any model whose recorded values differ from the live response, and any model with no record.
- Check defaults: Confirm the recorded default still matches, since a changed default can shift latency and token use for existing applications.
- Review custom models: Re-check imported or customized models, because their behavior depends on how they were packaged.
- Schedule re-checks: Re-run the audit after Ollama upgrades and after any model is added, replaced or updated.
Keep the audit evidence with the catalog, and confirm the expected response format against the Thinking documentation before writing audit scripts.
Setting the think field in a request
This sequence confirms the Ollama version, reads each model's thinking controls from the server, sends a test request with an explicit think value, and checks that the reasoning trace and the answer arrive as separate fields. The result is a verified request pattern your applications can reuse.
Confirm the Ollama version in use
The platform engineer checks the installed version on the Ollama server and compares it with the release notes in the Ollama GitHub releases page. Newer releases can change how thinking is reported, so record the exact version before testing. Run the version command on the server and note the output in the change record. The step is complete when the version is written down and you have confirmed it is a release your team has approved for use. Later steps assume this version stays fixed.
Query the model's thinking controls
Send a request to the local API on 127.0.0.1 port 11434 to the /api/show endpoint with the model name, then read the response. The response lists the thinking values the model supports and its default setting. Record both in your configuration notes, because the supported list differs between models and a value outside it can be rejected or ignored. The step is complete when you have a written list of supported values and the default for this exact model tag.
Choose the think value for the workload
Select a think value from the supported list that matches the workload. Interactive chat may need a visible reasoning trace, while batch extraction may need the answer alone with lower latency and fewer generated tokens. Document the choice together with the reason, since the same model can behave differently under another value. The step is complete when the chosen value is written into the application's request settings or the team's standard configuration, and the team can state why it was selected.
Send a test request with think set
Send a test request to the local API with the think field set to the chosen value and a prompt that has a known correct answer. Use the chat or generate endpoint on port 11434 and keep the prompt and model tag in a saved file so the test can be repeated. Note the response time and the response size. The step is complete when the request returns a successful response without errors, and the output matches the expected answer.
Check the default when think is omitted
Repeat the same prompt with the think field left out of the request. Compare the result with the earlier test to confirm what the model does by default. This check matters because applications built before the setting was added will fall back to that default, so you need to know whether they will produce a reasoning trace. The step is complete when you have recorded whether the reasoning trace appears without the field and whether the answer content differs.
Confirm separate thinking and answer fields
Inspect the raw response and confirm that the reasoning text sits in its own thinking field and the final answer sits in the content field. Your client code should read the answer field for the user-facing reply and handle the thinking field separately, such as logging it only when your policy allows. Check that the answer contains no reasoning text. The step is complete when a sample response, with sensitive content removed, shows the two parts in separate fields.
Record the verified settings
Save the Ollama version, the model tag, the supported think values, the chosen value, the default behavior and the sample response structure in your configuration repository. Assign an owner who will repeat the test after any Ollama upgrade or model change. The step is complete when the record is stored with the application's deployment configuration and a reviewer has signed off on it.
Separating the reasoning trace from the answer in client code
The main design benefit of a thinking-capable model on Ollama is that the reasoning trace arrives in its own thinking field, separate from the final answer in the content field. Client code can therefore decide what happens to each part on its own: display the answer to users, keep the trace for debugging, or discard it entirely. Make that decision before writing the first handler, because it determines what your application stores. For each use case, decide whether users see the trace at all (most product interfaces should show only the answer, with an optional expandable view for internal reviewers), whether auditors need the trace retained, and for how long. Retention is a policy question for your compliance and legal teams, not a default the client library makes for you.
Logging is where the risk sits. A reasoning trace often restates or paraphrases the user's input, retrieved documents and system instructions, so it can contain personal data, credentials pasted by mistake or confidential business content even when the final answer is clean. Treat the thinking field as sensitive input data, apply the same redaction, access control and retention rules you apply to prompts, and keep it out of general application logs, error trackers and analytics pipelines unless you have decided otherwise. Confirm how your logging middleware captures responses, since a generic response logger will record the trace by default. Also confirm how your choice of think setting interacts with what the model returns, so your storage rules match what actually arrives.
The native API, the Python and JavaScript SDKs, and the OpenAI-compatible endpoint do not necessarily expose the thinking data in the same way. An application that reads the thinking field through the native API may find that a wrapper library, an OpenAI-style client or a proxy in front of Ollama drops it, renames it or merges it into the answer text. This can leak reasoning into user-visible output or silently remove the audit record you planned to keep. Test each client path you use with each model you have approved: send a prompt that should produce a visible trace, inspect the raw response, and confirm that the answer and trace land in the places your policy specifies. Repeat the test whenever you change a client library, a gateway or the Ollama version, and record the results with your model approval evidence.
Which thinking setting fits which workload
This table compares four ways to set thinking on an Ollama model: the model default, an explicit think value per request, thinking turned off, and thinking turned on. Read each row for its latency and token trade-off and the measurement to take before you commit. The main takeaway is that the default is rarely the right setting for every workload, so test each task class separately.
| Configuration | Latency and token trade-off | Measure before choosing |
|---|---|---|
| Model default | Behavior follows whatever default the model reports through /api/show, so cost and speed can change when the model changes. | Confirm the reported default for each model version you run and record its latency on your own prompts. |
| think set per request | Each call states its own setting, so one server can serve different tasks with different costs. | Check that every client sends the field and that the reasoning trace is handled as intended in the response. |
| Thinking off for latency-sensitive or high-volume tasks | Responses usually arrive sooner and use fewer generated tokens, which keeps throughput higher under concurrency, but multi-step accuracy may drop. | Compare answer quality on a labeled sample and time-to-first-token under your expected parallel load. |
| Thinking on for analysis or multi-step tasks | Reasoning traces add generated tokens and wait time, which raises per-request cost and can fill queues sooner, but improves results on harder problems. | Measure accuracy gains against extra tokens and latency, and confirm queue limits such as OLLAMA_MAX_QUEUE still fit peak demand. |
| Mixed workloads on one server | A single shared model with per-request settings keeps operations simple but makes capacity planning depend on the mix of calls. | Log the think value and token counts per route so you can size concurrency for the real traffic pattern. |
What thinking adds to latency and token cost
Thinking tokens are generated output, so they cost time and compute on every request that uses them. The cards below cover where that cost lands on a self-hosted Ollama server, and what to measure before a reasoning model goes into a shared rollout.
Thinking tokens use local compute
Running a model on your own hardware is unlimited in licensing terms, according to Ollama's pricing page, but that does not make thinking free. Every reasoning token is generated on the same GPU or CPU that serves answers, so a model that thinks at length occupies the hardware for longer. Check the generation speed of each model on your target hardware before you set a default for thinking.
- Local model runs
- Unlimited
Concurrency limits stack response times
By default Ollama handles 1 parallel request per model, and up to 512 requests wait in the queue. A reasoning request that runs for a long time blocks its slot, so later requests wait behind it. Set OLLAMA_NUM_PARALLEL and OLLAMA_MAX_QUEUE with the slowest expected thinking request in mind, and test with several users at once.
Longer outputs raise memory pressure
The reasoning trace and the final answer both occupy the context and the output buffer while the response is generated. Long traces can push a model toward the memory limits of its hardware, especially when several models stay loaded. Watch memory use under realistic thinking lengths, not only under short test prompts.
Cloud plans change the cost model
Local runs have no per-token charge, while cloud models are billed through paid plans. Ollama's cloud plans include Pro, Max, Team and Enterprise tiers, and the Enterprise tier adds cost budgets per user or API key. Ask any cloud provider how thinking tokens are counted and billed, because a reasoning trace can multiply the output tokens of a single request.
Ollama pricingContext length and reasoning share a budget
The context window must hold the prompt, the reasoning trace and the answer together. If thinking consumes much of the window, the answer can be cut short or the model can lose earlier instructions. Set the context length deliberately for reasoning workloads, and confirm the allocated context on the running model before you measure results.
Measure each workload before rollout
Thinking cost depends on the model, the task, the hardware and the concurrency settings, so no general figure replaces a test. Run representative prompts with thinking on and off, and record time to first token, total response time, generated tokens and memory use. Use those results to decide which workloads get thinking enabled and which do not.
Questions teams ask before controlling thinking in production
Can thinking be controlled on every Ollama model?
No. Whether you can control thinking depends on what each model reports. Call /api/show for the model and read the thinking values it supports and its default. Some models expose a set of levels, some accept only on or off, and some do not support a setting at all. Build your settings from that reported list for each model in your inventory, not from a general assumption about reasoning models. Re-check after you pull a new model tag or change a Modelfile, because the reported values belong to the specific model build you run. The Ollama thinking documentation describes how the think field maps to these values.
How much effort does controlling thinking take for one team?
The effort depends on how many models you run, how many applications call them, and how much testing each change needs. For one model used by one application, the work is mostly reading the reported values, setting the think field in the client, and checking that the separated reasoning and answer fields behave as expected. Effort grows with each additional model, each client with its own parsing code, and each downstream system that stores or displays the reasoning trace. Ask any partner to size the work from a written inventory of models, applications and test prompts, and to state what is included in a fixed scope.
Can an internal team handle this without outside help?
Often yes, if the team already runs Ollama and has engineers who can read API responses and write client tests. The skills involved are REST calls to port 11434, parsing the thinking field separately from the answer, and building a regression test set. Outside help tends to be useful when several teams share one server, when reasoning traces contain sensitive content that needs handling rules, or when the organization needs documented evidence for a compliance review. DeployOpen plans, implements and documents this work in infrastructure you control, and fixed-scope engagements agree deliverables in writing before work starts.
What does thinking add to cost and latency?
Thinking adds compute and response time. The model generates reasoning tokens before the answer, so each request occupies the GPU or CPU for longer and can hold capacity that other users need. Latency rises with the length of the reasoning trace, and token-based costs rise too when the model is served from cloud infrastructure. Running models on your own hardware carries no per-use fee from Ollama, since Ollama's pricing page states that local model use is unlimited. For cloud models, the Enterprise plan adds cost budgets per user or API key, which can cap spending. Measure your own latency and token use with representative prompts before setting a policy, because the increase depends on the model and the task.
What does the work need from our organization?
You need to provide a few things before work starts:
- A model inventory listing each model, its tag, and the applications that call it.
- A set of representative test prompts, covering the tasks where reasoning matters and the tasks where it should stay off.
- A named owner for each application and for the handling of reasoning traces, including who may read them, how long they are kept, and whether they are logged.
- Access to a test Ollama server that matches production versions and hardware.
Without the trace owner, teams often store reasoning text by default, which may conflict with your data rules. Confirm the requirements with your security and privacy leads early.
What should we do when a model ignores the thinking setting?
First, confirm the request is valid for that model by checking the values /api/show reports, since a value the model does not list may be ignored. Second, test the same prompt directly against the local API on port 11434 to rule out a client library that drops or renames the field. Third, check the server version, because behavior can change between releases. If the model still ignores the setting, treat that as a known limitation: restrict the model to tasks where thinking is not required, change the model, or add a routing rule in your gateway. Record each case in your test set so the same problem is caught after future upgrades.
How do Ollama upgrades affect thinking behavior?
Upgrades can change defaults, parsing, and how a model's reported values are handled, so each upgrade needs a regression check. Ollama publishes frequent releases. Its GitHub releases page lists v0.40.5, released on 14 October 2026, and v0.40.6, published as a pre-release on 16 October 2026. Read the release notes for each version you plan to deploy, then rerun your test prompts against a staging server before changing production. Pin the version you run, and do not assume a pre-release is safe for shared production use. Confirm the exact behavior of each version with Ollama's release notes and your own tests.
Limits to confirm in your environment
Thinking support in Ollama depends on the model, the server version and the client you use, and those three can change independently. The cards below list the points to test before a reasoning model goes into a workflow, so the team confirms behavior with the Thinking docs and its own requests rather than assuming it.
Supported think values per model
Each model reports the thinking values it accepts and its default through /api/show. Do not assume that every reasoning model accepts the same think setting, or that a boolean works where a level is expected. Record the values for each model and version you approve, and add a check to your deployment pipeline so a model swap or server upgrade triggers a re-test. Confirm the current list with the Thinking docs and your own requests.
Behavior across Ollama versions
Thinking controls are a feature that can change between releases, and Ollama ships releases frequently. Pin the server version in your change process, read the release notes for changes to thinking behavior, and rerun your test set before upgrading. Ask whether a setting that works on your current version still works after an upgrade, and do not treat a passing test on one release as a guarantee for the next.
Ollama releasesClient library support for the thinking field
Your application needs a client that sends the think field and reads the separate thinking output. The official Python and JavaScript SDKs and any third-party wrapper may handle this differently, and an older library may drop the field silently. Test each client your teams use, including how it handles streamed chunks, and confirm the library version in your dependency lockfile. A wrapper that cannot pass the field makes the control unusable regardless of what the server supports.
Behavior on the OpenAI-compatible endpoint
Ollama's OpenAI compatibility layer maps requests to its native API, and the mapping for reasoning output may differ from the native /api/chat response. Confirm whether your OpenAI-style client can set the thinking control, where the reasoning text appears in the response, and whether your application reads it correctly. Test this path separately from the native API, since an application may work in development on one endpoint and fail on the other.
- REST API port
- Port 11434
Traces in streamed responses
In a streaming response, the reasoning trace and the final answer arrive as separate pieces over time, and your code must route each one correctly. Check whether the thinking content appears in the stream, in what order it arrives, and whether a final message carries the complete trace. Build a test that streams a long reasoning answer and confirms the user interface shows the answer without leaking the trace into the visible text.
Concurrency and queue effects on reasoning
Reasoning requests run longer and hold capacity longer than direct answers, so the queue settings matter more for them. Review OLLAMA_NUM_PARALLEL, OLLAMA_MAX_LOADED_MODELS and OLLAMA_MAX_QUEUE against the expected number of concurrent reasoning calls. Load test with realistic thinking settings, because a queue that is fine for short answers can back up quickly when each request spends far more time generating. Set alert thresholds on queue depth and response time.
- Default queued requests
- 512
Model license for the intended use
A reasoning model is still a model with its own license, and the license terms apply to your deployment regardless of the MIT license on Ollama itself. Read the license of each model and version you plan to use, including any restrictions on commercial use, redistribution or derived models. Have legal or compliance review the file before approval, and record the license alongside the model in your internal catalog so the decision can be audited later.
How DeployOpen works on this
DeployOpen treats thinking-model controls as part of the Ollama server design, not as a client-side afterthought. We scope which models your organization runs, map each model's supported think values through the API, and build the request handling that your applications and users depend on. The result is documented, testable behavior that your teams can operate and review.
How we scope
- Inventory the reasoning models you plan to run and record what each one reports through its model details call.
- Agree which applications need the reasoning trace, which need only the final answer, and who may change the setting.
- Confirm latency and token budgets per use case, with the written scope fixing deliverables before work starts.
- Engagements are fixed-scope, so the scope document states which models, clients and endpoints are covered.
How we build
- Build request handling that sets the think field explicitly for each model rather than relying on defaults.
- Separate the reasoning field from the answer in client code, and test streaming responses with both fields present.
- Test each model against its own supported values, including the default behavior after a model update.
- Record token usage and response time with thinking on and off so the cost of the setting is visible.
How we hand over
- Deliver a configuration reference listing each approved model, its supported think values and its chosen default.
- Provide client examples in the languages your teams use, with the behavior of each setting described.
- Document the verification steps your team runs after upgrading Ollama or pulling a new model version.
- Train operators on where reasoning traces are logged and how to keep them out of user-facing output.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer after handover.
- Retesting covers thinking behavior whenever a model or Ollama release changes the controls your clients use.
- Ask in the quote which Ollama versions and model tags the support period covers, and how changes are approved.
- Confirm with your security team how reasoning output is retained, since traces may contain sensitive content.

