Skip to content

llama-completion: respect chat_template_kwargs and reasoning_format params#25201

Open
percontation wants to merge 1 commit into
ggml-org:masterfrom
percontation:cli_template_kwargs
Open

llama-completion: respect chat_template_kwargs and reasoning_format params#25201
percontation wants to merge 1 commit into
ggml-org:masterfrom
percontation:cli_template_kwargs

Conversation

@percontation

@percontation percontation commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Overview

llama-completion will now respect --chat-template-kwargs, --reasoning, and --reasoning-format args.

llama-completion was previously accepting & ignoring --reasoning and --reasoning-format, and not accepting --chat-template-kwargs.

Requirements

@percontation percontation requested review from a team, ggerganov and ngxson as code owners July 1, 2026 12:41
@percontation percontation force-pushed the cli_template_kwargs branch from a6c03bb to dc4bfd3 Compare July 8, 2026 18:57
@percontation percontation changed the title llama-cli: fix passing chat_template_kwargs and reasoning_format params llama-completion: respect chat_template_kwargs and reasoning_format params Jul 8, 2026
@percontation

Copy link
Copy Markdown
Contributor Author

Update: This PR now only applies to llama-completion, and no longer applies to llama-cli because #24948 also fixed this (by removing the llama-cli specific codepaths that failed to pass params properly).


// note: the time for chat template initialization is not negligible:
auto chat_templates = common_chat_templates_init(model, params.chat_template);
const bool template_supports_thinking = params.use_jinja && common_chat_templates_support_enable_thinking(chat_templates.get());

@percontation percontation Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW: this template_supports_thinking logic (plus its use below for enable_reasoning) is copied directly from server-context.cpp, for consistency with how other llama.cpp tools process these args.

@percontation percontation force-pushed the cli_template_kwargs branch from dc4bfd3 to da72143 Compare July 13, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant