Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion tools/cli/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,20 @@ struct cli_context {
inputs.parallel_tool_calls = false;
inputs.add_generation_prompt = true;
inputs.reasoning_format = COMMON_REASONING_FORMAT_DEEPSEEK;
inputs.enable_thinking = common_chat_templates_support_enable_thinking(chat_params.tmpls.get());
inputs.enable_thinking = chat_params.enable_thinking;
inputs.chat_template_kwargs = chat_params.chat_template_kwargs;

// sync enable_thinking with kwargs (mirrors server-common.cpp)
{
auto it = inputs.chat_template_kwargs.find("enable_thinking");
if (it != inputs.chat_template_kwargs.end()) {
if (it->second == "true") {
inputs.enable_thinking = true;
} else if (it->second == "false") {
inputs.enable_thinking = false;
}
}
}

// Apply chat template to the list of messages
return common_chat_templates_apply(chat_params.tmpls.get(), inputs);
Expand Down
Loading