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

Request: add a reasoning button to web UI chat form

Open ghost opened this issue 9 months ago • 3 comments

Some models, like Qwen3 and gpt-oss, support the enable_thinking kwarg or a similar one such as reasoning_effort. These can be passed in the chat_template_kwargs request to the API.

A web UI button to dynamically configure these kwargs would be nice.

A possible implementation would be on a per-model basis and a button, dropdown, and/or slider.

Another implementation involves checking the Jinja template if it tries to check those kwargs. However, that can be more difficult to implement.

ghost avatar Mar 01 '26 05:03 ghost

Perhaps this doesn't fit your use case, but the arguments passed to llama-server are set in the webui. Thus, you can add something like this to your llama-server command line in order to set various chat kwargs:

--chat-template-kwargs '{"enable_thinking":"true"}'

Good luck!

michaelmarziani avatar Mar 02 '26 07:03 michaelmarziani

https://github.com/ggml-org/llama.cpp/issues/18405 https://github.com/ggml-org/llama.cpp/pull/21141

vanmilleru avatar Apr 04 '26 11:04 vanmilleru

Lightweightness is imo an important argument, cause this makes model reloading unnecessary (which takes time):

E.g. Gemma 4 llama.cpp server start parameter for configuring reasoning:

  • Disable reasoning: --reasoning off
  • Enable reasoning: --chat-template-kwargs '{"enable_thinking":true}'

Each start takes time to load up the model. But switching the reasoning from disabled to enabled or vice versa doesn't need the model to be completely reloaded? So a switch would make that switching much more lightweight (without reloading the model).

DoS007 avatar Apr 29 '26 13:04 DoS007