use serde_json::Value;
use std::collections::HashMap;
use crate::core::types::model::ModelInfo;
type CohereModelEntry = (
&'static str,
&'static str,
u32,
Option<u32>,
bool,
bool,
&'static str,
&'static str,
Option<f64>,
Option<f64>,
);
const COHERE_MODELS: &[CohereModelEntry] = &[
(
"command-a-plus-05-2026",
"Command A+",
128000,
Some(64000),
true,
true,
"chat",
"live",
None,
None,
),
(
"command-a-03-2025",
"Command A",
256000,
Some(8000),
true,
false,
"chat",
"live",
Some(0.0025),
Some(0.010),
),
(
"command-a-reasoning-08-2025",
"Command A Reasoning",
256000,
Some(32000),
true,
false,
"chat",
"live",
None,
None,
),
(
"command-a-vision-07-2025",
"Command A Vision",
128000,
Some(8000),
false,
true,
"chat",
"live",
None,
None,
),
(
"command-a-translate-08-2025",
"Command A Translate",
8000,
Some(8000),
false,
false,
"chat",
"live",
None,
None,
),
(
"command-r7b-12-2024",
"Command R7B",
128000,
Some(4096),
true,
false,
"chat",
"live",
None,
None,
),
(
"command-r-plus-08-2024",
"Command R+ 08-2024",
128000,
Some(4096),
true,
false,
"chat",
"live",
Some(0.003),
Some(0.015),
),
(
"command-r-08-2024",
"Command R 08-2024",
128000,
Some(4096),
true,
false,
"chat",
"live",
Some(0.0005),
Some(0.0015),
),
(
"command-r-plus",
"Command R+",
128000,
Some(4096),
true,
false,
"chat",
"deprecated_2025_09_15",
Some(0.003),
Some(0.015),
),
(
"command-r",
"Command R",
128000,
Some(4096),
true,
false,
"chat",
"deprecated_2025_09_15",
Some(0.0005),
Some(0.0015),
),
(
"command",
"Command",
4096,
Some(4096),
true,
false,
"chat",
"deprecated_2025_09_15",
Some(0.001),
Some(0.002),
),
(
"command-light",
"Command Light",
4096,
Some(4096),
false,
false,
"chat",
"deprecated_2025_09_15",
Some(0.0003),
Some(0.0006),
),
(
"embed-v4.0",
"Embed v4.0",
128000,
None,
false,
true,
"embedding",
"live",
None,
None,
),
(
"embed-english-v3.0",
"Embed English v3.0",
512,
None,
false,
true,
"embedding",
"live",
Some(0.0001),
Some(0.0),
),
(
"embed-multilingual-v3.0",
"Embed Multilingual v3.0",
512,
None,
false,
true,
"embedding",
"live",
Some(0.0001),
Some(0.0),
),
(
"embed-english-light-v3.0",
"Embed English Light v3.0",
512,
None,
false,
true,
"embedding",
"live",
Some(0.0001),
Some(0.0),
),
(
"embed-multilingual-light-v3.0",
"Embed Multilingual Light v3.0",
512,
None,
false,
true,
"embedding",
"live",
Some(0.0001),
Some(0.0),
),
(
"rerank-v4.0-pro",
"Rerank v4.0 Pro",
32000,
None,
false,
false,
"rerank",
"live",
None,
None,
),
(
"rerank-v4.0-fast",
"Rerank v4.0 Fast",
32000,
None,
false,
false,
"rerank",
"live",
None,
None,
),
(
"rerank-v3.5",
"Rerank v3.5",
4096,
None,
false,
false,
"rerank",
"live",
None,
None,
),
(
"rerank-english-v3.0",
"Rerank English v3.0",
4096,
None,
false,
false,
"rerank",
"live",
Some(0.002),
Some(0.0),
),
(
"rerank-multilingual-v3.0",
"Rerank Multilingual v3.0",
4096,
None,
false,
false,
"rerank",
"live",
Some(0.002),
Some(0.0),
),
(
"cohere-transcribe-03-2026",
"Cohere Transcribe",
0,
None,
false,
false,
"audio_transcription",
"live",
None,
None,
),
(
"tiny-aya-global",
"Tiny Aya Global",
8000,
Some(8000),
false,
false,
"chat",
"live",
None,
None,
),
(
"tiny-aya-earth",
"Tiny Aya Earth",
8000,
Some(8000),
false,
false,
"chat",
"live",
None,
None,
),
(
"tiny-aya-fire",
"Tiny Aya Fire",
8000,
Some(8000),
false,
false,
"chat",
"live",
None,
None,
),
(
"tiny-aya-water",
"Tiny Aya Water",
8000,
Some(8000),
false,
false,
"chat",
"live",
None,
None,
),
(
"c4ai-aya-expanse-32b",
"Aya Expanse 32B",
128000,
Some(4096),
false,
false,
"chat",
"live",
None,
None,
),
(
"c4ai-aya-vision-32b",
"Aya Vision 32B",
16000,
Some(4096),
false,
true,
"chat",
"live",
None,
None,
),
];
pub(super) fn create_model_registry() -> Vec<ModelInfo> {
COHERE_MODELS
.iter()
.map(
|(
id,
name,
max_context_length,
max_output_length,
supports_tools,
supports_multimodal,
mode,
status,
input_cost_per_1k_tokens,
output_cost_per_1k_tokens,
)| ModelInfo {
id: (*id).to_string(),
name: (*name).to_string(),
provider: "cohere".to_string(),
max_context_length: *max_context_length,
max_output_length: *max_output_length,
supports_streaming: *mode == "chat",
supports_tools: *supports_tools,
supports_multimodal: *supports_multimodal,
input_cost_per_1k_tokens: *input_cost_per_1k_tokens,
output_cost_per_1k_tokens: *output_cost_per_1k_tokens,
currency: "USD".to_string(),
capabilities: vec![],
created_at: None,
updated_at: None,
metadata: HashMap::from([(
"status".to_string(),
Value::String((*status).to_string()),
)]),
},
)
.collect()
}