{
  "id": "chat-template",
  "code": "PTL-0107",
  "term": "Chat Template",
  "aliases": [
    "prompt format",
    "chat format",
    "conversation template"
  ],
  "category": "foundations",
  "definition": "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.",
  "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.",
  "example": null,
  "broader": [],
  "narrower": [],
  "related": [
    "system-prompt",
    "base-model",
    "instruction-tuning",
    "delimiters"
  ],
  "introduced": null,
  "added": "2026-10-10",
  "sources": [
    {
      "title": "Chat templates",
      "authors": "Hugging Face",
      "year": 2023,
      "url": "https://huggingface.co/docs/transformers/en/chat_templating"
    }
  ],
  "url": "https://protologue.com/t/chat-template/",
  "citation": "Protologue. (2026). Chat Template. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.4.0, PTL-0107). https://protologue.com/t/chat-template/"
}