How to turn thinking off per request on Ollama, llama-server, vLLM and SGLang, and check that it worked
There is no field that works everywhere, and every one of these servers drops a field it does not know without an error. On Ollama's /v1/chat/completions only "reasoning_effort": "none" works (0.12.4 and later). think and chat_template_kwargs are silently dropped there. On llama-server, vLLM and SGLang, "chat_template_kwargs": {"enable_thinking": false} works for Qwen3-style templates. "reasoning_effort": "none" works only from llama.cpp b10121, vLLM v0.22.0 and SGLang v0.5.10. Older vLLM is the worst case: v0.18.0–v0.21.x accept "none" and keep thinking. Sampling fields fail the same quiet way: Ollama's OpenAI endpoint drops top_k, min_p and repeat_penalty. vLLM and SGLang spell the penalty repetition_penalty and ignore llama.cpp's repeat_penalty. thinkcheck.py sends paired requests to your own server and tells you which fields worked, which were ignored and which were rejected.
Which field turns thinking off on each server?
All rows are per request on the OpenAI-compatible /v1/chat/completions endpoint, for a model whose template reads enable_thinking (Qwen3, Qwen3.5/3.6, GLM-4.5 and later, Nemotron 3). “Ignored” means HTTP 200 and the model still thinks.
| Field sent | Ollama /v1 (v0.40.18) | llama-server (b12809) | vLLM (v0.34.0) | SGLang (v0.5.23) |
|---|---|---|---|---|
"chat_template_kwargs": {"enable_thinking": false} | ignored (field not read) | works since b5780 (measured) | works since v0.5.1 | works since v0.4.7 |
"chat_template_kwargs": {"enable_thinking": "false"} (string) | ignored | HTTP 400 since b6394; b6393 and older: accepted, still thinks (measured) | accepted, still thinks (the template tests is false) | same as vLLM |
"reasoning_effort": "none" | works since v0.12.4; v0.11.5–v0.12.3: HTTP 400 for non-GPT-OSS models | works since b10121 (measured); b10108 and older: ignored (measured) | works since v0.22.0; v0.18.0–v0.21.x: accepted and ignored; v0.17.1 and older: HTTP 400 | works since v0.5.10; v0.5.1–v0.5.9: rejected (only low/medium/high) |
"think": false | ignored on /v1/chat/completions (works on native /api/chat since v0.9.0, and on /v1/responses) | ignored (measured) | ignored | ignored |
"enable_thinking": false (top level) | ignored | ignored (measured) | ignored | ignored |
"chat_template_kwargs": {"thinking": false} | ignored | only for templates that read thinking (DeepSeek V3.1, Kimi K2); ignored for Qwen3 (measured) | same; keys the template does not read are dropped | same |
Model limits come first: Qwen3-2507 “Thinking” and Qwen3-VL “Thinking” templates always open a think block, so no field turns them off; use the matching Instruct model. GPT-OSS cannot stop reasoning either: Ollama maps "none" to "low" for it, per its OpenAI compatibility page. SGLang v0.5.23 also accepts a top-level "thinking": {"type": "disabled"}, which sets both thinking and enable_thinking in the template arguments unless the request sets them. The /no_think suffix is a prompt convention of the original Qwen3 hybrid models, not a server feature: the model may or may not follow it.
Why the string "false" fails
Qwen3's template tests enable_thinking is defined and enable_thinking is false. The string "false" is defined but is not false, so the template takes the thinking branch. We rendered the template through /apply-template on three llama-server builds with a toy model that carries the real Qwen3 template. b6393 returned the thinking prompt for the string. b10108 and b12809 return HTTP 400 invalid type for "enable_thinking" (expected boolean, got string). vLLM and SGLang pass the value to Jinja as it is, so a string there silently keeps thinking on. This bites clients that build JSON by hand or from environment variables.
Why vLLM v0.18–v0.21 keep thinking with reasoning_effort: "none"
vLLM v0.18.0 added "none" to the allowed values (PR #36238) but passed it to the chat template only as the variable reasoning_effort. Qwen3 templates never read that variable, so the model thought as usual and the request still returned 200. v0.22.0 (PR #43401) also sets enable_thinking to reasoning_effort != "none", unless the request already sets enable_thinking in chat_template_kwargs. If you cannot upgrade, send the chat_template_kwargs form; it works on every version since v0.5.1.
Which sampling fields are silently ignored?
Ollama's /v1/chat/completions ignores top_k, min_p and both repetition-penalty spellings. Each of the other three servers ignores the repetition-penalty spelling of the others. None of the four rejects a field it does not know.
| Field | Ollama /v1 | llama-server | vLLM | SGLang |
|---|---|---|---|---|
top_k | ignored | works (measured) | works | works |
min_p | ignored | works (measured) | works | works |
repeat_penalty (llama.cpp / Ollama spelling) | ignored | works | ignored | ignored |
repetition_penalty (HF / vLLM spelling) | ignored | ignored | works | works |
frequency_penalty, presence_penalty | works | works | works | works |
seed | works | works (measured) | works | works |
| a misspelled or unknown field | dropped, no error, no log | dropped, no error (measured) | dropped; logged at WARNING v0.6.5–v0.17.1, only at DEBUG since v0.18.0 | dropped, no error |
Ollama's OpenAI handler copies only temperature, top_p, seed, stop, max_tokens, frequency_penalty, presence_penalty and response_format into the model options. Go's JSON decoder drops everything else. To set top_k, min_p or repeat_penalty on Ollama, call the native /api/chat with "options", or put PARAMETER lines in the Modelfile. In vLLM, run with VLLM_LOGGING_LEVEL=DEBUG to see the line “The following fields were present in the request but ignored”.
Where does the thinking come back, and does hiding it save tokens?
A client that reads the wrong field sees no thinking and concludes it is off while the server is still generating it. Check usage.completion_tokens, not only the text.
- Ollama /v1:
message.reasoning(since v0.11.0). The native API usesmessage.thinking. - llama-server:
message.reasoning_contentwith the default--reasoning-format. With"reasoning_format": "none"the<think>block stays incontent. We forced a think block with a grammar while sendingenable_thinking: false; the server then left it incontent, not inreasoning_content. - vLLM:
message.reasoning. v0.12.0–v0.15.1 sent bothreasoningandreasoning_content; v0.16.0 removedreasoning_content(PR #33402), and older clients that read only it see nothing. Without--reasoning-parserthe think block stays incontent. - SGLang:
message.reasoning_content, only when the server runs with--reasoning-parserand the request keepsseparate_reasoning: true.
Hiding is not stopping. vLLM's include_reasoning: false (v0.10.1+), SGLang's separate_reasoning: false and llama-server's reasoning_format: "none" only change the response. The tokens are still generated. To cap thinking without turning it off, use a budget. llama-server takes thinking_budget_tokens per request since b8287 and reasoning_budget_tokens since b9982, or --reasoning-budget at start-up. vLLM takes thinking_token_budget since v0.19.0; it needs a reasoning parser or --reasoning-config to know where thinking ends.
How do I check my own server?
curl -O https://erimaki-kobo.github.io/en/disable-thinking-request-field-check/thinkcheck.py
python thinkcheck.py --base-url http://localhost:11434/v1 --model qwen3:0.6b
python thinkcheck.py --base-url http://localhost:8000/v1 --model Qwen/Qwen3-0.6B --json result.json
It sends a baseline request, then the same request with each thinking switch, at temperature 0. A switch “worked” if the baseline thought and the switched request did not (it looks in reasoning_content, reasoning, reasoning_text and for a non-empty <think> block in content). For sampling it compares three samples at temperature 1.5 with and without top_k: 1 and min_p: 1.0. Identical samples mean the field worked; different samples mean it was dropped. It also repeats a seed, compares the three penalty spellings at temperature 0, and sends one unknown field to see whether the server is strict. About 24 short requests in total; it uses the first switch that worked in the sampling checks so thinking does not eat max_tokens. Use --extra '{"key": ...}' for fields your proxy needs and --api-key for a hosted endpoint.
Output against llama-server b12809 with the toy model (random weights, so it never thinks on its own and the thinking rows say “can't tell”; a toy over 151,936 tokens also never repeats, so the penalty rows show no effect):
Sampling fields (temperature 1.5, 3 samples each; also sent: nothing)
field status verdict
unknown field (erimaki_unknown_canary) 200 accepted and ignored (typos are silently dropped)
top_k: 1 200 worked (3 samples identical)
min_p: 1.0 200 worked (3 samples identical)
seed 200 worked (same seed repeats, other seed differs)
The thinking verdicts were tested against a replay server that follows the Ollama v0.40.18, vLLM v0.21 and vLLM v0.17.1 rules above (repro/mock_engine.py). It reported reasoning_effort: "none" as the only working switch for Ollama /v1, enable_thinking as the only one for vLLM v0.21, and a 400 for "none" on v0.17.1.
How this was measured
- llama-server: built from source on CPU at b6393, b10108 and b12809. make_toy_qwen3.py writes a 2-layer random-weight Qwen3 GGUF with the real Qwen2 vocabulary plus Qwen3's four added tokens and the real Qwen3-0.6B template, both from llama.cpp's
models/folder. render_matrix.py posts each request body to/apply-template, which uses the same request parsing as chat completions. A body “turns thinking off” when the rendered prompt ends with the empty<think></think>block. Results: results.jsonl (21 rows). run.sh repeats it for any build in a few minutes. - First versions: found by binary search over every release tag (8,832 llama.cpp tags, 226 vLLM, 168 SGLang, all Ollama releases), reading the request-parsing file at each tag. Dates are PyPI upload dates for vLLM and SGLang and tag commit dates for llama.cpp and Ollama.
- Not run: Ollama, vLLM and SGLang were not started; their rows come from the request models and handlers at the tags named. LM Studio is closed source and not covered (see lmstudio-bug-tracker #1990 for
enableThinkingbeing ignored on its OpenAI endpoint).
FAQ
- How do I disable thinking on Ollama's OpenAI-compatible endpoint?
- Send
"reasoning_effort": "none"(or"reasoning": {"effort": "none"}) on Ollama 0.12.4 or later. With the OpenAI Python client that isreasoning_effort="none"; noextra_bodyis needed. On the native API, send"think": false. - I set
--default-chat-template-kwargs '{"thinking": false}'on vLLM and Qwen3 still thinks. - Qwen3 reads
enable_thinking;thinkingis the key for DeepSeek V3.1 and Kimi K2 templates. vLLM keeps only the keys the template reads (since v0.11.0) and drops the rest without a warning. A request-levelchat_template_kwargsoverrides the server default. - Why does vLLM keep thinking when I send
reasoning_effort: "none"? - On v0.18.0–v0.21.x it reaches the template only as a variable that Qwen3 does not read. Upgrade to v0.22.0 or send
chat_template_kwargs: {"enable_thinking": false}. - Does llama-server accept
enable_thinkingas a string? - No. Since b6394 the string returns HTTP 400; in b6393 and older it was accepted and the model kept thinking. Send a JSON boolean.
- Are
top_kandmin_pignored by Ollama's OpenAI API? - Yes, without an error. Use the native
/api/chatwith"options", or the Modelfile. - Does
reasoning_effort: "low"shorten Qwen3's thinking? - No. Qwen3 templates have no effort levels; on llama-server, vLLM v0.22.0+ and SGLang a value other than
"none"turns thinking on and nothing else. On Ollama, a non-thinking model returns 400 “does not support thinking” for such a value on/v1/chat/completions. Use a thinking budget to shorten it. - Does
include_reasoning: falsemake responses faster? - No. It removes the reasoning from the response; the model still generates it.
- Why does SGLang return the thinking inside
content? - The server was started without
--reasoning-parser, or the request sentseparate_reasoning: false.
Limitations
- Only llama-server was run, on a random-weight toy model. The rows for Ollama, vLLM and SGLang are read from the source; a real model run on those servers (ours or yours with
thinkcheck.py) may show template-specific behaviour we did not see. - Streaming responses are not checked. Thinking can be parsed differently in
deltachunks. - The table covers templates that read
enable_thinking. Models with their own switch (GPT-OSS effort levels, DeepSeek V3.1thinking, Gemma 4, which is off by default) need their own key. - The penalty check needs a model that repeats when asked to; on a model that never repeats, every spelling shows “no effect seen”.
Related
- vLLM tool parsers: where tool calls inside thinking end up
- vLLM and SGLang flags and request fields removed by version
- Model does not stop generating: which token each engine stops on
- What each engine returns when the prompt exceeds the context
Sources
- Ollama openai/openai.go, middleware/openai.go, server/routes.go, OpenAI compatibility docs
- llama.cpp tools/server/server-common.cpp, common/arg.cpp, models/templates/Qwen-Qwen3-0.6B.jinja; PRs #13196, #15404, #20297, #23116, #26045
- vLLM chat_completion/protocol.py, serve/engine/protocol.py, renderers/hf.py, reasoning outputs docs; PRs #33402, #36238, #43401
- SGLang entrypoints/openai/protocol.py, serving_chat.py; PR #20556
- Reports: ellmer #940, vLLM #35574, discuss.vllm.ai 2400, 1499, Qwen3 discussion #1300, lmstudio-bug-tracker #1990