Expand description
Render a model’s own chat template (the GGUF’s tokenizer.chat_template,
Jinja) into a prompt. Pure, so it is tested without loading a model.
Using the model’s own template (instead of a generic one) is what
makes the model answer in its trained format, and what lets callers
pass template switches such as enable_thinking.
Structs§
- Template
Error - A template that failed to compile or render.
- Template
Vars - Special tokens some templates reference (
{{ bos_token }}).
Functions§
- merge_
kwargs - Model defaults overlaid with the request’s own kwargs (request wins).
- render_
chat - Render
messageswithtemplate, ending in the assistant turn.kwargsare extra template variables (e.g.enable_thinking).