With a qwen 2.5 model I can do this:
curl http://localhost:12434/engines/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen2.5:3B-F16",
"stream": true,
"messages": [
{"role": "system", "content": "you are a helpful assistant."},
{"role": "user", "content": "hello, how are you?"},
{"role": "system", "content": "docker model runner rocks"},
{"role": "user", "content": "what is docker model runner?"}
]
}'
With a qwen 3.5 model, If I try the same:
curl http://localhost:12434/engines/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "huggingface.co/unsloth/qwen3.5-4b-gguf:Q4_K_M",
"stream": true,
"messages": [
{"role": "system", "content": "you are a helpful assistant."},
{"role": "user", "content": "hello, how are you?"},
{"role": "system", "content": "docker model runner rocks"},
{"role": "user", "content": "what is docker model runner?"}
]
}'
I get this error:
{"error":{"code":500,"message":"\n------------\nWhile executing CallExpression at line 85, column 32 in source:\n...first %}↵ {{- raise_exception('System message must be at the beginnin...\n ^\nError: Jinja Exception: System message must be at the beginning.","type":"server_error"}}
the chat template contains this:
{%- if message.role == "system" %}
{%- if not loop.first %}
{{- raise_exception('System message must be at the beginning.') }}
{%- endif %}
When the client sends a system message anywhere other than position [0] in the messages array, the template raises an exception and the server returns 500.
With a qwen 2.5 model I can do this:
With a qwen 3.5 model, If I try the same:
I get this error:
{"error":{"code":500,"message":"\n------------\nWhile executing CallExpression at line 85, column 32 in source:\n...first %}↵ {{- raise_exception('System message must be at the beginnin...\n ^\nError: Jinja Exception: System message must be at the beginning.","type":"server_error"}}the chat template contains this:
When the client sends a system message anywhere other than position [0] in the messages array, the template raises an exception and the server returns 500.