Expand description
Weight loading from safetensors files (SBIO IORouter for filesystem I/O).
Modules§
- adapter
- Split a tensor name into (everything but its last numeric path segment,
that segment as a number) so names sort NUMERICALLY on the index.
embedders.2must precedeembedders.10; a plain lexicographic sort puts10first and silently mis-maps every table after the ninth. PEFT adapter loader:adapter_model.safetensors→WeightStore. - dequant_
cpu - Public for kernel oracles: the CPU reference decoders every GPU dequant is held to. CPU reference dequantization for GGUF/GGML quantized weight blocks.
- expert_
stream - DeepSeek-V4.1 Flash expert streaming from the split GGUF, by positional read.
Structs§
- Deferred
Tensor - Where a skipped tensor lives, so a consumer can read it in place.
- Derived
Store - Device buffers a loader derived from this store’s tensors.
- Gguf
Loader - Loads weights from a GGUF file, dequantizing every tensor to BF16 on the GPU.
- Gguf
Shard Set - One resolved split-GGUF file set, in
split.noorder. - K3Safetensors
Loader - KvScale
Census - 2026-09-28: Every attention layer whose scales
resolve_kv_scale_keysfinds, keyed by attention prefix. - KvScale
Keys - 2026-09-28: The two store keys one attention layer’s scales are read from.
- Safetensors
Loader - Loads weights from safetensors files using mmap.
- Weight
Store - All model weights loaded onto the GPU, keyed by HuggingFace name.
- Weight
Tensor - A weight tensor on the GPU.
Enums§
- KvScale
Spelling - 2026-09-28: How a checkpoint names one layer’s K/V scale pair.
- Weight
Dtype - Data type of a weight tensor.
Traits§
- Weight
Loader - SBIO IORouter trait for weight loading.
Functions§
- auto_
detect_ weight_ prefix - Resolve the weight-key prefix a nested (multimodal) checkpoint uses.
- config_
from_ gguf_ dir - 2026-09-26: Build a
ModelConfigfrom the.ggufthatfind_ggufpicks inmodel_dir. - find_
gguf - Locate the backbone GGUF weight file in
dir. Returns the lexicographically-first non-mmproj*.gguf(also the first shard,*-00001-of-*, of a split file). The mmproj vision sidecar is excluded here and loaded separately (seesidecar::find_mmproj); a dir that is only an mmproj falls back to the first file so the caller still gets a path to error on. - find_
gguf_ shards - Resolve every shard of a split GGUF, given the first one.
- is_
ngram_ table - Whether a tensor is an n-gram embedding TABLE — the huge blobs that are served off NVMe instead of being uploaded with the rest of the checkpoint.
- kv_
scale_ census - 2026-09-28: Parse every name that ends in a known scale suffix to its
attention prefix (most specific spelling first), then resolve each prefix
with
resolve_kv_scale_keys. Any layer that resolver rejects fails the census. - parse_
expert_ index - Parse expert index from tensor name (e.g. “model.layers.3.mlp.experts.42.gate_proj.weight” → 42).
- resolve_
kv_ scale_ keys - 2026-09-28: The scale keys of the attention layer at
attn_prefix.
Type Aliases§
- Defer
Hook - A model loader’s answer to “which tensors will I read from disk myself?”.