Skip to content

Bitcoin accepted at checkout  |  Ships from Laval, QC, Canada  |  Expert support since 2016

Chat Template

Sovereign AI

Definition

A chat template is the formatting specification that turns a structured list of messages — each tagged with a role such as system, user, or assistant — into the single flat string of tokens a chat-tuned model actually expects. It is the often-invisible layer between a clean conversation object and the raw prompt fed to the model. Get it wrong and a perfectly capable model produces rambling, confused, or truncated output.

Why every model is different

There is no universal format. The ChatML convention popularized by OpenAI uses role markers, but different model families adopt different control tokens and delimiters even when fine-tuned from the same base. Modern toolchains express the template as a Jinja string bundled with the tokenizer, so applying it programmatically guarantees the exact spacing, role markers, and special tokens the model saw during training. This is why you should rely on the model's own template rather than hand-assembling prompts.

Local-inference pitfalls

For sovereign Bitcoiners running models on their own hardware, the chat template is a common failure point. A mismatched template — using one model's format with another's weights — silently wrecks quality. The template already inserts the necessary structural markers, so re-adding them during tokenization creates duplicates that hurt performance. When self-hosting, always confirm the template matches the checkpoint exactly.

Chat templates are assembled from the model's reserved special tokens, and the role-marker handling depends directly on how the tokenizer vocabulary was defined.

In Simple Terms

A chat template is the formatting specification that turns a structured list of messages — each tagged with a role such as system, user, or…

Explore the Full Glossary

Browse all Bitcoin mining terms from A to Z. Whether you are a beginner or expert, deepen your understanding of the mining ecosystem.

Mining Glossary

ASIC Miner Database

Compare 500+ miners with real-time profitability data, home mining scores, and detailed specs.

Compare Miners