Support jinja extra template kwargs (Qwen3 enable_thinking feature), from command line and from client #13196
+41
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements handling additional jinja parameters.
Used for example to set enable_thinking in Qwen3 models.
The official template is still partially compatible. I modified it to use only supported features.
It's here: https://pastebin.com/16ZpCLHk
And should be loaded with
llama-server --jinja --chat-template-file {template_file}
It fixes #13160 and #13189
Test it with:
{"prompt":"\n<|im_start|>user\nGive me a short introduction to large language models.<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"}