Skip to main content

Arch

Struct Arch 

Source
pub struct Arch {
Show 19 fields pub arch: String, pub block_count: u64, pub context_length: u64, pub embedding_length: u64, pub feed_forward_length: u64, pub head_count: u64, pub head_count_kv: u64, pub head_dim: u64, pub rms_eps: f32, pub rope_freq_base: f32, pub value_length: u64, pub rope_dimension_count: u64, pub full_attention_interval: u64, pub nextn_predict_layers: u64, pub ssm_conv_kernel: u64, pub ssm_state_size: u64, pub ssm_group_count: u64, pub ssm_time_step_rank: u64, pub ssm_inner_size: u64,
}
Expand description

The transformer architecture fields the hand-written model lanes read from GGUF metadata. Every field is a key under the architecture prefix and reads 0 (or the documented default) when absent.

Fields§

§arch: String§block_count: u64§context_length: u64

context_length — the trained context window (Qwen3.8: 262144).

§embedding_length: u64§feed_forward_length: u64§head_count: u64§head_count_kv: u64§head_dim: u64§rms_eps: f32§rope_freq_base: f32§value_length: u64

attention.value_length — V head dim, which need not equal the K head dim.

§rope_dimension_count: u64

rope.dimension_count — how many of each head’s dims actually rotate. Qwen3.8 rotates 64 of 256; treating this as the full head_dim silently corrupts three quarters of every query and key.

§full_attention_interval: u64

full_attention_interval — every Nth block is full attention, the rest are linear (Gated DeltaNet). Qwen3.8: 4, so blocks 3, 7, 11 … are attention and the other 48 are GDN.

§nextn_predict_layers: u64

nextn_predict_layers — MTP draft blocks appended to block_count. Qwen3.8 ships 1, inside the same file, so block_count (65) is one MORE than the model’s real depth (64).

§ssm_conv_kernel: u64

ssm.conv_kernel — taps in GDN’s depthwise causal conv (4).

§ssm_state_size: u64

ssm.state_size — the D of each head’s D×D associative memory (128).

§ssm_group_count: u64

ssm.group_count — GDN key heads (16).

§ssm_time_step_rank: u64

ssm.time_step_rank — GDN value heads (48). Three value heads share each key head.

§ssm_inner_size: u64

ssm.inner_size — the GDN value width, time_step_rank · state_size (6144).

Implementations§

Source§

impl Arch

Source

pub fn model_layers(&self) -> u64

Blocks that are actually part of the model — block_count minus the MTP draft blocks appended to it.

Source

pub fn is_full_attention_layer(&self, l: u64) -> bool

Is block l a full-attention block? With full_attention_interval = N, every Nth block is, counting from 1, i.e. indices N-1, 2N-1, …. A checkpoint without the key is uniformly full attention.

Trait Implementations§

Source§

impl Clone for Arch

Source§

fn clone(&self) -> Arch

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Arch

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Arch

§

impl RefUnwindSafe for Arch

§

impl Send for Arch

§

impl Sync for Arch

§

impl Unpin for Arch

§

impl UnsafeUnpin for Arch

§

impl UnwindSafe for Arch

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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,