pub struct ModelRecord {Show 21 fields
pub id: String,
pub name: String,
pub modality: Modality,
pub capabilities: Vec<Capability>,
pub source: ModelSource,
pub runtime: RuntimeRef,
pub params: Vec<ParamSpec>,
pub param_values: BTreeMap<String, JsonValue>,
pub system_prompt: Option<String>,
pub alias: Option<String>,
pub execution: ExecutionMode,
pub footprint_bytes: Option<i64>,
pub state: ModelState,
pub registered_at: i64,
pub primary_weight_path: Option<String>,
pub context_length: Option<i64>,
pub has_chat_template: Option<bool>,
pub supports_tools: Option<bool>,
pub stop_tokens: Option<Vec<String>>,
pub downloading: bool,
pub content_fingerprint: Option<String>,
/* private fields */
}Expand description
A single model the kernel knows about: what it is, where it lives, how it runs, and how the user has configured it.
Fields§
§id: StringStable identity derived from the source (see stable_id).
name: StringThe model’s display name.
modality: ModalityIts primary modality.
capabilities: Vec<Capability>Everything it can be asked to do.
source: ModelSourceWhere its weights live.
runtime: RuntimeRefThe runtime it resolves to.
params: Vec<ParamSpec>The parameter schema it exposes.
param_values: BTreeMap<String, JsonValue>User-set parameter values.
system_prompt: Option<String>A user-set system prompt override.
alias: Option<String>A user-set display alias.
execution: ExecutionModeHow the runtime delivers output.
footprint_bytes: Option<i64>What the model’s files take on disk, in bytes, as the store’s scanner measured them. The memory a run needs is estimated from it, not stored.
state: ModelStateThe record’s lifecycle state.
registered_at: i64When the record was first registered, epoch millis.
primary_weight_path: Option<String>The primary weight file, when one file dominates.
context_length: Option<i64>The model’s context window, when known.
has_chat_template: Option<bool>Whether the model ships a chat template.
supports_tools: Option<bool>Whether the model’s chat template supports tool calling, when it could be
read. None means undetermined — treated as capable, gated by a request.
stop_tokens: Option<Vec<String>>Stop tokens the model declares.
downloading: boolWhether the model is still downloading.
content_fingerprint: Option<String>A content fingerprint used to follow a model across moves.
Implementations§
Source§impl ModelRecord
impl ModelRecord
Sourcepub fn new(
name: &str,
modality: Modality,
capabilities: Vec<Capability>,
source: ModelSource,
) -> Self
pub fn new( name: &str, modality: Modality, capabilities: Vec<Capability>, source: ModelSource, ) -> Self
Create a record for a model, deriving its stable id from source and
stamping registered_at with the current time.
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
The name to show the user: the alias if set, otherwise the name.
Sourcepub fn wire_id(&self) -> &str
pub fn wire_id(&self) -> &str
The id this model has on the wire: what the gateway’s model listings
advertise and what clients send back. One definition, so a launcher that
configures a client and the listing it will call cannot disagree. Same
rule as display_name, including the empty-alias
guard.
Sourcepub fn size_on_disk(&self) -> Option<i64>
pub fn size_on_disk(&self) -> Option<i64>
The size on disk, when one is recorded and positive.
Sourcepub fn footprint_mib(&self) -> Option<i64>
pub fn footprint_mib(&self) -> Option<i64>
The size on disk in whole mebibytes, the unit the memory governor budgets in.
Sourcepub fn can(&self, capability: &Capability) -> bool
pub fn can(&self, capability: &Capability) -> bool
Whether the model can perform capability.
Trait Implementations§
Source§impl Clone for ModelRecord
impl Clone for ModelRecord
Source§fn clone(&self) -> ModelRecord
fn clone(&self) -> ModelRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more