Text Generation
GGUF
English
multilingual
qwen3_5
qwen3.6
reasoning
distillation
claude-opus
llama-cpp
ollama
fine-tuned
conversational

How to disable <think> in llama-cpp-python for this model?

#2
by dif204 - opened

Hi! I'm running this model via llama-cpp-python and the model always generates <think> blocks even when I don't want reasoning.

The chat template has <think> hardcoded in the generation prompt:
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n\n' }}
{%- endif %}

Things I've tried:

  • --chat_template_kwargs '{"enable_thinking": false}' β†’ accepted but ignored
  • --reasoning_budget 0 β†’ unrecognized argument in this version of llama-cpp-python
  • Patching template via Jinja2ChatFormatter with <think> removed β†’ template compiles OK but model still self-inserts <think> at generation time
  • Few-shot prompting with no_thinking - prefix β†’ reduces but doesn't eliminate

Question: Is there an official way to run this model without thinking mode in llama-cpp-python? Or do we need to patch the GGUF file directly?

llama-cpp-python version: 0.3.23

Thanks!

Owner

Hi, there is no official way. is hardcoded in the generation prompt of the template. You have to modify the GGUF directly

Sign up or log in to comment