pub struct ModelRegistry { /* private fields */ }Expand description
A searchable collection of model entries.
Implementations§
Source§impl ModelRegistry
impl ModelRegistry
Sourcepub fn from_litellm_json(json: &[u8]) -> Self
pub fn from_litellm_json(json: &[u8]) -> Self
Build a registry from parsed LiteLLM JSON bytes.
Sourcepub fn tier(&self, model_id: &str) -> ModelTier
pub fn tier(&self, model_id: &str) -> ModelTier
Capability/cost tier of a model, classified against this registry’s
chat-model price distribution. Unknown models classify as
ModelTier::Balanced.
Sourcepub fn tier_of(&self, entry: &ModelEntry) -> ModelTier
pub fn tier_of(&self, entry: &ModelEntry) -> ModelTier
Capability/cost tier of a specific registry entry.
Sourcepub fn lookup(&self, model_id: &str) -> Option<&ModelEntry>
pub fn lookup(&self, model_id: &str) -> Option<&ModelEntry>
Exact match by canonical ID or LiteLLM ID, then prefix match.
Sourcepub fn models_for_provider(
&self,
provider: &Provider,
) -> impl Iterator<Item = &ModelEntry>
pub fn models_for_provider( &self, provider: &Provider, ) -> impl Iterator<Item = &ModelEntry>
All models from a given provider.
Sourcepub fn models_by_mode(
&self,
mode: ModelMode,
) -> impl Iterator<Item = &ModelEntry>
pub fn models_by_mode( &self, mode: ModelMode, ) -> impl Iterator<Item = &ModelEntry>
All models matching a given mode.
Sourcepub fn models_with_ability(
&self,
ability: Ability,
) -> impl Iterator<Item = &ModelEntry>
pub fn models_with_ability( &self, ability: Ability, ) -> impl Iterator<Item = &ModelEntry>
All models with a specific ability.
Sourcepub fn all(&self) -> impl Iterator<Item = &ModelEntry>
pub fn all(&self) -> impl Iterator<Item = &ModelEntry>
Iterate over all entries.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelRegistry
impl RefUnwindSafe for ModelRegistry
impl Send for ModelRegistry
impl Sync for ModelRegistry
impl Unpin for ModelRegistry
impl UnsafeUnpin for ModelRegistry
impl UnwindSafe for ModelRegistry
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