Skip to main content

BaseRTModelConfig

Struct BaseRTModelConfig 

Source
#[repr(C)]
pub struct BaseRTModelConfig {
Show 131 fields pub dim: u32, pub n_layers: u32, pub n_heads: u32, pub n_kv_heads: u32, pub head_dim: u32, pub q_dim: u32, pub kv_dim: u32, pub ffn_dim: u32, pub vocab_size: u32, pub max_seq_len: u32, pub norm_eps: c_float, pub rope_theta: c_float, pub sliding_window_pattern: u32, pub sliding_window: u32, pub rope_local_theta: c_float, pub architecture: [c_char; 32], pub enc_n_layers: u32, pub enc_n_heads: u32, pub enc_dim: u32, pub enc_ffn_dim: u32, pub n_mels: u32, pub enc_max_seq_len: u32, pub n_embd_per_layer: u32, pub n_layer_kv_from_start: u32, pub logit_softcap: c_float, pub attention_scale: c_float, pub head_dim_swa: u32, pub head_dim_global: u32, pub global_rope_partial_factor: c_float, pub swa_layers: [u8; 64], pub ffn_dims: [u32; 128], pub n_kv_heads_per_layer: [u32; 128], pub attn_output_gate: u8, pub _qwen35_pad: [u8; 3], pub partial_rotary_factor: c_float, pub full_attention_interval: u32, pub linear_attn_layers: [u8; 64], pub gdn_num_k_heads: u32, pub gdn_num_v_heads: u32, pub gdn_key_head_dim: u32, pub gdn_value_head_dim: u32, pub gdn_conv_kernel: u32, pub ssm_state_size: u32, pub ssm_conv_kernel: u32, pub ssm_num_groups: u32, pub ssm_inner_size: u32, pub ssm_num_heads: u32, pub n_experts: u32, pub n_experts_used: u32, pub n_experts_shared: u32, pub expert_ffn_dim: u32, pub expert_gating: u8, pub norm_topk_prob: u8, pub _moe_pad: [u8; 2], pub expert_weights_scale: c_float, pub vision_n_layers: u32, pub vision_dim: u32, pub vision_n_heads: u32, pub vision_head_dim: u32, pub vision_ffn_dim: u32, pub vision_patch_size: u32, pub vision_image_size: u32, pub vision_pooling_kernel: u32, pub vision_soft_tokens: u32, pub vision_norm_eps: c_float, pub vision_rope_theta: c_float, pub vision_pos_embed_size: u32, pub image_token_id: u32, pub boi_token_id: u32, pub eoi_token_id: u32, pub vision_arch: u32, pub vision_spatial_merge: u32, pub vision_temporal_patch: u32, pub vision_out_dim: u32, pub audio_n_layers: u32, pub audio_dim: u32, pub audio_n_heads: u32, pub audio_head_dim: u32, pub audio_ffn_dim: u32, pub audio_output_proj_dim: u32, pub audio_chunk_size: u32, pub audio_left_context: u32, pub audio_conv_kernel: u32, pub audio_soft_tokens: u32, pub audio_logit_softcap: c_float, pub audio_norm_eps: c_float, pub audio_gradient_clip: c_float, pub audio_residual_weight: c_float, pub audio_ms_per_token: c_float, pub audio_sscp_channels: [u32; 2], pub audio_token_id: u32, pub boa_token_id: u32, pub eoa_token_id: u32, pub mrope_section: [u32; 3], pub mrope_interleaved: u8, pub _mrope_pad: [u8; 3], pub rope_scaling_factor: c_float, pub rope_low_freq_factor: c_float, pub rope_high_freq_factor: c_float, pub rope_orig_max_pos: u32, pub rope_scaling_type: u32, pub qk_scale_factor: c_float, pub output_multiplier: c_float, pub post_norm_eps: c_float, pub nope_layers: [u8; 64], pub embed_norm_eps: c_float, pub vision_window_layers: [u8; 64], pub vision_window_size: u32, pub vision_pos_embed_h: u32, pub vision_pos_embed_w: u32, pub vision_adapter_dim: u32, pub video_token_id: u32, pub q_lora_rank: u32, pub kv_lora_rank: u32, pub qk_nope_head_dim: u32, pub qk_rope_head_dim: u32, pub v_head_dim: u32, pub routed_scaling_factor: c_float, pub first_k_dense_replace: u32, pub nextn_predict_layers: u32, pub indexer_head_count: u32, pub indexer_key_length: u32, pub indexer_top_k: u32, pub rope_yarn_beta_fast: f32, pub rope_yarn_beta_slow: f32, pub swiglu_limit: f32, pub swiglu_alpha: f32, pub attention_sinks: u8, pub attention_bias: u8, pub rope_yarn_truncate: u8, pub _gptoss_pad: u8,
}
Expand description

