Expand description
GgufFile: mmap-backed reader for a single GGUF file.
Lifecycle:
GgufFile::open(path)— mmaps the file and parses the header. No tensor payloads are read at this stage.architecture(),metadata_*(),tensor_names(),tensor_info()— cheap lookups, all served from the parsed header in memory.read_tensor(name, device)— slices the mmap at the right offset and asks candle to materialise aQTensor(still quantized).
Tensor reads only need a shared &self because the mmap is immutable; the
file is safe to share across threads. (Candle’s Content::tensor wants
a &mut R: Read + Seek, but we satisfy it with a fresh Cursor<&[u8]>
on each call — the cursor’s mutable state is local to the call.)
Structs§
- Gguf
File - Read-only handle to a memory-mapped GGUF file.