pub struct GgufHyperparams {Show 24 fields
pub n_layer: u32,
pub n_embd: u32,
pub n_head: u32,
pub n_kv_head: u32,
pub rope_freq_base: f32,
pub rope_scale: f32,
pub head_dim: u32,
pub head_dim_swa: u32,
pub sliding_window: u32,
pub shared_kv_layers: u32,
pub logit_softcap: f32,
pub ssm_conv_kernel: u32,
pub ssm_state_size: u32,
pub ssm_group_count: u32,
pub ssm_time_step_rank: u32,
pub ssm_inner_size: u32,
pub full_attention_interval: u32,
pub architecture: u32,
pub arch_flags: u32,
pub rope_dim: u32,
pub rope_dim_swa: u32,
pub rope_freq_base_swa: f32,
pub rms_norm_eps: f32,
pub ple_embd_per_layer: u32,
}Expand description
Architecture hyper-parameters parsed from the GGUF KV section.
Fields§
§n_layer: u32§n_embd: u32§n_head: u32§n_kv_head: u32Grouped-query KV heads; 0 means MHA (n_kv_head == n_head).
rope_freq_base: f32llama.rope.freq_base (FLOAT32 in GGUF); 0 → DEFAULT_ROPE_FREQ_BASE.
rope_scale: f32Linear RoPE scale from llama.rope.scale_linear / llama.rope.scaling.factor; 0 → 1.0.
head_dim: u32Explicit head dim (*.attention.key_length); 0 → derive n_embd / n_head.
head_dim_swa: u32SWA / local-attention head dim (*.attention.key_length_swa); 0 → same as head_dim.
sliding_window: u32Sliding-window size in tokens; 0 → full context attention only.
Last N layers share KV from the last non-shared layer of the same type (Gemma 4).
logit_softcap: f32Final logit softcapping (Gemma 2+); 0 → disabled.
ssm_conv_kernel: u32Qwen hybrid SSM causal-convolution kernel width.
ssm_state_size: u32Qwen GatedDeltaNet recurrent state width.
ssm_group_count: u32Qwen SSM groups and timestep rank.
ssm_time_step_rank: u32§ssm_inner_size: u32Qwen SSM inner projection width.
full_attention_interval: u32Full-attention cadence among hybrid SSM layers (0 means unspecified).
architecture: u32ARCH_*() id from general.architecture (and tensor-feature refinement).
arch_flags: u32ARCH_FLAG_*() bitmask.
rope_dim: u32§rope_dim_swa: u32§rope_freq_base_swa: f32§rms_norm_eps: f32§ple_embd_per_layer: u32Implementations§
Source§impl GgufHyperparams
impl GgufHyperparams
pub fn effective_rope_freq_base(&self) -> f32
pub fn effective_rope_scale(&self) -> f32
pub fn effective_head_dim(&self) -> u32
pub fn head_dim(&self) -> u32
pub fn effective_n_kv_head(&self) -> u32
pub fn q_heads_per_kv(&self) -> u32
pub fn gqa_ratio(&self) -> u32
pub fn head_dim_swa_or(&self) -> u32
pub fn architecture_name(&self) -> &'static str
pub fn decode_supported(&self) -> Result<(), String>
Trait Implementations§
Source§impl Clone for GgufHyperparams
impl Clone for GgufHyperparams
impl Copy for GgufHyperparams
Source§impl Debug for GgufHyperparams
impl Debug for GgufHyperparams
Source§impl Default for GgufHyperparams
impl Default for GgufHyperparams
Source§impl From<GgufHyperparams> for ModelHyperparams
impl From<GgufHyperparams> for ModelHyperparams
Source§fn from(value: GgufHyperparams) -> Self
fn from(value: GgufHyperparams) -> Self
Source§impl From<ModelHyperparams> for GgufHyperparams
impl From<ModelHyperparams> for GgufHyperparams
Source§impl PartialEq for GgufHyperparams
impl PartialEq for GgufHyperparams
impl StructuralPartialEq for GgufHyperparams
Auto Trait Implementations§
impl Freeze for GgufHyperparams
impl RefUnwindSafe for GgufHyperparams
impl Send for GgufHyperparams
impl Sync for GgufHyperparams
impl Unpin for GgufHyperparams
impl UnsafeUnpin for GgufHyperparams
impl UnwindSafe for GgufHyperparams
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> HyperparamsSource for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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