Model configuration extracted from weight file metadata.

This mirrors the FULL BaseRTModelConfig in include/baseRT/types.h. The struct is returned BY VALUE from baseRT_get_config, so it MUST match the C layout exactly — a truncated copy makes the C side write past the Rust allocation (memory corruption). Earlier revisions of this binding dropped sliding_window and every field after the encoder block; do not reintroduce that. New fields in C are appended at the end (#[repr(C)] keeps offsets).

Fields§

§dim: u32§n_layers: u32§n_heads: u32§n_kv_heads: u32§head_dim: u32§q_dim: u32§kv_dim: u32§ffn_dim: u32§vocab_size: u32§max_seq_len: u32§norm_eps: c_float§rope_theta: c_float§sliding_window_pattern: u32§sliding_window: u32§rope_local_theta: c_float§architecture: [c_char; 32]§enc_n_layers: u32§enc_n_heads: u32§enc_dim: u32§enc_ffn_dim: u32§n_mels: u32§enc_max_seq_len: u32§n_embd_per_layer: u32§n_layer_kv_from_start: u32§logit_softcap: c_float§attention_scale: c_float§head_dim_swa: u32§head_dim_global: u32§global_rope_partial_factor: c_float§swa_layers: [u8; 64]§ffn_dims: [u32; 128]§n_kv_heads_per_layer: [u32; 128]§attn_output_gate: u8§_qwen35_pad: [u8; 3]§partial_rotary_factor: c_float§full_attention_interval: u32§linear_attn_layers: [u8; 64]§gdn_num_k_heads: u32§gdn_num_v_heads: u32§gdn_key_head_dim: u32§gdn_value_head_dim: u32§gdn_conv_kernel: u32§ssm_state_size: u32§ssm_conv_kernel: u32§ssm_num_groups: u32§ssm_inner_size: u32§ssm_num_heads: u32§n_experts: u32§n_experts_used: u32§n_experts_shared: u32§expert_ffn_dim: u32§expert_gating: u8§norm_topk_prob: u8§_moe_pad: [u8; 2]§expert_weights_scale: c_float§vision_n_layers: u32§vision_dim: u32§vision_n_heads: u32§vision_head_dim: u32§vision_ffn_dim: u32§vision_patch_size: u32§vision_image_size: u32§vision_pooling_kernel: u32§vision_soft_tokens: u32§vision_norm_eps: c_float§vision_rope_theta: c_float§vision_pos_embed_size: u32§image_token_id: u32§boi_token_id: u32§eoi_token_id: u32§vision_arch: u32§vision_spatial_merge: u32§vision_temporal_patch: u32§vision_out_dim: u32§audio_n_layers: u32§audio_dim: u32§audio_n_heads: u32§audio_head_dim: u32§audio_ffn_dim: u32§audio_output_proj_dim: u32§audio_chunk_size: u32§audio_left_context: u32§audio_conv_kernel: u32§audio_soft_tokens: u32§audio_logit_softcap: c_float§audio_norm_eps: c_float§audio_gradient_clip: c_float§audio_residual_weight: c_float§audio_ms_per_token: c_float§audio_sscp_channels: [u32; 2]§audio_token_id: u32§boa_token_id: u32§eoa_token_id: u32§mrope_section: [u32; 3]§mrope_interleaved: u8§_mrope_pad: [u8; 3]§rope_scaling_factor: c_float§rope_low_freq_factor: c_float§rope_high_freq_factor: c_float§rope_orig_max_pos: u32§rope_scaling_type: u32§qk_scale_factor: c_float§output_multiplier: c_float§post_norm_eps: c_float§nope_layers: [u8; 64]§embed_norm_eps: c_float§vision_window_layers: [u8; 64]§vision_window_size: u32§vision_pos_embed_h: u32§vision_pos_embed_w: u32§vision_adapter_dim: u32§video_token_id: u32§q_lora_rank: u32§kv_lora_rank: u32§qk_nope_head_dim: u32§qk_rope_head_dim: u32§v_head_dim: u32§routed_scaling_factor: c_float§first_k_dense_replace: u32§nextn_predict_layers: u32§indexer_head_count: u32§indexer_key_length: u32§indexer_top_k: u32§rope_yarn_beta_fast: f32§rope_yarn_beta_slow: f32§swiglu_limit: f32§swiglu_alpha: f32§attention_sinks: u8§attention_bias: u8§rope_yarn_truncate: u8§_gptoss_pad: u8

Trait Implementations§

Source§

impl Clone for BaseRTModelConfig

Source§

fn clone(&self) -> Self

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 Copy for BaseRTModelConfig

Source§

impl Debug for BaseRTModelConfig

Source§

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

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