pub mod claude_opus_4_1 {
pub const CLAUDE_OPUS_4_1_20250805: &str = "claude-opus-4-1-20250805";
pub const CLAUDE_OPUS_4_1: &str = "claude-opus-4-1";
pub const ALL: &[&str] = &[CLAUDE_OPUS_4_1_20250805, CLAUDE_OPUS_4_1];
}
pub mod claude_opus_4 {
pub const CLAUDE_OPUS_4_20250514: &str = "claude-opus-4-20250514";
pub const CLAUDE_OPUS_4_0: &str = "claude-opus-4-0";
pub const ALL: &[&str] = &[CLAUDE_OPUS_4_20250514, CLAUDE_OPUS_4_0];
}
pub mod claude_sonnet_4 {
pub const CLAUDE_SONNET_4_20250514: &str = "claude-sonnet-4-20250514";
pub const CLAUDE_SONNET_4_0: &str = "claude-sonnet-4-0";
pub const ALL: &[&str] = &[CLAUDE_SONNET_4_20250514, CLAUDE_SONNET_4_0];
}
pub mod claude_sonnet_3_7 {
pub const CLAUDE_3_7_SONNET_20250219: &str = "claude-3-7-sonnet-20250219";
pub const CLAUDE_3_7_SONNET_LATEST: &str = "claude-3-7-sonnet-latest";
pub const ALL: &[&str] = &[CLAUDE_3_7_SONNET_20250219, CLAUDE_3_7_SONNET_LATEST];
}
pub mod claude_sonnet_3_5 {
pub const CLAUDE_3_5_SONNET_20241022: &str = "claude-3-5-sonnet-20241022";
pub const CLAUDE_3_5_SONNET_20240620: &str = "claude-3-5-sonnet-20240620";
pub const CLAUDE_3_5_SONNET_LATEST: &str = "claude-3-5-sonnet-latest";
pub const ALL: &[&str] = &[
CLAUDE_3_5_SONNET_20241022,
CLAUDE_3_5_SONNET_20240620,
CLAUDE_3_5_SONNET_LATEST,
];
}
pub mod claude_haiku_3_5 {
pub const CLAUDE_3_5_HAIKU_20241022: &str = "claude-3-5-haiku-20241022";
pub const CLAUDE_3_5_HAIKU_LATEST: &str = "claude-3-5-haiku-latest";
pub const ALL: &[&str] = &[CLAUDE_3_5_HAIKU_20241022, CLAUDE_3_5_HAIKU_LATEST];
}
pub mod claude_haiku_3 {
pub const CLAUDE_3_HAIKU_20240307: &str = "claude-3-haiku-20240307";
pub const ALL: &[&str] = &[CLAUDE_3_HAIKU_20240307];
}
pub mod claude_opus_3 {
pub const CLAUDE_3_OPUS_20240229: &str = "claude-3-opus-20240229";
pub const ALL: &[&str] = &[CLAUDE_3_OPUS_20240229];
}
pub mod claude_sonnet_3 {
pub const CLAUDE_3_SONNET_20240229: &str = "claude-3-sonnet-20240229";
pub const ALL: &[&str] = &[CLAUDE_3_SONNET_20240229];
}
pub mod popular {
use super::*;
pub const FLAGSHIP: &str = claude_opus_4_1::CLAUDE_OPUS_4_1;
pub const BALANCED: &str = claude_sonnet_4::CLAUDE_SONNET_4_20250514;
pub const FAST: &str = claude_haiku_3_5::CLAUDE_3_5_HAIKU_LATEST;
pub const THINKING: &str = claude_sonnet_3_7::CLAUDE_3_7_SONNET_LATEST;
pub const LATEST: &str = claude_opus_4_1::CLAUDE_OPUS_4_1;
}
pub mod capabilities {
pub const THINKING_MODELS: &[&str] = &[
super::claude_opus_4_1::CLAUDE_OPUS_4_1_20250805,
super::claude_opus_4::CLAUDE_OPUS_4_20250514,
super::claude_sonnet_4::CLAUDE_SONNET_4_20250514,
super::claude_sonnet_3_7::CLAUDE_3_7_SONNET_20250219,
];
pub const VISION_MODELS: &[&str] = &[
super::claude_opus_4_1::CLAUDE_OPUS_4_1_20250805,
super::claude_opus_4::CLAUDE_OPUS_4_20250514,
super::claude_sonnet_4::CLAUDE_SONNET_4_20250514,
super::claude_sonnet_3_7::CLAUDE_3_7_SONNET_20250219,
super::claude_sonnet_3_5::CLAUDE_3_5_SONNET_20241022,
super::claude_sonnet_3_5::CLAUDE_3_5_SONNET_20240620,
super::claude_haiku_3_5::CLAUDE_3_5_HAIKU_20241022,
];
pub const PRIORITY_TIER_MODELS: &[&str] = &[
super::claude_opus_4_1::CLAUDE_OPUS_4_1_20250805,
super::claude_opus_4::CLAUDE_OPUS_4_20250514,
super::claude_sonnet_4::CLAUDE_SONNET_4_20250514,
super::claude_sonnet_3_7::CLAUDE_3_7_SONNET_20250219,
super::claude_sonnet_3_5::CLAUDE_3_5_SONNET_20241022,
super::claude_haiku_3_5::CLAUDE_3_5_HAIKU_20241022,
];
}
pub fn all_chat_models() -> Vec<&'static str> {
let mut models = Vec::new();
models.extend_from_slice(claude_opus_4_1::ALL);
models.extend_from_slice(claude_opus_4::ALL);
models.extend_from_slice(claude_sonnet_4::ALL);
models.extend_from_slice(claude_sonnet_3_7::ALL);
models.extend_from_slice(claude_sonnet_3_5::ALL);
models.extend_from_slice(claude_haiku_3_5::ALL);
models.extend_from_slice(claude_haiku_3::ALL);
models.extend_from_slice(claude_opus_3::ALL);
models.extend_from_slice(claude_sonnet_3::ALL);
models
}
pub fn all_thinking_models() -> Vec<&'static str> {
capabilities::THINKING_MODELS.to_vec()
}
pub fn all_vision_models() -> Vec<&'static str> {
capabilities::VISION_MODELS.to_vec()
}
pub fn all_priority_tier_models() -> Vec<&'static str> {
capabilities::PRIORITY_TIER_MODELS.to_vec()
}
pub fn supports_thinking(model_id: &str) -> bool {
capabilities::THINKING_MODELS.contains(&model_id)
}
pub fn supports_vision(model_id: &str) -> bool {
capabilities::VISION_MODELS.contains(&model_id)
}
pub fn has_priority_tier(model_id: &str) -> bool {
capabilities::PRIORITY_TIER_MODELS.contains(&model_id)
}
pub fn get_context_window(model_id: &str) -> u32 {
match model_id {
id if id.contains("claude-opus-4") || id.contains("claude-sonnet-4") => 200_000,
id if id.contains("claude-3-7-sonnet") => 200_000,
id if id.contains("claude-3-5") => 200_000,
id if id.contains("claude-3") => 200_000,
_ => 200_000,
}
}
pub fn get_max_output_tokens(model_id: &str) -> u32 {
match model_id {
id if id.contains("claude-opus-4") || id.contains("claude-sonnet-4") => 32_000,
id if id.contains("claude-3-7-sonnet") => 64_000,
id if id.contains("claude-3-5") => 8192,
id if id.contains("claude-3") => 4096,
_ => 8192,
}
}