Applied AI·Tokens
if a local model behaves bizarrely, a wrong or missing chat template is the first suspect.
Chat template
The exact textual format a chat model was trained on: how system, user and assistant turns are wrapped in special tokens. APIs apply it invisibly; when self-hosting, using the wrong template silently wrecks output quality.