Skip to main content
Gemma 4 can think step by step before it answers, which helps with math, code and multi-step problems. Thinking is off by default because it adds output tokens and time.

Turning it on

Set reasoning_effort to low, medium or high. none turns thinking off.
You can also turn it on through the chat template with "chat_template_kwargs": {"enable_thinking": true}. In the OpenAI Python SDK, pass it as extra_body={"chat_template_kwargs": {"enable_thinking": True}}.

Where the thinking goes

The thinking comes in a separate reasoning field, and content holds only the answer:
When streaming, it arrives in delta.reasoning before the answer starts in delta.content.
Some clients read a field named reasoning_content. fastrun uses reasoning.

Cost and limits

Thinking tokens are output tokens: they count toward completion_tokens, max_tokens and the price. Leave enough room in max_tokens for both the thinking and the answer, or the answer may be cut off. Reasoning works together with tool calling and structured outputs.