Qwen3.8の27Bが使えるようになったので、さっそく使ってみた。
が、以下のエラーが出て使えなかった
ちなみに環境は以下
- Qwen3.8-27B-Q4_K_M.gguf
- VScode + Claude Code for VSCode
- LMStudio 0.4.21
W srv operator(): got exception: {"error":{"code":500,"message":"\n------------\nWhile executing CallExpression at line 110, column 28 in source:\n...eveloper\" %}竊オ {{- raise_exception('System message must be at the beginnin...\n ^\nError: Jinja Exception: System message must be at the beginning.","type":"server_error"}}
Error: Jinja Exception: System message must be at the beginning.
という内容で、systemメッセージの位置が気に入らないらしい
調べてみると以下のやり取りが見つかった
この中に書かれている以下のパッチをありがたくいただくことにした
https://gist.github.com/wOvAN/325a0d6212902fb84f97287ab4edb89b
対策:LMStudioの場合
上記のパッチの内容をすべてコピーして、LMStudioの「Chat Template」に入れる
もしQwen3.8をロードしている場合は、再ロードしてテンプレートを読み直すと正常になった。
対策:llama.cpp の場合
上記のパッチの内容をすべてコピーして、テキストファイルとして保存する(文字コードはUTF-8)
そして、llama-serverの起動パラメータに「--chat-template-file」を追加して、テキストファイルの場所を指定する
例)
--chat-template-file "C:\models\unsloth\Qwen3.8-27B-GGUF\template_fix.txt"

