llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

Eval bug: Bug: Qwen3.5 enable_thinking=false via --chat-template-kwargs is ignored across all shells (PowerShell/Bash)

Open lucksufe opened this issue 8 months ago • 4 comments

Name and Version

System:windows 10 & 11

llama.cpp version::llama-b8254-bin-win-cpu-x64/llama-b8270-bin-win-cuda-12.4-x64/llama-b8270-bin-win-cuda-13.1-x64

model:Qwen3.5-27B-Q4_K_M.gguf/Qwen3.5-9B-Q4_K_M.gguf/Qwen3.5-2B-Q8_0.gguf

Describe the bug I am unable to disable the "Thinking" (Chain-of-Thought) output for Qwen3.5 models using llama.cpp. The model consistently generates the thinking block regardless of the parameters passed.

Steps to Reproduce I have tried multiple combinations of --chat-template-kwargs to force enable_thinking to false, but none work. The model ignores these arguments completely.

Commands attempted (all failed):

  1. Using single quotes with escaped inner quotes:
    ./main -m qwen3.5.gguf --chat-template-kwargs '{"enable_thinking": false}'
    
    

Operating systems

Windows

GGML backends

CUDA

Hardware

CPU:Ryzen 5800 and Ryzen 7840h GPU:RTX 4080

Models

Qwen3.5-27B-Q4_K_M.gguf/Qwen3.5-9B-Q4_K_M.gguf/Qwen3.5-2B-Q8_0.gguf

Problem description & steps to reproduce

./llama-b8270-bin-win-cuda-12.4-x64/llama-cli.exe -m model/Qwen3.5-9B-Q4_K_M.gguf --chat-template-kwargs '{"enable_thinking": false}'

First Bad Commit

No response

Relevant log output

Logs

lucksufe avatar Mar 11 '26 16:03 lucksufe

I had a very similar issue on windows, as far as i can tell its an escaping issue of powershell and cmd. A workaround that worked for me was either setting

$env:LLAMA_CHAT_TEMPLATE_KWARGS='{"enable_thinking": false}'

Or you use the new switch, --reasoning [on|off|auto]

MaxKruse avatar Mar 11 '26 16:03 MaxKruse

Please try it

  • PowerShell
--chat-template-kwargs '{\"enable_thinking\": false}'
  • command prompt
--chat-template-kwargs "{\"enable_thinking\": false}"

grapevine-AI avatar Mar 19 '26 16:03 grapevine-AI

For me its the same on linux even with the latest build. preserve_thinking for qwen3.6 is also not working.

Edit: llama-server is correctly applying the parameters, but llama-cli not.

llama-cli \
    -hf unsloth/Qwen3.5-35B-A3B-GGUF:UD-Q4_K_XL \
    --ctx-size 120000 \
    --temp 0.6 \
    --top-p 0.95 \
    --top-k 20 \
    --min-p 0.00 \
    --chat-template-kwargs '{"enable_thinking": false}'

MfCrizz avatar Apr 17 '26 17:04 MfCrizz

Good bro

في الجمعة، 17 أبريل 2026 18:17 Manuel Fragner @.***> كتب:

MfCrizz left a comment (ggml-org/llama.cpp#20409) https://github.com/ggml-org/llama.cpp/issues/20409#issuecomment-4269946613

For me its the same on linux even with the latest build.

— Reply to this email directly, view it on GitHub https://github.com/ggml-org/llama.cpp/issues/20409?email_source=notifications&email_token=CBTQ2IXSI7E7P7LR26MLNOD4WJRKBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRWHE4TINRWGEZ2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-4269946613, or unsubscribe https://github.com/notifications/unsubscribe-auth/CBTQ2IQ5K6BASJZBQ7ORIB34WJRKBAVCNFSM6AAAAACWOPQU62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DENRZHE2DMNRRGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mollahmasud977-sys avatar Apr 17 '26 21:04 mollahmasud977-sys