System prompt (role: system) is ignored in /v1/chat/completions
Description
The system role in the messages array is accepted without error but has no effect on the model's behavior.
Steps to Reproduce
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "system", "content": "You are a pirate. Always respond in pirate speak."},
{"role": "user", "content": "What is gravity?"}
],
"temperature": 0.0,
"max_tokens": 60
}'
Expected Behavior
Response should reflect the system prompt (e.g., pirate speak).
Actual Behavior
Response is identical to a request without the system prompt. The system message is silently ignored.
Impact
- Severity: P1 — System prompts are essential for app developers to control model behavior
- Breaks OpenAI API compatibility (system role is a core feature)
- RAG, chatbot personas, and structured output all depend on system prompts
Suggested Fix
Include the system message in the chat template construction. For ChatML-style templates:
<|im_start|>system
{system_content}<|im_end|>
<|im_start|>user
{user_content}<|im_end|>
<|im_start|>assistant
Environment
- quant.cpp: latest main
- Model: SmolLM2-1.7B-Instruct-Q8_0.gguf
Reported by ClawTeam Claw-2 (Builder persona)
Investigated: build_prompt() in tq_server.c correctly formats system role messages into ChatML (<|im_start|>system\n{content}<|im_end|>\n). The system prompt IS included in the prompt sent to the model. The observed behavior is a model limitation (SmolLM2-1.7B has weak system prompt adherence), not a code bug. Closing as not-a-bug.