Skip to main content

Qwen35Config

Struct Qwen35Config 

Source
pub struct Qwen35Config {
Show 26 fields pub vocab_size: usize, pub hidden_size: usize, pub intermediate_size: usize, pub num_hidden_layers: usize, pub nextn_predict_layers: usize, pub num_attention_heads: usize, pub num_key_value_heads: usize, pub key_length: usize, pub value_length: usize, pub max_position_embeddings: usize, pub rms_norm_eps: f64, pub rope_theta: f64, pub rope_dim_count: usize, pub rope_dim_sections: Vec<usize>, pub full_attention_interval: usize, pub ssm_conv_kernel: usize, pub ssm_group_count: usize, pub ssm_inner_size: usize, pub ssm_state_size: usize, pub ssm_time_step_rank: usize, pub tie_word_embeddings: bool, pub num_experts: usize, pub num_experts_used: usize, pub expert_ffn_size: usize, pub shared_expert_ffn_size: usize, pub expert_weights_scale: f32,
}
Expand description

Qwen3.5 model config — fields covering both the per-layer Mamba+ Attention block and the MTP head.

Fields§

§vocab_size: usize§hidden_size: usize§intermediate_size: usize§num_hidden_layers: usize

Total layer count (= main layers + nextn_predict_layers MTP heads).

§nextn_predict_layers: usize

Layers at index < num_hidden_layers - nextn_predict_layers use the hybrid Mamba+Attention block. The remaining nextn_predict_layers layers use standard attention for MTP.

§num_attention_heads: usize§num_key_value_heads: usize§key_length: usize

Per-head Q dim. The MTP attention head uses this.

§value_length: usize

Per-head V dim.

§max_position_embeddings: usize§rms_norm_eps: f64§rope_theta: f64§rope_dim_count: usize§rope_dim_sections: Vec<usize>§full_attention_interval: usize

Some Qwen3.5 layers do full attention every N blocks (interspersed with the Mamba-style blocks). Read but not yet acted on.

§ssm_conv_kernel: usize§ssm_group_count: usize§ssm_inner_size: usize§ssm_state_size: usize§ssm_time_step_rank: usize§tie_word_embeddings: bool§num_experts: usize

MoE (qwen35moe): routed expert count. Zero for dense models.

§num_experts_used: usize

Top-k experts activated per token.

§expert_ffn_size: usize

Per-expert FFN inner dim (qwen35.expert_feed_forward_length).

§shared_expert_ffn_size: usize

Shared-expert FFN inner dim (qwen35.expert_shared_feed_forward_length).

§expert_weights_scale: f32

Router weight multiplier applied after softmax (llama.cpp default 1.0).

Implementations§

Source§

impl Qwen35Config

Source

pub fn from_gguf(raw: &GgufFile) -> Result<Qwen35Config, Error>

Read from a GGUF file with general.architecture in {qwen35, qwen35moe, qwen36, qwen36moe}. Qwen3.6 reuses the Qwen3.5 trunk; only the metadata-key prefix differs (qwen36.* vs qwen35.*). Returns an error when any required key is missing.

Source

pub fn is_moe(&self) -> bool

True when the GGUF arch is qwen35moe.

Source

pub fn expert_ffn_dim(&self) -> usize

Routed-expert SwiGLU inner width.

Source

pub fn shared_expert_ffn_dim(&self) -> usize

Shared-expert SwiGLU inner width.

Source

pub fn mtp_layer_start(&self) -> Option<usize>

Index of the first MTP layer (= num_hidden_layers - nextn_predict_layers). Returns None when the file has no MTP heads.

Source

pub fn from_hf_config_json(path: &Path) -> Result<Qwen35Config, Error>

Read from a HuggingFace config.json (the safetensors distribution counterpart to GGUF metadata). Maps the standard HF Qwen2.x / Qwen3.x field names; unknown fields fall back to the same defaults used by Self::from_gguf. PLAN.md M1 safetensors load path (HauhauCS catalog rows).

Trait Implementations§

Source§

impl Clone for Qwen35Config

Source§

fn clone(&self) -> Qwen35Config

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 Qwen35Config

Source§

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

Formats the value using the given formatter. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

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, 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

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

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

Source§

fn vzip(self) -> V