pub struct ModelCapabilities {
pub has_ssm_layers: bool,
pub has_attention_layers: bool,
pub has_moe_layers: bool,
pub supports_thinking: bool,
pub supports_vision: bool,
pub has_mtp: bool,
pub ssm_architecture: SsmArchitecture,
pub attention_type: AttentionType,
pub has_nested_config: bool,
}Expand description
Feature flags derived from model config at parse time.
These replace scattered is_nemotron_h(), is_qwen35() checks with
model-agnostic predicates. New models get capabilities automatically
from their config — no code changes needed.
Fields§
§has_ssm_layers: boolModel has SSM/recurrent layers (GDN or Mamba-2).
has_attention_layers: boolModel has full attention layers.
has_moe_layers: boolModel has MoE (Mixture of Experts) layers.
supports_thinking: boolModel supports <think> reasoning tokens.
Derived from tokenizer vocabulary, not model type name.
supports_vision: boolModel has vision encoder (multimodal).
has_mtp: boolModel has MTP (Multi-Token Prediction) draft head.
ssm_architecture: SsmArchitectureSSM architecture family (determines state layout).
attention_type: AttentionTypeAttention architecture (standard GQA vs MLA compressed latent).
has_nested_config: boolModel wraps language model config in a nested field (e.g., text_config).
Implementations§
Source§impl ModelCapabilities
impl ModelCapabilities
Sourcepub fn from_config(config: &ModelConfig) -> Self
pub fn from_config(config: &ModelConfig) -> Self
Derive capabilities from a ModelConfig.
This is the SSOT for model feature detection. When adding a new model, ensure its config fields populate the right capabilities here — then all downstream code works automatically.
Trait Implementations§
Source§impl Clone for ModelCapabilities
impl Clone for ModelCapabilities
Source§fn clone(&self) -> ModelCapabilities
fn clone(&self) -> ModelCapabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more