Skip to main content

Module quantize

Module quantize 

Source
Expand description

Model quantization write-path over ik’s llama_model_quantize.

The anchor crate (utilityai/llama-cpp-rs, llama-cpp-2) ships no quantize wrapper, so this is implemented fresh in the crate’s module-local style (own thiserror error, builder over the raw params struct, as_raw escape hatch), mirroring crate::gguf and crate::model::params.

Quantizing a source GGUF (usually f16/bf16/higher precision) produces a smaller GGUF at output. ik_llama.cpp extends the upstream params struct with many fork-specific per-tensor override fields (attn_*_type, ffn_*_type, token_embedding_type, …) plus extra flags; those keep the values from llama_model_quantize_default_params() unless the caller reaches through LlamaQuantizeParams::as_raw_mut.

Modules§

ftype
Common llama_ftype target types, re-exported from the sys crate.

Structs§

LlamaQuantizeParams
Parameters controlling a quantize run.

Enums§

QuantizeError
Errors returned by quantize.

Functions§

quantize
Quantize the GGUF model at input, writing the result to output.