pub enum Model {
Claude3Haiku20240307,
Claude3Sonnet20240229,
Claude3Opus20240229,
Claude35Sonnet20241022,
Claude35Sonnet20250114,
Claude4Sonnet20250514,
}Expand description
Available Claude models with their capabilities and token limits.
Each model has different strengths, speeds, and costs. Choose the model that best fits your use case:
- Haiku: Fastest and most cost-effective for simple tasks
- Sonnet: Balanced performance for most applications
- Opus: Most capable for complex reasoning tasks
§Examples
use anthropic_rust::Model;
// Get the maximum tokens for a model
let max_tokens = Model::Claude35Sonnet20241022.max_tokens();
println!("Max tokens: {}", max_tokens);
// Compare models
assert_eq!(Model::Claude3Haiku20240307.max_tokens(), 200_000);Variants§
Claude3Haiku20240307
Claude3Sonnet20240229
Claude3Opus20240229
Claude35Sonnet20241022
Claude35Sonnet20250114
Claude4Sonnet20250514
Implementations§
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 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