Module util

Source
Expand description

Utilities for interacting with LLMs and loading them.

Structs§

TokenUtf8Buffer
Used to buffer incoming tokens until they produce a valid string of UTF-8 text.

Enums§

FindAllModelFilesError
Errors encountered during the loading process.

Functions§

find_all_model_files
Find all the files related to a model.
has_data_left
Check if there is any data left in the reader.
mmap_populate
mmap with MAP_POPULATE
read_bytes
Read a fixed-size array of bytes from a reader.
read_bytes_with_len
Read a variable-length array of bytes from a reader.
read_f32
Read a f32 from a reader.
read_i32
Read a i32 from a reader.
read_u32
Read a u32 from a reader.
write_f32
Write a f32 from a writer.
write_i32
Write a i32 from a writer.
write_u32
Write a u32 from a writer.