Views
No views yet
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).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:1operator(): got exception: {"error":{"code":500,"message":"
2------------
3While executing CallExpression at line 110, column 28 in source:
4...eveloper\" %}
5 {{- raise_exception('System message must be at the beginnin...
6 ^
7Error: Jinja Exception: System message must be at the beginning.","type":"server_error"}}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.system / developer messages at any position — no hard exceptionenable_thinking and reasoning_effort (xhigh (default), medium, low)preserve_thinking for multi-turn reasoning continuity<tool_call>/<function> rendering, multi-step tool loopsPicture N:) and video (Video N:) placeholders via add_vision_id1# llama-server
2# 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
3llama-server \
4 -m /path/to/Qwen3.8-27B-Q5_K_S.gguf \
5 --jinja \
6 --chat-template /path/to/chat_template.jinjachat_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).| File | Description |
|---|---|
chat_template.jinja | The fixed chat template (merged v1.0) |
namespace, raise_exception); llama.cpp ≥ 0.16 is recommended.