pub mod production {
pub const LLAMA_3_1_8B_INSTANT: &str = "llama-3.1-8b-instant";
pub const LLAMA_3_3_70B_VERSATILE: &str = "llama-3.3-70b-versatile";
pub const LLAMA_GUARD_4_12B: &str = "meta-llama/llama-guard-4-12b";
pub const WHISPER_LARGE_V3: &str = "whisper-large-v3";
pub const WHISPER_LARGE_V3_TURBO: &str = "whisper-large-v3-turbo";
pub const ALL: &[&str] = &[
LLAMA_3_1_8B_INSTANT,
LLAMA_3_3_70B_VERSATILE,
LLAMA_GUARD_4_12B,
WHISPER_LARGE_V3,
WHISPER_LARGE_V3_TURBO,
];
}
pub mod preview {
pub const DEEPSEEK_R1_DISTILL_LLAMA_70B: &str = "deepseek-r1-distill-llama-70b";
pub const LLAMA_4_MAVERICK_17B_128E_INSTRUCT: &str =
"meta-llama/llama-4-maverick-17b-128e-instruct";
pub const LLAMA_4_SCOUT_17B_16E_INSTRUCT: &str = "meta-llama/llama-4-scout-17b-16e-instruct";
pub const LLAMA_PROMPT_GUARD_2_22M: &str = "meta-llama/llama-prompt-guard-2-22m";
pub const LLAMA_PROMPT_GUARD_2_86M: &str = "meta-llama/llama-prompt-guard-2-86m";
pub const KIMI_K2_INSTRUCT: &str = "moonshotai/kimi-k2-instruct";
pub const GPT_OSS_120B: &str = "openai/gpt-oss-120b";
pub const GPT_OSS_20B: &str = "openai/gpt-oss-20b";
pub const PLAYAI_TTS: &str = "playai-tts";
pub const PLAYAI_TTS_ARABIC: &str = "playai-tts-arabic";
pub const QWEN3_32B: &str = "qwen/qwen3-32b";
pub const ALL: &[&str] = &[
DEEPSEEK_R1_DISTILL_LLAMA_70B,
LLAMA_4_MAVERICK_17B_128E_INSTRUCT,
LLAMA_4_SCOUT_17B_16E_INSTRUCT,
LLAMA_PROMPT_GUARD_2_22M,
LLAMA_PROMPT_GUARD_2_86M,
KIMI_K2_INSTRUCT,
GPT_OSS_120B,
GPT_OSS_20B,
PLAYAI_TTS,
PLAYAI_TTS_ARABIC,
QWEN3_32B,
];
}
pub mod systems {
pub const COMPOUND_BETA: &str = "compound-beta";
pub const COMPOUND_BETA_MINI: &str = "compound-beta-mini";
pub const ALL: &[&str] = &[COMPOUND_BETA, COMPOUND_BETA_MINI];
}
pub mod audio {
pub mod speech_to_text {
pub const WHISPER_LARGE_V3: &str = "whisper-large-v3";
pub const WHISPER_LARGE_V3_TURBO: &str = "whisper-large-v3-turbo";
pub const ALL: &[&str] = &[WHISPER_LARGE_V3, WHISPER_LARGE_V3_TURBO];
}
pub mod text_to_speech {
pub const PLAYAI_TTS: &str = "playai-tts";
pub const PLAYAI_TTS_ARABIC: &str = "playai-tts-arabic";
pub const ALL: &[&str] = &[PLAYAI_TTS, PLAYAI_TTS_ARABIC];
}
}
pub mod chat {
pub mod large {
pub const LLAMA_3_3_70B_VERSATILE: &str = "llama-3.3-70b-versatile";
pub const DEEPSEEK_R1_DISTILL_LLAMA_70B: &str = "deepseek-r1-distill-llama-70b";
pub const GPT_OSS_120B: &str = "openai/gpt-oss-120b";
pub const ALL: &[&str] = &[
LLAMA_3_3_70B_VERSATILE,
DEEPSEEK_R1_DISTILL_LLAMA_70B,
GPT_OSS_120B,
];
}
pub mod medium {
pub const QWEN3_32B: &str = "qwen/qwen3-32b";
pub const GPT_OSS_20B: &str = "openai/gpt-oss-20b";
pub const ALL: &[&str] = &[QWEN3_32B, GPT_OSS_20B];
}
pub mod small {
pub const LLAMA_3_1_8B_INSTANT: &str = "llama-3.1-8b-instant";
pub const LLAMA_4_MAVERICK_17B: &str = "meta-llama/llama-4-maverick-17b-128e-instruct";
pub const LLAMA_4_SCOUT_17B: &str = "meta-llama/llama-4-scout-17b-16e-instruct";
pub const ALL: &[&str] = &[
LLAMA_3_1_8B_INSTANT,
LLAMA_4_MAVERICK_17B,
LLAMA_4_SCOUT_17B,
];
}
}
pub mod popular {
use super::*;
pub const FLAGSHIP: &str = production::LLAMA_3_3_70B_VERSATILE;
pub const BALANCED: &str = production::LLAMA_3_3_70B_VERSATILE;
pub const FAST: &str = production::LLAMA_3_1_8B_INSTANT;
pub const LIGHTWEIGHT: &str = production::LLAMA_3_1_8B_INSTANT;
pub const REASONING: &str = preview::DEEPSEEK_R1_DISTILL_LLAMA_70B;
pub const LATEST: &str = production::LLAMA_3_3_70B_VERSATILE;
pub const SPEECH_TO_TEXT: &str = production::WHISPER_LARGE_V3;
pub const TEXT_TO_SPEECH: &str = preview::PLAYAI_TTS;
pub const SYSTEM: &str = systems::COMPOUND_BETA;
}
pub use preview::DEEPSEEK_R1_DISTILL_LLAMA_70B;
pub use preview::GPT_OSS_20B;
pub use preview::GPT_OSS_120B;
pub use production::LLAMA_3_1_8B_INSTANT;
pub use production::LLAMA_3_3_70B_VERSATILE;
pub use production::WHISPER_LARGE_V3;
pub use systems::COMPOUND_BETA;
pub fn all_models() -> Vec<&'static str> {
let mut models = Vec::new();
models.extend_from_slice(production::ALL);
models.extend_from_slice(preview::ALL);
models.extend_from_slice(systems::ALL);
models
}
pub mod by_capability {
use super::*;
pub const REASONING: &[&str] = &[preview::DEEPSEEK_R1_DISTILL_LLAMA_70B, preview::QWEN3_32B];
pub const FUNCTION_CALLING: &[&str] = &[
production::LLAMA_3_1_8B_INSTANT,
production::LLAMA_3_3_70B_VERSATILE,
preview::DEEPSEEK_R1_DISTILL_LLAMA_70B,
preview::GPT_OSS_120B,
preview::GPT_OSS_20B,
preview::QWEN3_32B,
];
pub const AUDIO: &[&str] = &[
production::WHISPER_LARGE_V3,
production::WHISPER_LARGE_V3_TURBO,
preview::PLAYAI_TTS,
preview::PLAYAI_TTS_ARABIC,
];
pub const FAST: &[&str] = &[
production::LLAMA_3_1_8B_INSTANT,
production::WHISPER_LARGE_V3_TURBO,
];
pub const TOOLS: &[&str] = systems::ALL;
pub const MODERATION: &[&str] = &[
production::LLAMA_GUARD_4_12B,
preview::LLAMA_PROMPT_GUARD_2_22M,
preview::LLAMA_PROMPT_GUARD_2_86M,
];
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_model_constants() {
assert_eq!(production::LLAMA_3_1_8B_INSTANT, "llama-3.1-8b-instant");
assert_eq!(
production::LLAMA_3_3_70B_VERSATILE,
"llama-3.3-70b-versatile"
);
assert_eq!(
preview::DEEPSEEK_R1_DISTILL_LLAMA_70B,
"deepseek-r1-distill-llama-70b"
);
assert_eq!(systems::COMPOUND_BETA, "compound-beta");
}
#[test]
fn test_all_models() {
let models = all_models();
assert!(!models.is_empty());
assert!(models.contains(&production::LLAMA_3_3_70B_VERSATILE));
assert!(models.contains(&preview::DEEPSEEK_R1_DISTILL_LLAMA_70B));
assert!(models.contains(&systems::COMPOUND_BETA));
}
#[test]
#[allow(clippy::const_is_empty)]
fn test_popular_recommendations() {
assert!(!popular::FLAGSHIP.is_empty());
assert!(!popular::BALANCED.is_empty());
assert!(!popular::REASONING.is_empty());
assert!(!popular::FAST.is_empty());
}
#[test]
#[allow(clippy::const_is_empty)]
fn test_capability_groups() {
assert!(!by_capability::REASONING.is_empty());
assert!(!by_capability::FUNCTION_CALLING.is_empty());
assert!(!by_capability::AUDIO.is_empty());
assert!(!by_capability::FAST.is_empty());
assert!(!by_capability::TOOLS.is_empty());
assert!(!by_capability::MODERATION.is_empty());
}
#[test]
#[allow(clippy::const_is_empty)]
fn test_audio_models() {
assert!(!audio::speech_to_text::ALL.is_empty());
assert!(!audio::text_to_speech::ALL.is_empty());
assert!(audio::speech_to_text::ALL.contains(&production::WHISPER_LARGE_V3));
assert!(audio::text_to_speech::ALL.contains(&preview::PLAYAI_TTS));
}
#[test]
#[allow(clippy::const_is_empty)]
fn test_chat_models_by_size() {
assert!(!chat::large::ALL.is_empty());
assert!(!chat::medium::ALL.is_empty());
assert!(!chat::small::ALL.is_empty());
assert!(chat::large::ALL.contains(&production::LLAMA_3_3_70B_VERSATILE));
assert!(chat::small::ALL.contains(&production::LLAMA_3_1_8B_INSTANT));
}
#[test]
#[allow(clippy::const_is_empty)]
fn test_model_categories() {
assert!(!production::ALL.is_empty());
assert!(!preview::ALL.is_empty());
assert!(!systems::ALL.is_empty());
let production_set: std::collections::HashSet<_> = production::ALL.iter().collect();
let preview_set: std::collections::HashSet<_> = preview::ALL.iter().collect();
let systems_set: std::collections::HashSet<_> = systems::ALL.iter().collect();
assert!(production_set.is_disjoint(&preview_set));
assert!(production_set.is_disjoint(&systems_set));
assert!(preview_set.is_disjoint(&systems_set));
}
}