# Chat Template

> A chat template is the model-specific format that converts a list of role-tagged messages, such as system, user, and assistant turns, into the exact token sequence with special control tokens that the model was fine-tuned on.

- Identifier: PTL-0107
- Category: Foundations
- Canonical URL: https://protologue.com/t/chat-template/
- Also known as: prompt format, chat format, conversation template

## Description

Hosted chat APIs apply the template for you, but when running open-weight models directly, using the wrong template, or none, can noticeably degrade instruction following because the model sees input unlike its training data. Templates also determine how system prompts, tool calls, and tool results are marked, and where the model expects to begin its reply.

## Related terms

- [System Prompt](https://protologue.com/t/system-prompt/)
- [Base Model](https://protologue.com/t/base-model/)
- [Instruction Tuning](https://protologue.com/t/instruction-tuning/)
- [Delimiters](https://protologue.com/t/delimiters/)

## Sources

- Hugging Face (2023). Chat templates. https://huggingface.co/docs/transformers/en/chat_templating

## Cite this entry

Protologue. (2026). Chat Template. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.4.0, PTL-0107). https://protologue.com/t/chat-template/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
