Module capabilities

Module capabilities 

Source
Expand description

Model capability detection and inference.

Capabilities describe model constraints derived from chat templates. Absence of a capability MUST NOT trigger behavior changes.

§Invariant

Message rewriting is only permitted when model capabilities explicitly forbid the current message structure. Default behavior is pass-through.

Structs§

ChatMessage
A chat message for transformation.
ModelCapabilities
Model capabilities inferred from chat template analysis.

Functions§

infer_from_chat_template
Infer model capabilities from chat template Jinja source and model name.
merge_consecutive_system_messages 🔒
Merge consecutive system messages into a single message.
transform_messages_for_capabilities
Transform chat messages based on model capabilities.