How to make thinking stop, so you can use none, low, mid, high thinking

#1
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).

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).

Sign up or log in to comment