pub struct ModelEntry {
pub id: String,
pub provider: String,
pub name: String,
pub display_name: String,
pub tier: CostTier,
pub enabled: bool,
pub available: bool,
pub context_window: Option<u32>,
pub supports_vision: bool,
pub supports_tools: bool,
pub supports_thinking: bool,
pub notes: Option<String>,
}Expand description
A registered model with metadata.
Fields§
§id: StringFull model ID (e.g., “anthropic/claude-sonnet-4”)
provider: StringProvider ID (e.g., “anthropic”, “openai”, “ollama”)
name: StringShort model name (e.g., “claude-sonnet-4”)
display_name: StringDisplay name for UI
tier: CostTierCost tier
enabled: boolWhether the model is enabled for use
available: boolWhether credentials are available for this model
context_window: Option<u32>Context window size (tokens)
supports_vision: boolSupports vision/images
supports_tools: boolSupports tool use
supports_thinking: boolSupports extended thinking
notes: Option<String>Optional notes
Implementations§
Source§impl ModelEntry
impl ModelEntry
Sourcepub fn new(
id: impl Into<String>,
provider: impl Into<String>,
tier: CostTier,
) -> Self
pub fn new( id: impl Into<String>, provider: impl Into<String>, tier: CostTier, ) -> Self
Create a new model entry.
Sourcepub fn with_context(self, tokens: u32) -> Self
pub fn with_context(self, tokens: u32) -> Self
Builder: set context window.
Sourcepub fn with_vision(self) -> Self
pub fn with_vision(self) -> Self
Builder: set vision support.
Sourcepub fn with_thinking(self) -> Self
pub fn with_thinking(self) -> Self
Builder: set thinking support.
Sourcepub fn with_notes(self, notes: impl Into<String>) -> Self
pub fn with_notes(self, notes: impl Into<String>) -> Self
Builder: set notes.
Sourcepub fn format_display(&self) -> String
pub fn format_display(&self) -> String
Format for display with tier indicator.
Trait Implementations§
Source§impl Clone for ModelEntry
impl Clone for ModelEntry
Source§fn clone(&self) -> ModelEntry
fn clone(&self) -> ModelEntry
Returns a duplicate of the value. Read more
1.0.0 · 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 ModelEntry
impl Debug for ModelEntry
Source§impl<'de> Deserialize<'de> for ModelEntry
impl<'de> Deserialize<'de> for ModelEntry
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
Auto Trait Implementations§
impl Freeze for ModelEntry
impl RefUnwindSafe for ModelEntry
impl Send for ModelEntry
impl Sync for ModelEntry
impl Unpin for ModelEntry
impl UnsafeUnpin for ModelEntry
impl UnwindSafe for ModelEntry
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