pub struct QuantModelDesc {
pub architecture: String,
pub n_embd: u32,
pub n_ff: u32,
pub n_layer: u32,
pub n_head: u32,
pub n_head_kv: u32,
pub n_expert: u32,
pub n_embd_head_k: u32,
pub n_embd_head_v: u32,
}Expand description
Shape of a synthetic model, for previewing a quantization plan without a real checkpoint on disk.
Upstream marks llama_quant_model_from_metadata as being for testing; it is
exposed here for the same reason — it lets you ask “what would a Q4_K_M of a
model this shape look like?” without downloading one.
Fields§
§architecture: StringArchitecture name, e.g. "llama".
n_embd: u32Embedding dimension.
n_ff: u32Feed-forward dimension.
n_layer: u32Number of layers.
n_head: u32Number of attention heads.
n_head_kv: u32Number of key/value heads.
n_expert: u32Number of experts (0 for a dense model).
n_embd_head_k: u32Per-head key dimension.
n_embd_head_v: u32Per-head value dimension.
Implementations§
Source§impl QuantModelDesc
impl QuantModelDesc
Sourcepub fn llama(n_embd: u32, n_ff: u32, n_layer: u32, n_head: u32) -> Self
pub fn llama(n_embd: u32, n_ff: u32, n_layer: u32, n_head: u32) -> Self
A dense llama-shaped descriptor with the given dimensions.
Sourcepub fn build(&self) -> Result<LlamaModel, QuantPreviewError>
pub fn build(&self) -> Result<LlamaModel, QuantPreviewError>
Build a synthetic model from this descriptor.
The returned model owns llama.cpp memory and frees it on drop, exactly like a loaded one — it simply has no weights.
§Errors
Returns QuantPreviewError::MockModel if llama.cpp rejects the
descriptor, or QuantPreviewError::Nul for a bad architecture name.
Trait Implementations§
Source§impl Clone for QuantModelDesc
impl Clone for QuantModelDesc
Source§fn clone(&self) -> QuantModelDesc
fn clone(&self) -> QuantModelDesc
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more