// Error · Run models on your own machine
llama.cpp prints garbage, mixes up roles or never calls tools
The chat template turns messages into the format the model was trained on. With the wrong template the model emits odd tokens, talks to itself or fails to call tools properly.
verified 2026-10-101 official sources
Scenario: Run models on your own machine →
🖥️Self-hosted computeSelf-hosted compute: decide → size → build → run, with calculators→Symptoms
- Special tokens like
<|im_start|>appear in answers - The model never calls tools, or tool calls are malformed
Common causes
- The server is not using the model’s own template
- The template in the GGUF file is outdated or missing
How to fix
- Start
llama-serverwith--jinjato use the Jinja template embedded in the GGUF (tool calling usually depends on it) - If the template is broken, pass
--chat-template-filewith the template from the model’s official repository - Use a newer GGUF from the model publisher or a trusted quantiser
- GUI clients such as LM Studio let you inspect and replace the prompt template in model settings
Official references
Compiled from official documentation and public discussions on 2026-10-10; not yet reproduced in our own environment. Follow the official docs if they differ.