pub struct ModelMetadata {Show 16 fields
pub architecture: String,
pub hidden_size: usize,
pub intermediate_size: usize,
pub num_hidden_layers: usize,
pub num_attention_heads: usize,
pub num_key_value_heads: usize,
pub vocab_size: usize,
pub max_position_embeddings: usize,
pub rms_norm_eps: f64,
pub rope_theta: f64,
pub tie_word_embeddings: bool,
pub head_dim: usize,
pub attention_bias: bool,
pub bos_token_id: Option<u32>,
pub eos_token_ids: Vec<u32>,
pub vision: Option<VisionConfig>,
}Expand description
Architecture + hyperparameter description of a model, format-agnostic.
Field names follow the HuggingFace Llama config convention; other architecture families remap their config onto this struct in their adapter.
Fields§
§architecture: StringArchitecture identifier, e.g. "llama", "smollm2" (from
config.json::model_type). The model registry keys on this string.
Hidden size (model dimension).
intermediate_size: usizeMLP intermediate size.
Number of transformer layers.
num_attention_heads: usizeNumber of attention query heads.
num_key_value_heads: usizeNumber of key/value heads (GQA). Equal to num_attention_heads for MHA.
vocab_size: usizeVocabulary size.
max_position_embeddings: usizeMaximum positional embeddings the model was built for.
rms_norm_eps: f64RMSNorm epsilon.
rope_theta: f64RoPE base frequency (theta).
tie_word_embeddings: boolWhether lm_head is tied to the embedding matrix.
head_dim: usizePer-head dimension, derived: hidden_size / num_attention_heads.
attention_bias: boolWhether attention projections carry biases.
bos_token_id: Option<u32>Beginning-of-sequence token id, if defined.
eos_token_ids: Vec<u32>End-of-sequence token ids (merged from config + generation_config).
vision: Option<VisionConfig>Vision-tower hyperparameters for multimodal models (Idefics3/SmolVLM
today); None for text-only models.
Implementations§
Source§impl ModelMetadata
impl ModelMetadata
Trait Implementations§
Source§impl Clone for ModelMetadata
impl Clone for ModelMetadata
Source§fn clone(&self) -> ModelMetadata
fn clone(&self) -> ModelMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more