pub struct ModelCapability {
pub model_id: String,
pub family: String,
pub parameters_b_x10: u32,
pub context_length: u32,
pub quantization: Option<String>,
pub modalities: Vec<Modality>,
pub tokens_per_sec: u32,
pub loaded: bool,
}Expand description
Model capability
Fields§
§model_id: StringUnique model identifier (e.g., “llama-3.1-70b”)
family: StringModel family (e.g., “llama”, “mistral”, “claude”)
parameters_b_x10: u32Parameter count (in billions, scaled by 10: 700 = 70B)
context_length: u32Context length in tokens
quantization: Option<String>Quantization (e.g., “fp16”, “int8”, “int4”)
modalities: Vec<Modality>Supported modalities
tokens_per_sec: u32Estimated tokens per second (for this hardware)
loaded: boolWhether model is currently loaded
Implementations§
Source§impl ModelCapability
impl ModelCapability
Sourcepub fn new(model_id: impl Into<String>, family: impl Into<String>) -> Self
pub fn new(model_id: impl Into<String>, family: impl Into<String>) -> Self
Create new model capability
Sourcepub fn with_parameters(self, billions: f32) -> Self
pub fn with_parameters(self, billions: f32) -> Self
Set parameter count in billions
Sourcepub fn with_context_length(self, length: u32) -> Self
pub fn with_context_length(self, length: u32) -> Self
Set context length
Sourcepub fn with_quantization(self, quant: impl Into<String>) -> Self
pub fn with_quantization(self, quant: impl Into<String>) -> Self
Set quantization
Sourcepub fn add_modality(self, modality: Modality) -> Self
pub fn add_modality(self, modality: Modality) -> Self
Add modality
Sourcepub fn with_tokens_per_sec(self, tps: u32) -> Self
pub fn with_tokens_per_sec(self, tps: u32) -> Self
Set tokens per second
Sourcepub fn with_loaded(self, loaded: bool) -> Self
pub fn with_loaded(self, loaded: bool) -> Self
Set loaded status
Sourcepub fn parameters(&self) -> f32
pub fn parameters(&self) -> f32
Get parameter count as f32
Trait Implementations§
Source§impl Clone for ModelCapability
impl Clone for ModelCapability
Source§fn clone(&self) -> ModelCapability
fn clone(&self) -> ModelCapability
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelCapability
impl Debug for ModelCapability
Source§impl<'de> Deserialize<'de> for ModelCapability
impl<'de> Deserialize<'de> for ModelCapability
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 ModelCapability
impl PartialEq for ModelCapability
Source§fn eq(&self, other: &ModelCapability) -> bool
fn eq(&self, other: &ModelCapability) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ModelCapability
impl Serialize for ModelCapability
impl Eq for ModelCapability
impl StructuralPartialEq for ModelCapability
Auto Trait Implementations§
impl Freeze for ModelCapability
impl RefUnwindSafe for ModelCapability
impl Send for ModelCapability
impl Sync for ModelCapability
impl Unpin for ModelCapability
impl UnsafeUnpin for ModelCapability
impl UnwindSafe for ModelCapability
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.