How to turn off thinking....

#14
by tcclaviger - opened

Enabling no-think / enable_thinking=false on Step-3.7-Flash (vLLM)

Step-3.7's stock chat template always opens a block, so the model reasons on every turn. Two small edits make it
honor the standard enable_thinking switch (and reasoning_effort), defaulting to thinking ON.

  1. Chat template (chat_template.jinja in your model dir)

Add a flag at the top:

  {%- set thinking_enabled = not (enable_thinking is defined and enable_thinking is false) %}
  At the generation prompt, emit an empty closed block when disabled (mirrors Qwen3):
  {%- if add_generation_prompt %}
      {{- '<|im_start|>assistant\n' }}
      {%- if thinking_enabled %}{{- '<think>\n' }}
      {%- else %}{{- '<think>\n\n</think>\n\n' }}{%- endif %}
  {%- endif %}

Gate the prior-turn re-emission and the Reasoning: effort hint on thinking_enabled too.

  1. Reasoning parser (vllm/reasoning/step3p5_reasoning_parser.py)
  In __init__, read the per-request flag:
  chat_kwargs = kwargs.get("chat_template_kwargs", {}) or {}
  self.thinking_enabled = chat_kwargs.get("enable_thinking", True)
  In extract_reasoning, short-circuit when disabled and no </think> appears:
  if self.end_token not in model_output and not self.thinking_enabled:
      return None, model_output or None

Streaming needs no change — the empty closed block puts in the prompt, so the serving layer marks reasoning
ended and routes deltas to content automatically.

Use it (either works):
"chat_template_kwargs": {"enable_thinking": false} // explicit off
"reasoning_effort": "none" // also sets enable_thinking=false
"reasoning_effort": "high" // thinking on + effort hint

Unset = thinking on (unchanged default).

Verified to work in vllm wonderfully, full tool calling still works, enable/disable mid chat/work doesn't break. No issues observed that impact performance of the model.

Verified to work in vllm wonderfully, full tool calling still works, enable/disable mid chat/work doesn't break. No issues observed that impact performance of the model.

i set reasoning budget to 0, and have same effect without editing chat template

That's certainly one way, I prefer control via kwargs.

It avoids changes for stacks that already use dynamic thinking control via the chat kwargs, this small change avoids needing to thread
if model is step and thinking is disabled and thinking mode is none send reasoning budget 0
or some variant of that into middleware/front end stacks

Sign up or log in to comment