Expand description
Container metadata and lazy byte access, independent of model execution.
Readers preserve names and metadata. Architecture adapters assign tensor roles and interpret quantization conventions after reading the container.
Modules§
- discovery
- Store-defined model discovery, separate from reading tensor bytes.
- gguf 🔒
- Header-only GGUF inspection. Tensor codecs are identified, never treated as interchangeable with MLX affine Q4. Execution/conversion is not implemented.
- mlx
- MLX affine conventions over a safetensors inventory. This adapter does not interpret architecture-specific names or choose execution precision.
- safetensor 🔒
- source 🔒
- tensor 🔒
Structs§
- Checkpoint
- A local container inventory with the mappings backing its tensor data.
- Data
Span - A byte range within one object; offsets are independent of tensor encoding.
- Inventory
- Container metadata and tensor descriptors whose bytes remain in a separate source.
- Mapped
Bytes - A byte range that keeps its backing mapping alive after the source is dropped. The backing file must remain unchanged for the lifetime of every clone.
- Mapped
Objects - Read-only file mappings, numbered in the order passed to
Self::open. - Object
Id - Identifies an object within an opened checkpoint. It is not a filename or a content digest; a store can assign content identities while copying it.
- Object
Info - An object’s identity and total size within a byte source.
- Stored
Tensor - Byte strides also describe interleaved records without introducing a table-specific layout or treating packed 4-bit values as addressable bytes.
- Tensor
- A logical tensor and the physical storage used to represent its values.
- Tensor
Id - Index of a tensor in its containing inventory or model description.
- Tensor
Type - Logical values are distinct from the physical types used to encode them.
Enums§
- Affine
Offset - Per-group offset used to reconstruct affine-quantized values.
- BitPacking
- Placement of quantized codes within addressable storage words.
- Container
Format - Container format identified before applying model-specific conventions.
- Dtype
- Scalar types supported by physical tensor views.
- Ggml
Encoding - Recognized GGML element and block encodings; unknown numeric codes are preserved.
- Tensor
Encoding - Storage layout and quantization metadata, with explicit references to all data.
- Tensor
Role - An architecture-assigned tensor role, independent of its checkpoint name.
Traits§
- Byte
Source - Object IDs belong to one source; they are neither paths nor content hashes. A copy/import operation must rebind them to its destination’s identities.
Functions§
- read_
safetensors - Read one safetensors header through a byte source. Tensor payloads remain in that source; successful inspection does not claim their bytes were verified.