pub enum Model {
Show 17 variants
ClaudeOpus46,
ClaudeOpus45,
ClaudeSonnet45,
ClaudeHaiku45,
Gemini3ProPreview,
Gpt52,
Gpt51CodexMax,
KimiK25,
Gemini3FlashPreview,
GLM47,
MinimaxM21,
Grok41Fast,
GrokCodeFast1,
Qwen3Coder,
GptOss120b,
OpenRouterAuto,
None,
}Expand description
The supported models, subjectively ranked by quality
Variants§
ClaudeOpus46
ClaudeOpus45
ClaudeSonnet45
ClaudeHaiku45
Gemini3ProPreview
Gpt52
Gpt51CodexMax
KimiK25
Gemini3FlashPreview
GLM47
MinimaxM21
Grok41Fast
GrokCodeFast1
Qwen3Coder
GptOss120b
OpenRouterAuto
None
This allows code to match all models, but still match _ => to avoid being required to match all models.
Implementations§
Source§impl Model
impl Model
pub fn tweaks(self) -> ModelTweaks
pub const fn name(self) -> &'static str
pub fn from_name(s: &str) -> Option<Self>
pub const fn supports_prompt_caching(self) -> bool
pub fn default_settings(self) -> ModelSettings
Sourcepub fn select_for_cost(
provider: &dyn AiProvider,
quality: ModelCost,
) -> Option<ModelSettings>
pub fn select_for_cost( provider: &dyn AiProvider, quality: ModelCost, ) -> Option<ModelSettings>
Select the highest quality model supported by the provider that fits the cost threshold. For Unlimited, returns the highest supported model. For others, filters by max(input/output cost per million tokens) <= threshold. Free requires exact 0.0 match. Ranked highest-to-lowest to prefer premium within budget. Returns None if no fit (surfaces error to caller—no fallback).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Model
impl<'de> Deserialize<'de> for Model
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
impl Copy for Model
impl Eq for Model
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
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,
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.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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.