Qwen3.8-27B-flexible-chat-template
Qwen/Qwen3.8-27B with one change to the chat template: a
system message that is not the first message is rendered where it is, as
<|im_start|>system\n...<|im_end|>, instead of raising
System message must be at the beginning.
The weights, the tokenizer and the rest of the template are the same as in Qwen/Qwen3.8-27B, so
thinking works as in the original (enable_thinking). We use it to fine-tune students on agent
conversations that add system messages during the conversation.
The change, in chat_template.jinja:
{%- if message.role == "system" %}
{%- if not loop.first %}
- {{- raise_exception('System message must be at the beginning.') }}
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
{%- endif %}
See Qwen/Qwen3.8-27B for the model card, benchmarks and usage. License: Apache 2.0, as the original.