#[derive(Debug, Clone)]
pub struct ModelInfo {
pub id: String,
pub name: Option<String>,
pub description: Option<String>,
pub owned_by: String,
pub created: Option<u64>,
pub capabilities: Vec<String>,
pub context_window: Option<u32>,
pub max_output_tokens: Option<u32>,
pub input_cost_per_token: Option<f64>,
pub output_cost_per_token: Option<f64>,
}
pub mod constants {
#[cfg(feature = "openai")]
pub use crate::providers::openai::model_constants as openai;
#[cfg(feature = "anthropic")]
pub use crate::providers::anthropic::model_constants as anthropic;
#[cfg(feature = "google")]
pub use crate::providers::gemini::model_constants as gemini;
#[cfg(feature = "openai")]
pub use crate::providers::openai_compatible::providers::models as openai_compatible;
#[cfg(feature = "ollama")]
pub use crate::providers::ollama::model_constants as ollama;
#[cfg(feature = "xai")]
pub use crate::providers::xai::models as xai;
#[cfg(feature = "groq")]
pub use crate::providers::groq::models as groq;
pub mod popular {
pub mod flagship {
#[cfg(feature = "openai")]
pub const OPENAI: &str = super::super::openai::popular::FLAGSHIP;
#[cfg(feature = "anthropic")]
pub const ANTHROPIC: &str = super::super::anthropic::popular::FLAGSHIP;
#[cfg(feature = "google")]
pub const GEMINI: &str = super::super::gemini::popular::FLAGSHIP;
#[cfg(feature = "xai")]
pub const XAI: &str = super::super::xai::popular::FLAGSHIP;
#[cfg(feature = "groq")]
pub const GROQ: &str = super::super::groq::popular::FLAGSHIP;
}
pub mod balanced {
#[cfg(feature = "openai")]
pub const OPENAI: &str = super::super::openai::popular::BALANCED;
#[cfg(feature = "anthropic")]
pub const ANTHROPIC: &str = super::super::anthropic::popular::BALANCED;
#[cfg(feature = "google")]
pub const GEMINI: &str = super::super::gemini::popular::BALANCED;
#[cfg(feature = "xai")]
pub const XAI: &str = super::super::xai::popular::BALANCED;
#[cfg(feature = "groq")]
pub const GROQ: &str = super::super::groq::popular::BALANCED;
}
pub mod reasoning {
#[cfg(feature = "openai")]
pub const OPENAI: &str = super::super::openai::popular::REASONING;
#[cfg(feature = "anthropic")]
pub const ANTHROPIC: &str = super::super::anthropic::popular::THINKING;
#[cfg(feature = "google")]
pub const GEMINI: &str = super::super::gemini::popular::FLAGSHIP;
#[cfg(feature = "ollama")]
pub const OLLAMA: &str = super::super::ollama::popular::REASONING;
#[cfg(feature = "xai")]
pub const XAI: &str = super::super::xai::popular::REASONING;
#[cfg(feature = "groq")]
pub const GROQ: &str = super::super::groq::popular::REASONING;
}
pub mod economical {
#[cfg(feature = "openai")]
pub const OPENAI: &str = super::super::openai::popular::ECONOMICAL;
#[cfg(feature = "anthropic")]
pub const ANTHROPIC: &str = super::super::anthropic::popular::FAST;
#[cfg(feature = "google")]
pub const GEMINI: &str = super::super::gemini::popular::ECONOMICAL;
#[cfg(feature = "ollama")]
pub const OLLAMA: &str = super::super::ollama::popular::LIGHTWEIGHT;
#[cfg(feature = "xai")]
pub const XAI: &str = super::super::xai::popular::LIGHTWEIGHT;
#[cfg(feature = "groq")]
pub const GROQ: &str = super::super::groq::popular::LIGHTWEIGHT;
}
pub mod latest {
#[cfg(feature = "openai")]
pub const OPENAI: &str = super::super::openai::popular::LATEST;
#[cfg(feature = "anthropic")]
pub const ANTHROPIC: &str = super::super::anthropic::popular::LATEST;
#[cfg(feature = "google")]
pub const GEMINI: &str = super::super::gemini::popular::LATEST;
#[cfg(feature = "xai")]
pub const XAI: &str = super::super::xai::popular::LATEST;
#[cfg(feature = "groq")]
pub const GROQ: &str = super::super::groq::popular::LATEST;
}
}
pub fn all_chat_models() -> Vec<&'static str> {
let mut models = Vec::new();
#[cfg(feature = "openai")]
models.extend_from_slice(&openai::all_chat_models());
#[cfg(feature = "anthropic")]
models.extend_from_slice(&anthropic::all_chat_models());
#[cfg(feature = "google")]
models.extend_from_slice(&gemini::all_chat_models());
models
}
pub fn all_reasoning_models() -> Vec<&'static str> {
let mut models = Vec::new();
#[cfg(feature = "openai")]
models.extend_from_slice(&openai::all_reasoning_models());
#[cfg(feature = "anthropic")]
models.extend_from_slice(&anthropic::all_thinking_models());
#[cfg(feature = "google")]
models.extend_from_slice(&gemini::all_thinking_models());
models
}
pub fn all_multimodal_models() -> Vec<&'static str> {
let mut models = Vec::new();
#[cfg(feature = "openai")]
models.extend_from_slice(&openai::all_multimodal_models());
#[cfg(feature = "anthropic")]
models.extend_from_slice(&anthropic::all_vision_models());
#[cfg(feature = "google")]
models.extend_from_slice(&gemini::all_chat_models()); models
}
pub fn all_audio_generation_models() -> Vec<&'static str> {
let mut models = Vec::new();
#[cfg(feature = "openai")]
models.extend_from_slice(openai::audio::ALL);
#[cfg(feature = "google")]
models.extend_from_slice(&gemini::all_audio_generation_models());
models
}
pub fn all_image_generation_models() -> Vec<&'static str> {
let mut models = Vec::new();
#[cfg(feature = "openai")]
models.extend_from_slice(openai::images::ALL);
#[cfg(feature = "google")]
models.extend_from_slice(&gemini::all_image_generation_models());
models
}
pub fn all_embedding_models() -> Vec<&'static str> {
#[cfg(feature = "openai")]
return openai::embeddings::ALL.to_vec();
#[cfg(not(feature = "openai"))]
Vec::new()
}
}
pub mod model_constants {
#[cfg(feature = "openai")]
pub mod openai {
use crate::providers::openai::model_constants as c;
pub const GPT_4O: &str = c::gpt_4o::GPT_4O;
pub const GPT_4O_MINI: &str = c::gpt_4o::GPT_4O_MINI;
pub const GPT_4O_AUDIO: &str = c::gpt_4o::GPT_4O_AUDIO_PREVIEW;
pub const GPT_4_1: &str = c::gpt_4_1::GPT_4_1;
pub const GPT_4_1_MINI: &str = c::gpt_4_1::GPT_4_1_MINI;
pub const GPT_4_1_NANO: &str = c::gpt_4_1::GPT_4_1_NANO;
pub const GPT_4_5: &str = c::gpt_4_5::GPT_4_5;
pub const GPT_4_5_PREVIEW: &str = c::gpt_4_5::GPT_4_5_PREVIEW;
pub const GPT_5: &str = c::gpt_5::GPT_5;
pub const GPT_5_MINI: &str = c::gpt_5::GPT_5_MINI;
pub const GPT_5_NANO: &str = c::gpt_5::GPT_5_NANO;
pub const GPT_4_TURBO: &str = c::gpt_4_turbo::GPT_4_TURBO;
pub const GPT_4: &str = c::gpt_4::GPT_4;
pub const GPT_4_32K: &str = c::gpt_4::GPT_4_32K;
pub const O1: &str = c::o1::O1;
pub const O1_PREVIEW: &str = c::o1::O1_PREVIEW;
pub const O1_MINI: &str = c::o1::O1_MINI;
pub const O3: &str = c::o3::O3;
pub const O3_MINI: &str = c::o3::O3_MINI;
pub const O4_MINI: &str = c::o4::O4_MINI;
pub const GPT_3_5_TURBO: &str = c::gpt_3_5::GPT_3_5_TURBO;
pub const TTS_1: &str = c::audio::TTS_1;
pub const TTS_1_HD: &str = c::audio::TTS_1_HD;
pub const WHISPER_1: &str = c::audio::WHISPER_1;
pub const DALL_E_2: &str = c::images::DALL_E_2;
pub const DALL_E_3: &str = c::images::DALL_E_3;
pub const TEXT_EMBEDDING_3_SMALL: &str = c::embeddings::TEXT_EMBEDDING_3_SMALL;
pub const TEXT_EMBEDDING_3_LARGE: &str = c::embeddings::TEXT_EMBEDDING_3_LARGE;
}
#[cfg(feature = "anthropic")]
pub mod anthropic {
use crate::providers::anthropic::model_constants as c;
pub const CLAUDE_OPUS_4_1: &str = c::claude_opus_4_1::CLAUDE_OPUS_4_1;
pub const CLAUDE_OPUS_4: &str = c::claude_opus_4::CLAUDE_OPUS_4_20250514;
pub const CLAUDE_SONNET_4: &str = c::claude_sonnet_4::CLAUDE_SONNET_4_20250514;
pub const CLAUDE_SONNET_3_7: &str = c::claude_sonnet_3_7::CLAUDE_3_7_SONNET_20250219;
pub const CLAUDE_SONNET_3_5: &str = c::claude_sonnet_3_5::CLAUDE_3_5_SONNET_20241022;
pub const CLAUDE_SONNET_3_5_LEGACY: &str = c::claude_sonnet_3_5::CLAUDE_3_5_SONNET_20240620;
pub const CLAUDE_HAIKU_3_5: &str = c::claude_haiku_3_5::CLAUDE_3_5_HAIKU_20241022;
pub const CLAUDE_OPUS_3: &str = c::claude_opus_3::CLAUDE_3_OPUS_20240229;
pub const CLAUDE_SONNET_3: &str = c::claude_sonnet_3::CLAUDE_3_SONNET_20240229;
pub const CLAUDE_HAIKU_3: &str = c::claude_haiku_3::CLAUDE_3_HAIKU_20240307;
}
#[cfg(feature = "google")]
pub mod gemini {
use crate::providers::gemini::model_constants as c;
pub const GEMINI_2_5_PRO: &str = c::gemini_2_5_pro::GEMINI_2_5_PRO;
pub const GEMINI_2_5_FLASH: &str = c::gemini_2_5_flash::GEMINI_2_5_FLASH;
pub const GEMINI_2_5_FLASH_LITE: &str = c::gemini_2_5_flash_lite::GEMINI_2_5_FLASH_LITE;
pub const GEMINI_2_0_FLASH: &str = c::gemini_2_0_flash::GEMINI_2_0_FLASH;
pub const GEMINI_2_0_FLASH_EXP: &str = c::gemini_2_0_flash::GEMINI_2_0_FLASH_EXP;
pub const GEMINI_2_0_FLASH_LITE: &str = c::gemini_2_0_flash_lite::GEMINI_2_0_FLASH_LITE;
pub const GEMINI_1_5_PRO: &str = c::gemini_1_5_pro::GEMINI_1_5_PRO;
pub const GEMINI_1_5_FLASH: &str = c::gemini_1_5_flash::GEMINI_1_5_FLASH;
pub const GEMINI_1_5_FLASH_8B: &str = c::gemini_1_5_flash_8b::GEMINI_1_5_FLASH_8B;
pub const GEMINI_LIVE_2_5_FLASH: &str =
c::gemini_2_5_flash_live::GEMINI_LIVE_2_5_FLASH_PREVIEW;
pub const GEMINI_LIVE_2_0_FLASH: &str = c::gemini_2_0_flash_live::GEMINI_2_0_FLASH_LIVE_001;
}
#[cfg(feature = "openai")]
pub mod openai_compatible {
use crate::providers::openai_compatible::providers::models as c;
pub mod deepseek {
use super::c;
pub const CHAT: &str = c::deepseek::CHAT;
pub const REASONER: &str = c::deepseek::REASONER;
pub const V3: &str = c::deepseek::DEEPSEEK_V3_0324;
pub const R1: &str = c::deepseek::DEEPSEEK_R1_0528;
}
pub mod openrouter {
use super::c;
pub const GPT_4O: &str = c::openrouter::openai::GPT_4O;
pub const CLAUDE_3_5_SONNET: &str = c::openrouter::anthropic::CLAUDE_3_5_SONNET;
pub const CLAUDE_OPUS_4_1: &str = c::openrouter::anthropic::CLAUDE_OPUS_4_1;
pub const GEMINI_2_5_PRO: &str = c::openrouter::google::GEMINI_2_5_PRO;
pub const DEEPSEEK_REASONER: &str = c::openrouter::deepseek::DEEPSEEK_REASONER;
pub const LLAMA_3_1_405B: &str = c::openrouter::meta::LLAMA_3_1_405B;
}
pub mod siliconflow {
use super::c;
pub const DEEPSEEK_V3_1: &str = c::siliconflow::DEEPSEEK_V3_1;
pub const DEEPSEEK_V3_1_PRO: &str = c::siliconflow::DEEPSEEK_V3_1_PRO;
pub const DEEPSEEK_V3: &str = c::siliconflow::DEEPSEEK_V3;
pub const DEEPSEEK_V3_PRO: &str = c::siliconflow::DEEPSEEK_V3_PRO;
pub const DEEPSEEK_R1: &str = c::siliconflow::DEEPSEEK_R1;
pub const DEEPSEEK_R1_PRO: &str = c::siliconflow::DEEPSEEK_R1_PRO;
pub const DEEPSEEK_V2_5: &str = c::siliconflow::DEEPSEEK_V2_5;
pub const DEEPSEEK_VL2: &str = c::siliconflow::DEEPSEEK_VL2;
pub const QWEN3_235B_A22B: &str = c::siliconflow::QWEN3_235B_A22B;
pub const QWEN3_235B_A22B_INSTRUCT: &str = c::siliconflow::QWEN3_235B_A22B_INSTRUCT;
pub const QWEN3_235B_A22B_THINKING: &str = c::siliconflow::QWEN3_235B_A22B_THINKING;
pub const QWEN3_32B: &str = c::siliconflow::QWEN3_32B;
pub const QWEN3_30B_A3B: &str = c::siliconflow::QWEN3_30B_A3B;
pub const QWEN3_30B_A3B_INSTRUCT: &str = c::siliconflow::QWEN3_30B_A3B_INSTRUCT;
pub const QWEN3_30B_A3B_THINKING: &str = c::siliconflow::QWEN3_30B_A3B_THINKING;
pub const QWEN3_14B: &str = c::siliconflow::QWEN3_14B;
pub const QWEN3_8B: &str = c::siliconflow::QWEN3_8B;
pub const QWEN_2_5_72B_INSTRUCT: &str = c::siliconflow::QWEN_2_5_72B_INSTRUCT;
pub const QWEN_2_5_72B_INSTRUCT_128K: &str = c::siliconflow::QWEN_2_5_72B_INSTRUCT_128K;
pub const QWEN_2_5_32B_INSTRUCT: &str = c::siliconflow::QWEN_2_5_32B_INSTRUCT;
pub const QWEN_2_5_14B_INSTRUCT: &str = c::siliconflow::QWEN_2_5_14B_INSTRUCT;
pub const QWEN_2_5_7B_INSTRUCT: &str = c::siliconflow::QWEN_2_5_7B_INSTRUCT;
pub const QWEN_2_5_VL_72B_INSTRUCT: &str = c::siliconflow::QWEN_2_5_VL_72B_INSTRUCT;
pub const QWEN_2_5_VL_32B_INSTRUCT: &str = c::siliconflow::QWEN_2_5_VL_32B_INSTRUCT;
pub const QWEN_2_5_VL_7B_INSTRUCT_PRO: &str =
c::siliconflow::QWEN_2_5_VL_7B_INSTRUCT_PRO;
pub const QWEN_2_5_CODER_32B_INSTRUCT: &str =
c::siliconflow::QWEN_2_5_CODER_32B_INSTRUCT;
pub const QWEN_2_5_CODER_7B_INSTRUCT: &str = c::siliconflow::QWEN_2_5_CODER_7B_INSTRUCT;
pub const QWEN_2_5_CODER_7B_INSTRUCT_PRO: &str =
c::siliconflow::QWEN_2_5_CODER_7B_INSTRUCT_PRO;
pub const QWEN3_CODER_480B_A35B_INSTRUCT: &str =
c::siliconflow::QWEN3_CODER_480B_A35B_INSTRUCT;
pub const QWEN3_CODER_30B_A3B_INSTRUCT: &str =
c::siliconflow::QWEN3_CODER_30B_A3B_INSTRUCT;
pub const QWQ_32B: &str = c::siliconflow::QWQ_32B;
pub const QVQ_72B_PREVIEW: &str = c::siliconflow::QVQ_72B_PREVIEW;
pub const KIMI_K2_INSTRUCT: &str = c::siliconflow::KIMI_K2_INSTRUCT;
pub const KIMI_K2_INSTRUCT_PRO: &str = c::siliconflow::KIMI_K2_INSTRUCT_PRO;
pub const GLM_4_5: &str = c::siliconflow::GLM_4_5;
pub const GLM_4_5_AIR: &str = c::siliconflow::GLM_4_5_AIR;
pub const GLM_4_5V: &str = c::siliconflow::GLM_4_5V;
pub const GLM_4_1V_9B_THINKING: &str = c::siliconflow::GLM_4_1V_9B_THINKING;
pub const GLM_4_1V_9B_THINKING_PRO: &str = c::siliconflow::GLM_4_1V_9B_THINKING_PRO;
pub const BCE_EMBEDDING_BASE_V1: &str = c::siliconflow::BCE_EMBEDDING_BASE_V1;
pub const QWEN3_EMBEDDING_8B: &str = c::siliconflow::QWEN3_EMBEDDING_8B;
pub const QWEN3_EMBEDDING_4B: &str = c::siliconflow::QWEN3_EMBEDDING_4B;
pub const QWEN3_EMBEDDING_0_6B: &str = c::siliconflow::QWEN3_EMBEDDING_0_6B;
pub const BGE_LARGE_EN_V1_5: &str = c::siliconflow::BGE_LARGE_EN_V1_5;
pub const BGE_LARGE_ZH_V1_5: &str = c::siliconflow::BGE_LARGE_ZH_V1_5;
pub const BGE_M3: &str = c::siliconflow::BGE_M3;
pub const BGE_M3_PRO: &str = c::siliconflow::BGE_M3_PRO;
pub const BGE_RERANKER_V2_M3: &str = c::siliconflow::BGE_RERANKER_V2_M3;
pub const BGE_RERANKER_V2_M3_PRO: &str = c::siliconflow::BGE_RERANKER_V2_M3_PRO;
pub const BCE_RERANKER_BASE_V1: &str = c::siliconflow::BCE_RERANKER_BASE_V1;
pub const QWEN3_RERANKER_8B: &str = c::siliconflow::QWEN3_RERANKER_8B;
pub const QWEN3_RERANKER_4B: &str = c::siliconflow::QWEN3_RERANKER_4B;
pub const QWEN3_RERANKER_0_6B: &str = c::siliconflow::QWEN3_RERANKER_0_6B;
pub const FLUX_1_PRO: &str = c::siliconflow::FLUX_1_PRO;
pub const FLUX_1_DEV: &str = c::siliconflow::FLUX_1_DEV;
pub const FLUX_1_SCHNELL: &str = c::siliconflow::FLUX_1_SCHNELL;
pub const FLUX_1_SCHNELL_PRO: &str = c::siliconflow::FLUX_1_SCHNELL_PRO;
pub const FLUX_1_DEV_LORA: &str = c::siliconflow::FLUX_1_DEV_LORA;
pub const STABLE_DIFFUSION_3_5_LARGE: &str = c::siliconflow::STABLE_DIFFUSION_3_5_LARGE;
pub const STABLE_DIFFUSION_XL_BASE_1_0: &str =
c::siliconflow::STABLE_DIFFUSION_XL_BASE_1_0;
pub const KOLORS: &str = c::siliconflow::KOLORS;
}
}
#[cfg(feature = "ollama")]
pub mod ollama {
use crate::providers::ollama::model_constants as c;
pub const LLAMA_3_2: &str = c::llama_3_2::LLAMA_3_2;
pub const LLAMA_3_2_3B: &str = c::llama_3_2::LLAMA_3_2_3B;
pub const LLAMA_3_2_1B: &str = c::llama_3_2::LLAMA_3_2_1B;
pub const LLAMA_3_1: &str = c::llama_3_1::LLAMA_3_1;
pub const LLAMA_3_1_8B: &str = c::llama_3_1::LLAMA_3_1_8B;
pub const LLAMA_3_1_70B: &str = c::llama_3_1::LLAMA_3_1_70B;
pub const CODE_LLAMA: &str = c::code_llama::CODE_LLAMA;
pub const CODE_LLAMA_13B: &str = c::code_llama::CODE_LLAMA_13B;
pub const MISTRAL: &str = c::mistral::MISTRAL;
pub const PHI_3: &str = c::phi_3::PHI_3;
pub const GEMMA: &str = c::gemma::GEMMA;
pub const QWEN2: &str = c::qwen2::QWEN2;
pub const DEEPSEEK_R1: &str = c::deepseek::DEEPSEEK_R1;
pub const DEEPSEEK_CODER: &str = c::deepseek::DEEPSEEK_CODER;
pub const NOMIC_EMBED_TEXT: &str = c::embeddings::NOMIC_EMBED_TEXT;
}
#[cfg(feature = "xai")]
pub mod xai {
use crate::providers::xai::models as c;
pub const GROK_4: &str = c::grok_4::GROK_4;
pub const GROK_4_0709: &str = c::grok_4::GROK_4_0709;
pub const GROK_4_LATEST: &str = c::grok_4::GROK_4_LATEST;
pub const GROK_3: &str = c::grok_3::GROK_3;
pub const GROK_3_LATEST: &str = c::grok_3::GROK_3_LATEST;
pub const GROK_3_MINI: &str = c::grok_3::GROK_3_MINI;
pub const GROK_3_FAST: &str = c::grok_3::GROK_3_FAST;
pub const GROK_2: &str = c::grok_2::GROK_2;
pub const GROK_2_LATEST: &str = c::grok_2::GROK_2_LATEST;
pub const GROK_2_IMAGE: &str = c::images::GROK_2_IMAGE;
pub const GROK_BETA: &str = c::legacy::GROK_BETA;
}
#[cfg(feature = "groq")]
pub mod groq {
use crate::providers::groq::models as c;
pub const LLAMA_3_1_8B_INSTANT: &str = c::production::LLAMA_3_1_8B_INSTANT;
pub const LLAMA_3_3_70B_VERSATILE: &str = c::production::LLAMA_3_3_70B_VERSATILE;
pub const LLAMA_GUARD_4_12B: &str = c::production::LLAMA_GUARD_4_12B;
pub const WHISPER_LARGE_V3: &str = c::production::WHISPER_LARGE_V3;
pub const WHISPER_LARGE_V3_TURBO: &str = c::production::WHISPER_LARGE_V3_TURBO;
pub const DEEPSEEK_R1_DISTILL_LLAMA_70B: &str = c::preview::DEEPSEEK_R1_DISTILL_LLAMA_70B;
pub const GPT_OSS_120B: &str = c::preview::GPT_OSS_120B;
pub const GPT_OSS_20B: &str = c::preview::GPT_OSS_20B;
pub const QWEN3_32B: &str = c::preview::QWEN3_32B;
pub const PLAYAI_TTS: &str = c::preview::PLAYAI_TTS;
pub const COMPOUND_BETA: &str = c::systems::COMPOUND_BETA;
pub const COMPOUND_BETA_MINI: &str = c::systems::COMPOUND_BETA_MINI;
}
}