Skip to main content

Module chat_template

Module chat_template 

Source

Structs§

ChatTemplateOptions
ModelChatTemplate
PromptFunctionCall
PromptMessage
Common prompt-message shape used by both CLI run and OpenAI serve.
PromptToolCall
Tool-call shape exposed to model chat templates.

Enums§

ModelReasoningProtocol
Model-provided chat template, usually from GGUF tokenizer.chat_template or HuggingFace tokenizer_config.json.

Functions§

render_chat_prompt
Render OpenAI-style chat messages into the prompt string the model was trained on.
render_chat_prompt_with_model_template
render_chat_prompt_with_model_template_options
render_chat_prompt_with_tools
render_chat_prompt_with_tools_and_model_template
render_prompt_messages
Render common chat messages into the prompt string the model was trained on. Prefer a model-provided chat template when available; otherwise use a centralized legacy fallback for model families ferrum already supports.
render_prompt_messages_with_options