Skip to main content

Module gguf

Module gguf 

Source
Expand description

A minimal GGUF header reader: enough to pull the architecture, context length, chat-template presence, and file type without loading the weights.

Values are little-endian. The reader streams over a buffered file handle and seeks past values it does not need, so it never reads the tensor data.

Functionsยง

gguf_facts
Read the architecture, context length, chat-template presence, and the quantization from a GGUF header. Returns None if the file is not a valid GGUF (v2+) header.
gguf_general_architecture
The general.architecture value from a GGUF header, if any.
has_ggml_magic
Whether the file begins with the legacy GGML magic bytes (lmgg is the little-endian byte order of the ggml magic).
has_gguf_magic
Whether the file begins with the GGUF magic bytes.