Skip to main content

Module chat_template

Module chat_template 

Source

Structs§

ChatTemplateOptions
ModelChatTemplate
Model-provided chat template, usually from GGUF or Hugging Face metadata.
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
Resolved reasoning behavior of the model-owned template and output protocol. Unknown is not equivalent to a template that explicitly has no reasoning mode.
ReasoningEffort
Standard reasoning effort vocabulary. A request’s omitted or null effort is represented by Option::None, separately from the explicit "none" value.
ReasoningEffortSupport
An explicit model contract, independent of its output parser or whether a template happens to interpolate an effort variable. Unknown support must not be treated as a declaration that a requested effort is unsupported.

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