How to enable thinking

#6
by watchingyousleep - opened

Here you are. This is for those running LM Studio which refuses to expose chat template variables in the GUI. It should work perfectly on the 31B model as well but no one can run that anyways with Context RAM usage so I didn't bother testing.
Don't forget to change the Reasoning Parsing to <|channel>thought and <channel|>.

Edit: I removed my method here's a better method thanks to @lps08

I enabled the thinking feature in lmstudio by inserting {%- set enable_thinking = true %} at the beginning of the Jinja prompt

Doesn't work in Lmstudio 4.9.1 on MacOs
All I get is blank lines being generated during inference

Settings:
System prompt: blank
Prompt temple: as shown above

Reasoning section parsing:
start string: <|channel>
end string: <channel|>

This is with gemma-4-31B-it-UD-Q8_K_XL.gguf downloaded April 6 1pm EST

Just to clarify:
This WORKS with Gemma 4 26B A4B
This DOES NOT WORK with Gemma 4 31B

I enabled the thinking feature in lmstudio by inserting {%- set enable_thinking = true %} at the beginning of the Jinja prompt

I enabled the thinking feature in lmstudio by inserting {%- set enable_thinking = true %} at the beginning of the Jinja prompt

Thank you. That helped.

set {%- set enable_thinking = true %} as the first line in the jinja prompt. in LM Studio you can currently find this at the bottom of the model's inference settings (in the 'My Models' section of the app)

you also then will need to specify the start and end strings so LMS can parse the output into a think block:
start: <|channel>thought
end: <channel|>

this is also found in the inference settings

note that the jinja prompt is coded so that the reasoning blocks don't feed back into the model's context during the inferencing of subsequent prompts (unless using tool-calling, in which case only the most recent reasoning block is fed back)

Sign up or log in to comment