pub struct ModelEntry { /* private fields */ }Expand description
A single model entry from the upstream registry.
Implementations§
Source§impl ModelEntry
impl ModelEntry
Sourcepub fn new(
litellm_id: String,
canonical_id: String,
provider: Provider,
mode: ModelMode,
) -> Self
pub fn new( litellm_id: String, canonical_id: String, provider: Provider, mode: ModelMode, ) -> Self
Creates a new model entry with owned strings.
Sourcepub fn litellm_id(&self) -> &str
pub fn litellm_id(&self) -> &str
The original LiteLLM key (e.g. "gemini/gemini-2.5-flash").
Sourcepub const fn max_input_tokens(&self) -> Option<u32>
pub const fn max_input_tokens(&self) -> Option<u32>
Maximum input tokens (context window), if known.
Sourcepub const fn max_output_tokens(&self) -> Option<u32>
pub const fn max_output_tokens(&self) -> Option<u32>
Maximum output tokens, if known.
Sourcepub fn has_ability(&self, ability: Ability) -> bool
pub fn has_ability(&self, ability: Ability) -> bool
Whether this model has a specific ability.
Sourcepub fn deprecation_date(&self) -> Option<&str>
pub fn deprecation_date(&self) -> Option<&str>
Deprecation date string (YYYY-MM-DD), if set.
Sourcepub fn is_deprecated(&self) -> bool
pub fn is_deprecated(&self) -> bool
Whether this model is past its deprecation date.
Sourcepub const fn with_max_input_tokens(self, tokens: u32) -> Self
pub const fn with_max_input_tokens(self, tokens: u32) -> Self
Sets max input tokens.
Sourcepub const fn with_max_output_tokens(self, tokens: u32) -> Self
pub const fn with_max_output_tokens(self, tokens: u32) -> Self
Sets max output tokens.
Sourcepub const fn with_pricing(self, pricing: Pricing) -> Self
pub const fn with_pricing(self, pricing: Pricing) -> Self
Sets pricing.
Sourcepub fn with_abilities(self, abilities: Vec<Ability>) -> Self
pub fn with_abilities(self, abilities: Vec<Ability>) -> Self
Sets abilities from a vec.
Sourcepub fn with_deprecation_date(self, date: String) -> Self
pub fn with_deprecation_date(self, date: String) -> Self
Sets deprecation date.
Trait Implementations§
Source§impl Clone for ModelEntry
impl Clone for ModelEntry
Source§impl Debug for ModelEntry
impl Debug for ModelEntry
Source§impl PartialEq for ModelEntry
impl PartialEq 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