Qwen3.8-27B โ€” Fixed Chat Template (merged v1.0)

This repository provides a replacement chat_template.jinja for Qwen/Qwen3.8-27B, intended for use with llama.cpp / llama-server (and any GGUF-based backend that accepts a custom chat template).

Why this repo exists

The stock chat template shipped with Qwen3.8-27B crashes with a hard exception when a system / developer message is not the first message in the conversation (e.g. when an agent or client injects system content mid-conversation). With llama-server this surfaces as:

operator(): got exception: {"error":{"code":500,"message":"
------------
While executing CallExpression at line 110, column 28 in source:
...eveloper\" %}
        {{- raise_exception('System message must be at the beginnin...
                                           ^
Error: Jinja Exception: System message must be at the beginning.","type":"server_error"}}

This template eliminates that error. System and developer messages are accepted at any position in the message list and are rendered in place, instead of raising Jinja Exception: System message must be at the beginning.

What the template supports

  • system / developer messages at any position โ€” no hard exception
  • Thinking / reasoning control via enable_thinking and reasoning_effort (xhigh (default), medium, low)
  • preserve_thinking for multi-turn reasoning continuity
  • Tool calling: function schemas injected in the system block, <tool_call>/<function> rendering, multi-step tool loops
  • Vision: image (Picture N:) and video (Video N:) placeholders via add_vision_id

Usage

Point your backend at this file:

# llama-server
# or any other GGUF from the Qwen 3.8 27B family โ€” this template fits the whole family and looks very good with all of them
llama-server \
  -m /path/to/Qwen3.8-27B-Q5_K_S.gguf \
  --jinja \
  --chat-template /path/to/chat_template.jinja

Or any other Qwen 3.8 27B GGUF (any quant, any GGUF build of the family) โ€” set the chat template to the contents of chat_template.jinja in any client that allows a custom Jinja chat template (e.g. pi's llamacpp provider, Ollama's TEMPLATE, LM Studio's chat template field).

Files

File Description
chat_template.jinja The fixed chat template (merged v1.0)

Notes

  • Weights are not included in this repo โ€” this is a chat-template-only fix for the base model listed above.
  • If you hit a template error, verify your backend actually supports the Jinja features used (namespace, raise_exception); llama.cpp โ‰ฅ 0.16 is recommended.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for HattoriHanzo1/Qwen-3.8-27B

Base model

Qwen/Qwen3.8-27B
Finetuned
(491)
this model