Skip to main content

QuantModelDesc

Struct QuantModelDesc 

Source
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: String

Architecture name, e.g. "llama".

§n_embd: u32

Embedding dimension.

§n_ff: u32

Feed-forward dimension.

§n_layer: u32

Number of layers.

§n_head: u32

Number of attention heads.

§n_head_kv: u32

Number of key/value heads.

§n_expert: u32

Number of experts (0 for a dense model).

§n_embd_head_k: u32

Per-head key dimension.

§n_embd_head_v: u32

Per-head value dimension.

Implementations§

Source§

impl QuantModelDesc

Source

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.

Source

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

Source§

fn clone(&self) -> QuantModelDesc

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QuantModelDesc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for QuantModelDesc

Source§

impl PartialEq for QuantModelDesc

Source§

fn eq(&self, other: &QuantModelDesc) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for QuantModelDesc

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more