pub struct ModelEntry {
pub id: &'static str,
pub name: &'static str,
pub api: Api,
pub provider: &'static str,
pub reasoning: bool,
pub input: &'static [InputModality],
pub cost_input: f64,
pub cost_output: f64,
pub cost_cache_read: f64,
pub cost_cache_write: f64,
pub context_window: u32,
pub max_tokens: u32,
}Expand description
A static model entry in the database.
Uses &'static str references for zero-allocation lookups.
Fields§
§id: &'static strModel identifier (e.g., “claude-sonnet-4-20250514”)
name: &'static strHuman-readable model name (e.g., “Claude Sonnet 4”)
api: ApiAPI protocol to use
provider: &'static strProvider name (e.g., “anthropic”, “openai”)
reasoning: boolWhether this model supports reasoning/thinking
input: &'static [InputModality]Supported input modalities
cost_input: f64Cost per million input tokens (USD)
cost_output: f64Cost per million output tokens (USD)
cost_cache_read: f64Cost per million cached read tokens (USD)
cost_cache_write: f64Cost per million cached write tokens (USD)
context_window: u32Maximum context window in tokens
max_tokens: u32Maximum output tokens
Implementations§
Source§impl ModelEntry
impl ModelEntry
Sourcepub fn supports_vision(&self) -> bool
pub fn supports_vision(&self) -> bool
Check if this model supports image/vision input
Sourcepub fn supports_reasoning(&self) -> bool
pub fn supports_reasoning(&self) -> bool
Check if this model supports reasoning/thinking
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 (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 ModelEntry
impl Debug for ModelEntry
Source§impl PartialEq for ModelEntry
impl PartialEq for ModelEntry
Source§fn eq(&self, other: &ModelEntry) -> bool
fn eq(&self, other: &ModelEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ModelEntry
impl StructuralPartialEq for ModelEntry
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