class

ML::GGUF::GGUFFile

Inherits Reference / Object

Parsed GGUF file — uses mmap for zero-copy tensor access

Constructors

new(path : String)
Source

Instance methods

close
Source
data_offset
Source
get_float(key : String) : Float64 | Nil

Get float metadata

Source
get_int(key : String) : Int64 | Nil

Get integer metadata

Source
get_string(key : String) : String | Nil

Get string metadata

Source
metadata
Source
path
Source
read_tensor_f32(info : TensorInfo) : Array(Float32)

Read a tensor's data, dequantize to Float32. Uses mmap (zero-copy) when available, falls back to read.

Source
read_tensor_raw(info : TensorInfo) : Bytes

Read raw tensor bytes — zero-copy slice from mmap

Source
tensor(name : String) : TensorInfo | Nil

Find tensor by name

Source
tensors
Source
version
Source