How to turn off thinking in Ollama for Gemma 4

One setting stopped the empty replies and cut the typical wait roughly in half. Two ways to set it, how to check your model supports it, and the numbers from 15 runs.

0:00

Gemma 4 thinks before it answers, and in Ollama that thinking counts against your token limit. To turn it off, set think to false. In our 15 runs with it off, every one answered, and a 250 word explanation took about 27 seconds instead of running out of tokens.

How do I turn off thinking in Ollama for Gemma 4?

There are two routes we checked. On the command line, ollama run has a --think flag that takes true or false, so ollama run your-model --think=false starts a chat with thinking off. Through the local server, add "think": false to the body of a request to /api/chat. That is the route we used for every timed run.

How do I know if my Ollama model can think?

Run ollama show your-model and read the Capabilities list. Our Gemma 4 31B import listed completion, tools and thinking. If thinking is not listed for your model, the setting has nothing to turn off.

What does turning off thinking change in Ollama?

The wait, and whether you get an answer. The writing speed did not move.

Measure Thinking on Thinking off
Runs with no visible answer, 600 tokens allowed 7 of 15 0 of 15
Middle time for a whole reply 53.8 seconds 27.2 seconds
Writing speed, middle of 15 runs 11.50 tokens a second 11.61 tokens a second
Finished the 250 word explanation inside the limit 0 of 3 3 of 3

With thinking on, most runs stopped at the 600 token limit, so 53.8 seconds is the cap and not the real time. The full numbers are in our timed test with thinking off.

Is the answer still right with thinking off?

The one answer we could mark was. Asked when a train arrives after 180 km at 90 km/h, a 25 minute wait and 120 km at 80 km/h, it gave 13:05 in three runs of three, which is correct. We did not grade the explanations, the summary or the code, so this is not a quality test.

Does --hidethinking do the same thing?

Not necessarily. ollama run also has a --hidethinking flag, which its help describes as hiding the thinking output. We did not test whether it saves any time, so do not assume it does.

What does a request to Ollama look like with thinking off?

This is the body we sent to /api/chat on the local server for every timed run, with only the prompt changed:

{"model": "gemma4-31b-qat-q4", "messages": [{"role": "user", "content": "Your prompt"}], "stream": false, "think": false, "options": {"temperature": 0, "num_predict": 600, "num_ctx": 65536}}

The setting sits at the top level of the body, beside the model name, not inside options. The options we set were the temperature, the most tokens to write and the context window. Leave think out and the model thinks. Set it to false and it does not.

How do I check that thinking is really off?

Read the reply. With thinking on, each reply from the server carried the model’s reasoning as a separate field, and in our 15 runs that reasoning ran from 1,357 to 2,735 characters. With thinking off, the field was empty in all 15. If your replies still carry reasoning, the setting did not reach the server. The usual causes are putting it inside the options or using a program that builds the request for you and leaves it out.

How much time does turning off thinking save on each task?

It depends on how much of the reply was thinking in the first place.

Task Thinking on Thinking off No answer with thinking on
Explain, about 250 words 54.7 seconds 27.2 seconds 1 of 3
Write a Python function 53.5 seconds 53.6 seconds 3 of 3
Summarise, about 200 words 53.8 seconds 20.3 seconds 0 of 3
List ten checks 52.4 seconds 18.9 seconds 0 of 3
Work out a train time 54.3 seconds 36.8 seconds 3 of 3

Times are the middle of three whole replies. With thinking on, almost every run stopped at the 600 token limit, which is why those times sit near 53 seconds whatever the task. With it off, the list of ten checks took about a third of the time and the summary a little more than a third. The worked sum saved the least of the tasks that finished, because its answer was the longest.

Why did the code task not get any faster?

Because the answer on its own needed more than 600 tokens. With thinking on, the Python function task used the whole allowance thinking and returned nothing in three runs of three. With thinking off it wrote code straight away, used the whole allowance again, and was cut off before the end. Turning thinking off moved the task from no answer to most of an answer. For code, raise the limit as well.

Should I ever leave thinking on?

Our test cannot tell you, because it did not grade the answers. What it shows is narrower. At a 600 token limit, thinking cost seven answers out of 15 and gained nothing we could measure. The one answer we could mark, the train time, was right in all three runs with thinking off. Whether thinking improves a hard answer when the limit is generous is a separate question, and we have not tested it. If you leave it on, allow about four times the tokens you expect the answer to need.

Can I turn off thinking in LM Studio too?

On one model, yes. We sent one prompt to Qwen 3.8 27B in LM Studio with 1,200 tokens allowed. By default all 1,200 went on thinking and the answer was empty. With the reasoning effort set to none in the request, the same prompt was answered in 152 tokens with no thinking at all. Writing “no think” in the prompt did nothing, and neither did a second setting we tried, one that asks the model’s template to disable thinking. We did not run the same check on Gemma 4 in LM Studio, so treat that as a lead, not a result.

Does turning off thinking change the memory Ollama uses?

Not that we could measure. The process stood at 31.4 GB after 15 runs with thinking off and 33.2 GB after 15 with it on, in the same session on the same loaded model. That gap is within what process size on a Mac does on its own.

What should I do if my program has no thinking setting?

Some programs build the request for you and give you no place to add the setting. You then have two choices. Raise the token limit until the thinking fits, which in our runs meant allowing well over 600 tokens for a few paragraphs. Or send your requests to the server yourself, using the body above, where the setting is yours to add. A short script that posts that body and prints the reply is enough to test whether your model answers faster with thinking off before you change anything else.

How we tested

Ollama 0.32.6 on a Mac with an M4 Pro chip and 48 GB of memory, the Gemma 4 31B QAT Q4_0 file imported from a local file, a 65,536 token context, 600 tokens allowed, temperature 0, three runs of each of five tasks, on 3 October 2026. The method is on how we test. For the same model in LM Studio, see Ollama against LM Studio.

Sources

  1. Google's Gemma 4 31B QAT model card
Cite this page

Hill. "How to turn off thinking in Ollama for Gemma 4". Onticpost, published 4 October 2026, updated 24 October 2026. https://onticpost.com/turn-off-thinking-ollama-gemma-4/

Updated 24 October 2026. This address stays the same when the piece is updated.

Share this

Subscribe to our newsletter

Checked: what AI can do for your business, checked by humans. Free, every Friday. One email a week, leave any time.

Free, every Friday. We send a link to confirm first. Our privacy policy says what we keep.