Skip to main content

ModelRecord

Struct ModelRecord 

Source
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_mb: 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>,
}
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: String

Stable identity derived from the source (see stable_id).

§name: String

The model’s display name.

§modality: Modality

Its primary modality.

§capabilities: Vec<Capability>

Everything it can be asked to do.

§source: ModelSource

Where its weights live.

§runtime: RuntimeRef

The 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: ExecutionMode

How the runtime delivers output.

§footprint_mb: Option<i64>

Estimated memory footprint in megabytes.

§state: ModelState

The record’s lifecycle state.

§registered_at: i64

When 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: bool

Whether the model is still downloading.

§content_fingerprint: Option<String>

A content fingerprint used to follow a model across moves.

Implementations§

Source§

impl ModelRecord

Source

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.

Source

pub fn display_name(&self) -> &str

The name to show the user: the alias if set, otherwise the name.

Source

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.

Source

pub fn can(&self, capability: &Capability) -> bool

Whether the model can perform capability.

Trait Implementations§

Source§

impl Clone for ModelRecord

Source§

fn clone(&self) -> ModelRecord

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 Debug for ModelRecord

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ModelRecord

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ModelRecord

Source§

fn eq(&self, other: &ModelRecord) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ModelRecord

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ModelRecord

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.