Skip to main content

ClaudeModel

Enum ClaudeModel 

Source
pub enum ClaudeModel {
Show 27 variants Sonnet, Opus, Haiku, Fable, Best, OpusPlan, Sonnet1m, Opus1m, Fable1m, Fable5, Mythos5, Opus5, Opus48, Opus47, Opus46, Opus45, Opus41, Opus40, Sonnet5, Sonnet46, Sonnet45, Sonnet40, Sonnet37, Sonnet35, Haiku45, Haiku35, Custom(String),
}
Expand description

A model selector accepted by claude --model.

Variants§

§

Sonnet

Newest Sonnet-family model (floating alias sonnet).

§

Opus

Newest Opus-family model (floating alias opus). Resolves to claude-opus-5 first-party as of CLI 2.1.219.

§

Haiku

Newest Haiku-family model (floating alias haiku).

§

Fable

Newest Fable-family model (floating alias fable).

§

Best

The most capable model available to the account (alias best).

§

OpusPlan

Opus for plan mode, Sonnet otherwise (alias opusplan).

§

Sonnet1m

Newest Sonnet with the 1M-token context beta (alias sonnet[1m]).

§

Opus1m

Newest Opus with the 1M-token context beta (alias opus[1m]).

§

Fable1m

Newest Fable with the 1M-token context beta (alias fable[1m]).

§

Fable5

Fable 5 (claude-fable-5).

§

Mythos5

Mythos 5 (claude-mythos-5).

§

Opus5

Opus 5 (claude-opus-5).

§

Opus48

Opus 4.8 (claude-opus-4-8).

§

Opus47

Opus 4.7 (claude-opus-4-7).

§

Opus46

Opus 4.6 (claude-opus-4-6).

§

Opus45

Opus 4.5 (claude-opus-4-5).

§

Opus41

Opus 4.1 (claude-opus-4-1).

§

Opus40

Opus 4 (claude-opus-4-0).

§

Sonnet5

Sonnet 5 (claude-sonnet-5).

§

Sonnet46

Sonnet 4.6 (claude-sonnet-4-6).

§

Sonnet45

Sonnet 4.5 (claude-sonnet-4-5).

§

Sonnet40

Sonnet 4 (claude-sonnet-4-0).

§

Sonnet37

Sonnet 3.7 (claude-3-7-sonnet).

§

Sonnet35

Sonnet 3.5 (claude-3-5-sonnet).

§

Haiku45

Haiku 4.5 (claude-haiku-4-5).

§

Haiku35

Haiku 3.5 (claude-3-5-haiku).

§

Custom(String)

A model string not yet known to this version of the crate. Passed to the CLI verbatim.

Implementations§

Source§

impl ClaudeModel

Source

pub fn cli_arg(&self) -> &str

The string to pass to claude --model for this model.

Source

pub fn as_str(&self) -> &str

Alias for cli_arg, matching the crate’s string-enum convention.

Source

pub fn display_name(&self) -> &str

Human-friendly display name, matching what the CLI’s own UI renders.

Source

pub fn is_alias(&self) -> bool

True for the floating aliases (sonnet, opus, …) that the CLI resolves to the newest model of the family at session start.

Source

pub fn known() -> &'static [ClaudeModel]

Every model known to this version of the crate, aliases first.

Trait Implementations§

Source§

impl Clone for ClaudeModel

Source§

fn clone(&self) -> ClaudeModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClaudeModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ClaudeModel

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ClaudeModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ClaudeModel

Source§

impl From<&str> for ClaudeModel

Source§

fn from(s: &str) -> Self

Converts to this type from the input type.
Source§

impl From<ClaudeModel> for String

Source§

fn from(model: ClaudeModel) -> Self

Converts to this type from the input type.
Source§

impl Hash for ClaudeModel

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ClaudeModel

Source§

fn eq(&self, other: &ClaudeModel) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ClaudeModel

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ClaudeModel

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.