Skip to main content

Module chat

Module chat 

Source
Expand description

Chat templates (llama_chat_apply_template).

Mirrors the llama-cpp-2 anchor’s chat-template API (LlamaChatMessage, LlamaChatTemplate, [LlamaModel::chat_template], [LlamaModel::apply_chat_template]), adapted to ik_llama.cpp’s C signatures.

Structs§

LlamaChatMessage
A safe wrapper around llama_chat_message.
LlamaChatTemplate
A performance-friendly wrapper around LlamaModel::chat_template which is then fed into LlamaModel::apply_chat_template to convert a list of messages into an LLM prompt. Internally the template is stored as a CString to avoid round-trip conversions within the FFI.

Enums§

ApplyChatTemplateError
Failed to apply a chat template (see LlamaModel::apply_chat_template).
NewLlamaChatMessageError
Failed to construct a LlamaChatMessage.