ἵστωρ Download

What is a chat template?

The wrapper a model was trained to expect around a conversation, invisible until it goes missing.

A chat template is the text wrapper a model was trained to expect around a conversation: markers that show where the system instructions start, where each speaker's turn begins and ends, and where the model should write its reply. Models are tuned with a particular wrapper, and reading messages in that shape is what they answer to. Tools apply it for you, which is why you never see it.

The shape a model expects.

A base model predicts text; making it a chat model means tuning it on conversations until questions get answers. Those conversations arrive in a specific format, with special markers between the system instructions, the user's turn, and the model's reply. The template is that format. It is why a model stops at the end of its own turn instead of writing both sides of the conversation forever, and why it treats your instructions as coming from you. The model is not reasoning about a chat window; it is continuing text in the shape it learned, and the template defines that shape.

Where it travels, and where it goes wrong.

The template belongs to the model, not to the tool, so it ships inside the model file: what a GGUF file is covers how the metadata travels with the weights. That placement solves a real problem, because model families use different markers, and a runner that guesses the wrong one feeds the model text in a shape it never learned. The symptoms are characteristic: the model continues your sentence instead of replying, leaks its role markers into the answer, or ignores the system instructions entirely. When a downloaded model behaves oddly while others work, a mismatched or missing chat template is the first suspect.

What you write, what the tool wraps.

You never handle the template directly. The tool assembles the prompt it builds anyway: the system instructions it was configured with, then your messages, then the opening of the model's turn, all wrapped in the markers the model's file specified. The wrapper is mechanical and the briefing is editorial; the first decides how the text is marked, the second decides what the text asks for. Both reach the model as one continuous input, which is why an odd behavior can come from either side and the template is worth knowing about when diagnosing which.