public static quantize(source as Path, destination as Path, options as QuantizationOptions = null) as QuantizationReport
Converts a local Safetensors file or a Hugging Face checkpoint directory. A directory output retains configuration/tokenizer files and includes a quantization.json manifest with the exact scheme, original dtypes, scales and per-shard SHA-256. Missing or invalid shards abort the operation. Publication is atomic in the destination's parent. Existing outputs are never replaced, and a failed conversion does not publish partial weights. Working data buffers are bounded by options.bufferBytes, plus scale and header metadata; they do not grow with the largest tensor or model.
| Parameter | Description |
|---|---|
source | Local file or complete model snapshot directory. |
destination | New file or new directory, matching the source kind. |
options | Q8 group size, buffer budget and progress settings. |
Size and reconstruction-error summary after successful publication.
report = Quantizer.quantize(Path("model.safetensors"), Path("model-q8.safetensors"), QuantizationOptions(verbose=false))