pub struct QuantInfo {
pub scheme: String,
pub stored_bytes: u64,
pub dequantized_bytes: u64,
}Expand description
Quantization scheme + size estimates for a cached .safetensors file.
Populated by inspect_safetensors_local (the cache-hit path) via
anamnesis::InspectInfo::from(&header). Absent (None) when:
- the safetensors file has no detected quantization (
QuantScheme::Unquantized), - the inspect ran over HTTP Range (the remote path’s bespoke parser doesn’t go through anamnesis until v0.11.1), or
- the file format isn’t safetensors (
GGUF/NPZ/PTHcarry no quant-method metadata).
Decoupled from anamnesis::QuantScheme (a #[non_exhaustive] enum) so
downstream library consumers (candle-mi, anamnesis) aren’t forced to
match every variant. The scheme field stores QuantScheme’s Display
output ("FineGrainedFp8", "Bnb4", "Gptq", "Awq", …); consumers
that need to match exact variants should call
anamnesis::parse_safetensors_header themselves.
Fields§
§scheme: StringDetected quantization scheme as the Display form of
anamnesis::QuantScheme (e.g. "FineGrainedFp8", "Bnb4").
stored_bytes: u64Bytes stored on disk for tensor data (header excluded).
dequantized_bytes: u64Estimated bytes after dequantising to BF16. For BnB-NF4/FP4
(U8-packed nibbles), this is stored_bytes × 4; for FP8 / GPTQ /
AWQ / BnB-INT8 it’s num_elements × 2 summed over weight
tensors, plus passthrough tensors copied as-is. The formula lives
in anamnesis::InspectInfo::from(&SafetensorsHeader) — hf-fm just
reads the result.