Skip to main content

READ_BUF_CAPACITY

Constant READ_BUF_CAPACITY 

Source
pub const READ_BUF_CAPACITY: usize = _; // 1_048_576usize
Expand description

Capacity every model crate should wrap its BufReader<File> with before parsing a GGUF file. Header/metadata parsing is hundreds to thousands of few-byte read_u32/read_u64 calls (one per tensor dim, name length, metadata value, …); the default 8 KiB BufReader capacity is fine for small files but forces a syscall every few tensors on models with hundreds of them. 1 MiB comfortably covers any GGUF header in one underlying read while staying small relative to the model file itself.