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>,
) -> ModelCapability
pub fn new( model_id: impl Into<String>, family: impl Into<String>, ) -> ModelCapability
Create new model capability
Sourcepub fn with_parameters(self, billions: f32) -> ModelCapability
pub fn with_parameters(self, billions: f32) -> ModelCapability
Set parameter count in billions
Sourcepub fn with_context_length(self, length: u32) -> ModelCapability
pub fn with_context_length(self, length: u32) -> ModelCapability
Set context length
Sourcepub fn with_quantization(self, quant: impl Into<String>) -> ModelCapability
pub fn with_quantization(self, quant: impl Into<String>) -> ModelCapability
Set quantization
Sourcepub fn add_modality(self, modality: Modality) -> ModelCapability
pub fn add_modality(self, modality: Modality) -> ModelCapability
Add modality
Sourcepub fn with_tokens_per_sec(self, tps: u32) -> ModelCapability
pub fn with_tokens_per_sec(self, tps: u32) -> ModelCapability
Set tokens per second
Sourcepub fn with_loaded(self, loaded: bool) -> ModelCapability
pub fn with_loaded(self, loaded: bool) -> ModelCapability
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<ModelCapability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelCapability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ModelCapability
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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.