Skip to content
HomeBriefFor youTrackersTopicsCompaniesGlossaryNewsletterSecurityHealth & medicineFinance & marketsRoboticsModels & researchPolicy & regulationEnterprise & businessDeveloper tools
Glossary

Chat template

The text template, usually Jinja, stored with a model that formats system, user and assistant turns into the token sequence the model was trained on.

Every chat model expects its conversation in a specific layout of special tokens; the template encodes it so that inference software can build prompts correctly. Because the template is interpreted at run time and can include logic, it is executable policy: it can inject a system message, alter instructions conditionally, or, as in the timdedid campaign on Hugging Face in November 2026, insert a fake 'system directive' only when the user's message contains a trigger phrase. Treat a downloaded model's template as code: diff it against the base model's and pin a reviewed copy with llama.cpp's --chat-template-file or an Ollama Modelfile TEMPLATE.

← All terms

Get the brief in your inbox

One email every morning: the stories that mattered in AI, each with a one-line "why it matters" for your role. Free, no ads, unsubscribe any time.

Published daily by AI Briefing. We never share your address.
Like this? Get tomorrow's brief by email, free.