1use std::borrow::Cow;
5use std::sync::LazyLock;
6use crate::ReasoningEffort;
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
11pub enum Provider {
12 Anthropic,
13 Codex,
14 DeepSeek,
15 Gemini,
16 Moonshot,
17 Openai,
18 OpenRouter,
19 ZAi,
20 Bedrock,
21 Ollama,
22 LlamaCpp,
23}
24impl Provider {
25 pub const ALL: &[Provider] = &[
27 Self::Anthropic,
28 Self::Codex,
29 Self::DeepSeek,
30 Self::Gemini,
31 Self::Moonshot,
32 Self::Openai,
33 Self::OpenRouter,
34 Self::ZAi,
35 Self::Bedrock,
36 Self::Ollama,
37 Self::LlamaCpp,
38 ];
39 pub fn parser_name(self) -> &'static str {
41 match self {
42 Self::Anthropic => "anthropic",
43 Self::Codex => "codex",
44 Self::DeepSeek => "deepseek",
45 Self::Gemini => "gemini",
46 Self::Moonshot => "moonshot",
47 Self::Openai => "openai",
48 Self::OpenRouter => "openrouter",
49 Self::ZAi => "zai",
50 Self::Bedrock => "bedrock",
51 Self::Ollama => "ollama",
52 Self::LlamaCpp => "llamacpp",
53 }
54 }
55 pub fn display_name(self) -> &'static str {
57 match self {
58 Self::Anthropic => "Anthropic",
59 Self::Codex => "Codex",
60 Self::DeepSeek => "DeepSeek",
61 Self::Gemini => "Gemini",
62 Self::Moonshot => "Moonshot",
63 Self::Openai => "OpenAI",
64 Self::OpenRouter => "OpenRouter",
65 Self::ZAi => "ZAI",
66 Self::Bedrock => "AWS Bedrock",
67 Self::Ollama => "Ollama",
68 Self::LlamaCpp => "LlamaCpp",
69 }
70 }
71 pub fn required_env_var(self) -> Option<&'static str> {
73 match self {
74 Self::Anthropic => Some("ANTHROPIC_API_KEY"),
75 Self::DeepSeek => Some("DEEPSEEK_API_KEY"),
76 Self::Gemini => Some("GEMINI_API_KEY"),
77 Self::Moonshot => Some("MOONSHOT_API_KEY"),
78 Self::Openai => Some("OPENAI_API_KEY"),
79 Self::OpenRouter => Some("OPENROUTER_API_KEY"),
80 Self::ZAi => Some("ZAI_API_KEY"),
81 Self::Codex | Self::Bedrock | Self::Ollama | Self::LlamaCpp => None,
82 }
83 }
84 pub fn oauth_provider_id(self) -> Option<&'static str> {
86 match self {
87 Self::Codex => Some("codex"),
88 Self::Anthropic
89 | Self::DeepSeek
90 | Self::Gemini
91 | Self::Moonshot
92 | Self::Openai
93 | Self::OpenRouter
94 | Self::ZAi
95 | Self::Bedrock
96 | Self::Ollama
97 | Self::LlamaCpp => None,
98 }
99 }
100 pub fn is_local(self) -> bool {
103 match self {
104 Self::Ollama | Self::LlamaCpp => true,
105 Self::Anthropic
106 | Self::Codex
107 | Self::DeepSeek
108 | Self::Gemini
109 | Self::Moonshot
110 | Self::Openai
111 | Self::OpenRouter
112 | Self::ZAi
113 | Self::Bedrock => false,
114 }
115 }
116}
117impl std::fmt::Display for Provider {
118 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
119 f.write_str(self.parser_name())
120 }
121}
122impl std::str::FromStr for Provider {
123 type Err = String;
124 fn from_str(s: &str) -> Result<Self, Self::Err> {
125 match s {
126 "anthropic" => Ok(Self::Anthropic),
127 "codex" => Ok(Self::Codex),
128 "deepseek" => Ok(Self::DeepSeek),
129 "gemini" => Ok(Self::Gemini),
130 "moonshot" => Ok(Self::Moonshot),
131 "openai" => Ok(Self::Openai),
132 "openrouter" => Ok(Self::OpenRouter),
133 "zai" => Ok(Self::ZAi),
134 "bedrock" => Ok(Self::Bedrock),
135 "ollama" => Ok(Self::Ollama),
136 "llamacpp" => Ok(Self::LlamaCpp),
137 other => Err(format!("Unknown provider: '{other}'")),
138 }
139 }
140}
141#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
142pub enum AnthropicModel {
143 ClaudeFable5,
144 ClaudeHaiku45,
145 ClaudeHaiku4520251001,
146 ClaudeOpus41,
147 ClaudeOpus4120250805,
148 ClaudeOpus45,
149 ClaudeOpus4520251101,
150 ClaudeOpus46,
151 ClaudeOpus47,
152 ClaudeOpus48,
153 ClaudeSonnet45,
154 ClaudeSonnet4520250929,
155 ClaudeSonnet46,
156 ClaudeSonnet5,
157}
158#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
159pub enum CodexModel {
160 Gpt52,
161 Gpt54,
162 Gpt54Mini,
163 Gpt55,
164 Gpt56Luna,
165 Gpt56Sol,
166 Gpt56Terra,
167}
168#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
169pub enum DeepSeekModel {
170 DeepseekChat,
171 DeepseekReasoner,
172 DeepseekV4Flash,
173 DeepseekV4Pro,
174}
175#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
176pub enum GeminiModel {
177 Gemini20Flash,
178 Gemini20FlashLite,
179 Gemini25Flash,
180 Gemini25FlashLite,
181 Gemini25Pro,
182 Gemini3FlashPreview,
183 Gemini3ProPreview,
184 Gemini31FlashLite,
185 Gemini31FlashLitePreview,
186 Gemini31ProPreview,
187 Gemini31ProPreviewCustomtools,
188 Gemini35Flash,
189 Gemma426bA4bIt,
190 Gemma431bIt,
191}
192#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
193pub enum MoonshotModel {
194 KimiK20711Preview,
195 KimiK20905Preview,
196 KimiK2Thinking,
197 KimiK2ThinkingTurbo,
198 KimiK2TurboPreview,
199 KimiK25,
200 KimiK26,
201 KimiK27Code,
202 KimiK27CodeHighspeed,
203}
204#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
205pub enum OpenaiModel {
206 Gpt4,
207 Gpt4Turbo,
208 Gpt41,
209 Gpt41Mini,
210 Gpt41Nano,
211 Gpt4o,
212 Gpt4o20240513,
213 Gpt4o20240806,
214 Gpt4o20241120,
215 Gpt4oMini,
216 Gpt5,
217 Gpt5Codex,
218 Gpt5Mini,
219 Gpt5Nano,
220 Gpt5Pro,
221 Gpt51,
222 Gpt51Codex,
223 Gpt51CodexMax,
224 Gpt51CodexMini,
225 Gpt52,
226 Gpt52Codex,
227 Gpt52Pro,
228 Gpt53Codex,
229 Gpt53CodexSpark,
230 Gpt54,
231 Gpt54Mini,
232 Gpt54Nano,
233 Gpt54Pro,
234 Gpt55,
235 Gpt55Pro,
236 Gpt56,
237 Gpt56Luna,
238 Gpt56Sol,
239 Gpt56Terra,
240 O1,
241 O1Pro,
242 O3,
243 O3DeepResearch,
244 O3Mini,
245 O3Pro,
246 O4Mini,
247 O4MiniDeepResearch,
248}
249#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
250pub enum OpenRouterModel {
251 Ai21JambaLarge17,
252 AionLabsAion20,
253 AionLabsAion30,
254 AionLabsAion30Mini,
255 AmazonNova2LiteV1,
256 AmazonNovaLiteV1,
257 AmazonNovaMicroV1,
258 AmazonNovaPremierV1,
259 AmazonNovaProV1,
260 AnthropicClaude3Haiku,
261 AnthropicClaudeFable5,
262 AnthropicClaudeHaiku45,
263 AnthropicClaudeOpus4,
264 AnthropicClaudeOpus41,
265 AnthropicClaudeOpus45,
266 AnthropicClaudeOpus46,
267 AnthropicClaudeOpus47,
268 AnthropicClaudeOpus47Fast,
269 AnthropicClaudeOpus48,
270 AnthropicClaudeOpus48Fast,
271 AnthropicClaudeSonnet4,
272 AnthropicClaudeSonnet45,
273 AnthropicClaudeSonnet46,
274 AnthropicClaudeSonnet5,
275 ArceeAiTrinityLargeThinking,
276 ArceeAiTrinityMini,
277 ArceeAiVirtuosoLarge,
278 BytedanceSeedSeed16,
279 BytedanceSeedSeed16Flash,
280 BytedanceSeedSeed20Lite,
281 BytedanceSeedSeed20Mini,
282 CohereCommandR082024,
283 CohereCommandRPlus082024,
284 CohereNorthMiniCodeFree,
285 DeepseekDeepseekChat,
286 DeepseekDeepseekChatV30324,
287 DeepseekDeepseekChatV31,
288 DeepseekDeepseekR1,
289 DeepseekDeepseekR10528,
290 DeepseekDeepseekV31Terminus,
291 DeepseekDeepseekV32,
292 DeepseekDeepseekV32Exp,
293 DeepseekDeepseekV4Flash,
294 DeepseekDeepseekV4Pro,
295 GoogleGemini25Flash,
296 GoogleGemini25FlashLite,
297 GoogleGemini25Pro,
298 GoogleGemini25ProPreview,
299 GoogleGemini25ProPreview0506,
300 GoogleGemini3FlashPreview,
301 GoogleGemini3ProImage,
302 GoogleGemini31FlashLite,
303 GoogleGemini31FlashLitePreview,
304 GoogleGemini31ProPreview,
305 GoogleGemini31ProPreviewCustomtools,
306 GoogleGemini35Flash,
307 GoogleGemma312bIt,
308 GoogleGemma327bIt,
309 GoogleGemma426bA4bIt,
310 GoogleGemma426bA4bItFree,
311 GoogleGemma431bIt,
312 GoogleGemma431bItFree,
313 IbmGraniteGranite418b,
314 InceptionMercury2,
315 InclusionaiLing261t,
316 InclusionaiLing26Flash,
317 InclusionaiRing261t,
318 KwaipilotKatCoderProV2,
319 LiquidLfm2512bThinkingFree,
320 MetaLlamaLlama3170bInstruct,
321 MetaLlamaLlama318bInstruct,
322 MetaLlamaLlama3370bInstruct,
323 MetaLlamaLlama3370bInstructFree,
324 MetaLlamaLlama4Maverick,
325 MetaLlamaLlama4Scout,
326 MinimaxMinimaxM1,
327 MinimaxMinimaxM2,
328 MinimaxMinimaxM21,
329 MinimaxMinimaxM25,
330 MinimaxMinimaxM27,
331 MinimaxMinimaxM3,
332 MistralaiCodestral2508,
333 MistralaiDevstral2512,
334 MistralaiMinistral14b2512,
335 MistralaiMinistral3b2512,
336 MistralaiMinistral8b2512,
337 MistralaiMistralLarge,
338 MistralaiMistralLarge2407,
339 MistralaiMistralLarge2512,
340 MistralaiMistralMedium3,
341 MistralaiMistralMedium35,
342 MistralaiMistralMedium31,
343 MistralaiMistralNemo,
344 MistralaiMistralSaba,
345 MistralaiMistralSmall2603,
346 MistralaiMistralSmall3224bInstruct,
347 MistralaiMixtral8x22bInstruct,
348 MistralaiVoxtralSmall24b2507,
349 MoonshotaiKimiK2,
350 MoonshotaiKimiK20905,
351 MoonshotaiKimiK2Thinking,
352 MoonshotaiKimiK25,
353 MoonshotaiKimiK26,
354 MoonshotaiKimiK27Code,
355 NexAgiNexN2Mini,
356 NexAgiNexN2Pro,
357 NvidiaLlama33NemotronSuper49bV15,
358 NvidiaNemotron3Nano30bA3b,
359 NvidiaNemotron3Nano30bA3bFree,
360 NvidiaNemotron3NanoOmni30bA3bReasoningFree,
361 NvidiaNemotron3Super120bA12b,
362 NvidiaNemotron3Super120bA12bFree,
363 NvidiaNemotron3Ultra550bA55b,
364 NvidiaNemotron3Ultra550bA55bFree,
365 NvidiaNemotronNano12bV2VlFree,
366 NvidiaNemotronNano9bV2Free,
367 OpenaiGpt35Turbo,
368 OpenaiGpt35Turbo0613,
369 OpenaiGpt35Turbo16k,
370 OpenaiGpt4,
371 OpenaiGpt4Turbo,
372 OpenaiGpt4TurboPreview,
373 OpenaiGpt41,
374 OpenaiGpt41Mini,
375 OpenaiGpt41Nano,
376 OpenaiGpt4o,
377 OpenaiGpt4o20240513,
378 OpenaiGpt4o20240806,
379 OpenaiGpt4o20241120,
380 OpenaiGpt4oMini,
381 OpenaiGpt4oMini20240718,
382 OpenaiGpt5,
383 OpenaiGpt5Codex,
384 OpenaiGpt5Mini,
385 OpenaiGpt5Nano,
386 OpenaiGpt5Pro,
387 OpenaiGpt51,
388 OpenaiGpt51Chat,
389 OpenaiGpt51Codex,
390 OpenaiGpt51CodexMax,
391 OpenaiGpt51CodexMini,
392 OpenaiGpt52,
393 OpenaiGpt52Chat,
394 OpenaiGpt52Codex,
395 OpenaiGpt52Pro,
396 OpenaiGpt53Chat,
397 OpenaiGpt53Codex,
398 OpenaiGpt54,
399 OpenaiGpt54Mini,
400 OpenaiGpt54Nano,
401 OpenaiGpt54Pro,
402 OpenaiGpt55,
403 OpenaiGpt55Pro,
404 OpenaiGptAudio,
405 OpenaiGptAudioMini,
406 OpenaiGptOss120b,
407 OpenaiGptOss120bFree,
408 OpenaiGptOss20b,
409 OpenaiGptOss20bFree,
410 OpenaiGptOssSafeguard20b,
411 OpenaiO1,
412 OpenaiO3,
413 OpenaiO3DeepResearch,
414 OpenaiO3Mini,
415 OpenaiO3MiniHigh,
416 OpenaiO3Pro,
417 OpenaiO4Mini,
418 OpenaiO4MiniDeepResearch,
419 OpenaiO4MiniHigh,
420 OpenrouterAuto,
421 OpenrouterFree,
422 PoolsideLagunaM1,
423 PoolsideLagunaM1Free,
424 PoolsideLagunaXs21,
425 PoolsideLagunaXs21Free,
426 QwenQwen2572bInstruct,
427 QwenQwen257bInstruct,
428 QwenQwenPlus,
429 QwenQwenPlus20250728,
430 QwenQwenPlus20250728Thinking,
431 QwenQwen314b,
432 QwenQwen3235bA22b,
433 QwenQwen3235bA22b2507,
434 QwenQwen3235bA22bThinking2507,
435 QwenQwen330bA3b,
436 QwenQwen330bA3bInstruct2507,
437 QwenQwen330bA3bThinking2507,
438 QwenQwen332b,
439 QwenQwen38b,
440 QwenQwen3Coder,
441 QwenQwen3Coder30bA3bInstruct,
442 QwenQwen3CoderFlash,
443 QwenQwen3CoderNext,
444 QwenQwen3CoderPlus,
445 QwenQwen3CoderFree,
446 QwenQwen3Max,
447 QwenQwen3MaxThinking,
448 QwenQwen3Next80bA3bInstruct,
449 QwenQwen3Next80bA3bInstructFree,
450 QwenQwen3Next80bA3bThinking,
451 QwenQwen3Vl235bA22bInstruct,
452 QwenQwen3Vl235bA22bThinking,
453 QwenQwen3Vl30bA3bInstruct,
454 QwenQwen3Vl30bA3bThinking,
455 QwenQwen3Vl32bInstruct,
456 QwenQwen3Vl8bInstruct,
457 QwenQwen3Vl8bThinking,
458 QwenQwen35122bA10b,
459 QwenQwen3527b,
460 QwenQwen3535bA3b,
461 QwenQwen35397bA17b,
462 QwenQwen359b,
463 QwenQwen35Flash0223,
464 QwenQwen35Plus0215,
465 QwenQwen35Plus20260420,
466 QwenQwen3627b,
467 QwenQwen3635bA3b,
468 QwenQwen36Flash,
469 QwenQwen36MaxPreview,
470 QwenQwen36Plus,
471 QwenQwen37Max,
472 QwenQwen37Plus,
473 RekaaiRekaEdge,
474 RelaceRelaceSearch,
475 SakanaFuguUltra,
476 Sao10kL31Euryale70b,
477 StepfunStep35Flash,
478 StepfunStep37Flash,
479 TencentHy3,
480 TencentHy3Preview,
481 TencentHy3Free,
482 ThedrummerUnslopnemo12b,
483 UpstageSolarPro3,
484 XAiGrok420,
485 XAiGrok43,
486 XAiGrok45,
487 XAiGrokBuild01,
488 XiaomiMimoV25,
489 XiaomiMimoV25Pro,
490 ZAiGlm45,
491 ZAiGlm45Air,
492 ZAiGlm45v,
493 ZAiGlm46,
494 ZAiGlm46v,
495 ZAiGlm47,
496 ZAiGlm47Flash,
497 ZAiGlm5,
498 ZAiGlm5Turbo,
499 ZAiGlm51,
500 ZAiGlm52,
501 ZAiGlm5vTurbo,
502}
503#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
504pub enum ZAiModel {
505 Glm45,
506 Glm45Air,
507 Glm45Flash,
508 Glm45v,
509 Glm46,
510 Glm46v,
511 Glm47,
512 Glm47Flash,
513 Glm47Flashx,
514 Glm5,
515 Glm5Turbo,
516 Glm51,
517 Glm52,
518 Glm5vTurbo,
519}
520#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
521pub enum BedrockFoundationModel {
522 AmazonNova2LiteV10,
523 AmazonNovaLiteV10,
524 AmazonNovaMicroV10,
525 AmazonNovaProV10,
526 AnthropicClaudeFable5,
527 AnthropicClaudeHaiku4520251001V10,
528 AnthropicClaudeOpus4120250805V10,
529 AnthropicClaudeOpus4520251101V10,
530 AnthropicClaudeOpus46V1,
531 AnthropicClaudeOpus47,
532 AnthropicClaudeOpus48,
533 AnthropicClaudeSonnet4520250929V10,
534 AnthropicClaudeSonnet46,
535 AnthropicClaudeSonnet5,
536 AuAnthropicClaudeHaiku4520251001V10,
537 AuAnthropicClaudeOpus46V1,
538 AuAnthropicClaudeOpus48,
539 AuAnthropicClaudeSonnet4520250929V10,
540 AuAnthropicClaudeSonnet46,
541 AuAnthropicClaudeSonnet5,
542 DeepseekR1V10,
543 DeepseekV3V10,
544 DeepseekV32,
545 EuAnthropicClaudeFable5,
546 EuAnthropicClaudeHaiku4520251001V10,
547 EuAnthropicClaudeOpus4520251101V10,
548 EuAnthropicClaudeOpus46V1,
549 EuAnthropicClaudeOpus47,
550 EuAnthropicClaudeOpus48,
551 EuAnthropicClaudeSonnet4520250929V10,
552 EuAnthropicClaudeSonnet46,
553 EuAnthropicClaudeSonnet5,
554 GlobalAnthropicClaudeFable5,
555 GlobalAnthropicClaudeHaiku4520251001V10,
556 GlobalAnthropicClaudeOpus4520251101V10,
557 GlobalAnthropicClaudeOpus46V1,
558 GlobalAnthropicClaudeOpus47,
559 GlobalAnthropicClaudeOpus48,
560 GlobalAnthropicClaudeSonnet4520250929V10,
561 GlobalAnthropicClaudeSonnet46,
562 GlobalAnthropicClaudeSonnet5,
563 GoogleGemma327bIt,
564 GoogleGemma34bIt,
565 JpAnthropicClaudeHaiku4520251001V10,
566 JpAnthropicClaudeOpus47,
567 JpAnthropicClaudeOpus48,
568 JpAnthropicClaudeSonnet4520250929V10,
569 JpAnthropicClaudeSonnet46,
570 JpAnthropicClaudeSonnet5,
571 MetaLlama3170bInstructV10,
572 MetaLlama318bInstructV10,
573 MetaLlama3370bInstructV10,
574 MetaLlama4Maverick17bInstructV10,
575 MetaLlama4Scout17bInstructV10,
576 MinimaxMinimaxM2,
577 MinimaxMinimaxM21,
578 MinimaxMinimaxM25,
579 MistralDevstral2123b,
580 MistralMagistralSmall2509,
581 MistralMinistral314bInstruct,
582 MistralMinistral33bInstruct,
583 MistralMinistral38bInstruct,
584 MistralMistralLarge3675bInstruct,
585 MistralPixtralLarge2502V10,
586 MistralVoxtralMini3b2507,
587 MistralVoxtralSmall24b2507,
588 MoonshotKimiK2Thinking,
589 MoonshotaiKimiK25,
590 NvidiaNemotronNano12bV2,
591 NvidiaNemotronNano330b,
592 NvidiaNemotronNano9bV2,
593 NvidiaNemotronSuper3120b,
594 OpenaiGpt54,
595 OpenaiGpt55,
596 OpenaiGptOss120b,
597 OpenaiGptOss120b10,
598 OpenaiGptOss20b,
599 OpenaiGptOss20b10,
600 OpenaiGptOssSafeguard120b,
601 OpenaiGptOssSafeguard20b,
602 QwenQwen3235bA22b2507V10,
603 QwenQwen332bV10,
604 QwenQwen3Coder30bA3bV10,
605 QwenQwen3Coder480bA35bV10,
606 QwenQwen3CoderNext,
607 QwenQwen3Next80bA3b,
608 QwenQwen3Vl235bA22b,
609 UsAnthropicClaudeFable5,
610 UsAnthropicClaudeHaiku4520251001V10,
611 UsAnthropicClaudeOpus4120250805V10,
612 UsAnthropicClaudeOpus4520251101V10,
613 UsAnthropicClaudeOpus46V1,
614 UsAnthropicClaudeOpus47,
615 UsAnthropicClaudeOpus48,
616 UsAnthropicClaudeSonnet4520250929V10,
617 UsAnthropicClaudeSonnet46,
618 UsAnthropicClaudeSonnet5,
619 UsDeepseekR1V10,
620 UsMetaLlama4Maverick17bInstructV10,
621 UsMetaLlama4Scout17bInstructV10,
622 WriterPalmyraX4V10,
623 WriterPalmyraX5V10,
624 XaiGrok43,
625 ZaiGlm47,
626 ZaiGlm47Flash,
627 ZaiGlm5,
628}
629impl AnthropicModel {
630 #[allow(clippy::too_many_lines)]
631 fn model_id(self) -> &'static str {
632 match self {
633 Self::ClaudeFable5 => "claude-fable-5",
634 Self::ClaudeHaiku45 => "claude-haiku-4-5",
635 Self::ClaudeHaiku4520251001 => "claude-haiku-4-5-20251001",
636 Self::ClaudeOpus41 => "claude-opus-4-1",
637 Self::ClaudeOpus4120250805 => "claude-opus-4-1-20250805",
638 Self::ClaudeOpus45 => "claude-opus-4-5",
639 Self::ClaudeOpus4520251101 => "claude-opus-4-5-20251101",
640 Self::ClaudeOpus46 => "claude-opus-4-6",
641 Self::ClaudeOpus47 => "claude-opus-4-7",
642 Self::ClaudeOpus48 => "claude-opus-4-8",
643 Self::ClaudeSonnet45 => "claude-sonnet-4-5",
644 Self::ClaudeSonnet4520250929 => "claude-sonnet-4-5-20250929",
645 Self::ClaudeSonnet46 => "claude-sonnet-4-6",
646 Self::ClaudeSonnet5 => "claude-sonnet-5",
647 }
648 }
649 #[allow(clippy::too_many_lines)]
650 fn display_name(self) -> &'static str {
651 match self {
652 Self::ClaudeFable5 => "Claude Fable 5",
653 Self::ClaudeHaiku4520251001 => "Claude Haiku 4.5",
654 Self::ClaudeHaiku45 => "Claude Haiku 4.5 (latest)",
655 Self::ClaudeOpus4120250805 => "Claude Opus 4.1",
656 Self::ClaudeOpus41 => "Claude Opus 4.1 (latest)",
657 Self::ClaudeOpus4520251101 => "Claude Opus 4.5",
658 Self::ClaudeOpus45 => "Claude Opus 4.5 (latest)",
659 Self::ClaudeOpus46 => "Claude Opus 4.6",
660 Self::ClaudeOpus47 => "Claude Opus 4.7",
661 Self::ClaudeOpus48 => "Claude Opus 4.8",
662 Self::ClaudeSonnet4520250929 => "Claude Sonnet 4.5",
663 Self::ClaudeSonnet45 => "Claude Sonnet 4.5 (latest)",
664 Self::ClaudeSonnet46 => "Claude Sonnet 4.6",
665 Self::ClaudeSonnet5 => "Claude Sonnet 5",
666 }
667 }
668 #[allow(clippy::too_many_lines)]
669 fn context_window(self) -> u32 {
670 match self {
671 Self::ClaudeHaiku45
672 | Self::ClaudeHaiku4520251001
673 | Self::ClaudeOpus41
674 | Self::ClaudeOpus4120250805
675 | Self::ClaudeOpus45
676 | Self::ClaudeOpus4520251101 => 200_000,
677 Self::ClaudeFable5
678 | Self::ClaudeOpus46
679 | Self::ClaudeOpus47
680 | Self::ClaudeOpus48
681 | Self::ClaudeSonnet45
682 | Self::ClaudeSonnet4520250929
683 | Self::ClaudeSonnet46
684 | Self::ClaudeSonnet5 => 1_000_000,
685 }
686 }
687 #[allow(clippy::too_many_lines)]
688 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
689 match self {
690 Self::ClaudeHaiku45
691 | Self::ClaudeHaiku4520251001
692 | Self::ClaudeOpus41
693 | Self::ClaudeOpus4120250805
694 | Self::ClaudeOpus45
695 | Self::ClaudeOpus4520251101
696 | Self::ClaudeSonnet45
697 | Self::ClaudeSonnet4520250929 => {
698 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
699 }
700 Self::ClaudeOpus46 | Self::ClaudeSonnet46 => {
701 &[
702 ReasoningEffort::Low,
703 ReasoningEffort::Medium,
704 ReasoningEffort::High,
705 ReasoningEffort::Max,
706 ]
707 }
708 Self::ClaudeFable5
709 | Self::ClaudeOpus47
710 | Self::ClaudeOpus48
711 | Self::ClaudeSonnet5 => {
712 &[
713 ReasoningEffort::Low,
714 ReasoningEffort::Medium,
715 ReasoningEffort::High,
716 ReasoningEffort::Xhigh,
717 ReasoningEffort::Max,
718 ]
719 }
720 }
721 }
722 pub fn supports_reasoning(self) -> bool {
723 !self.reasoning_levels().is_empty()
724 }
725 #[allow(clippy::too_many_lines)]
726 pub fn supports_prompt_caching(self) -> bool {
727 match self {
728 Self::ClaudeFable5
729 | Self::ClaudeHaiku45
730 | Self::ClaudeHaiku4520251001
731 | Self::ClaudeOpus41
732 | Self::ClaudeOpus4120250805
733 | Self::ClaudeOpus45
734 | Self::ClaudeOpus4520251101
735 | Self::ClaudeOpus46
736 | Self::ClaudeOpus47
737 | Self::ClaudeOpus48
738 | Self::ClaudeSonnet45
739 | Self::ClaudeSonnet4520250929
740 | Self::ClaudeSonnet46
741 | Self::ClaudeSonnet5 => true,
742 }
743 }
744 #[allow(clippy::too_many_lines)]
745 pub fn supports_image(self) -> bool {
746 match self {
747 Self::ClaudeFable5
748 | Self::ClaudeHaiku45
749 | Self::ClaudeHaiku4520251001
750 | Self::ClaudeOpus41
751 | Self::ClaudeOpus4120250805
752 | Self::ClaudeOpus45
753 | Self::ClaudeOpus4520251101
754 | Self::ClaudeOpus46
755 | Self::ClaudeOpus47
756 | Self::ClaudeOpus48
757 | Self::ClaudeSonnet45
758 | Self::ClaudeSonnet4520250929
759 | Self::ClaudeSonnet46
760 | Self::ClaudeSonnet5 => true,
761 }
762 }
763 #[allow(clippy::too_many_lines)]
764 pub fn supports_audio(self) -> bool {
765 match self {
766 Self::ClaudeFable5
767 | Self::ClaudeHaiku45
768 | Self::ClaudeHaiku4520251001
769 | Self::ClaudeOpus41
770 | Self::ClaudeOpus4120250805
771 | Self::ClaudeOpus45
772 | Self::ClaudeOpus4520251101
773 | Self::ClaudeOpus46
774 | Self::ClaudeOpus47
775 | Self::ClaudeOpus48
776 | Self::ClaudeSonnet45
777 | Self::ClaudeSonnet4520250929
778 | Self::ClaudeSonnet46
779 | Self::ClaudeSonnet5 => false,
780 }
781 }
782 const ALL: &[AnthropicModel] = &[
783 Self::ClaudeFable5,
784 Self::ClaudeHaiku45,
785 Self::ClaudeHaiku4520251001,
786 Self::ClaudeOpus41,
787 Self::ClaudeOpus4120250805,
788 Self::ClaudeOpus45,
789 Self::ClaudeOpus4520251101,
790 Self::ClaudeOpus46,
791 Self::ClaudeOpus47,
792 Self::ClaudeOpus48,
793 Self::ClaudeSonnet45,
794 Self::ClaudeSonnet4520250929,
795 Self::ClaudeSonnet46,
796 Self::ClaudeSonnet5,
797 ];
798}
799impl std::str::FromStr for AnthropicModel {
800 type Err = String;
801 #[allow(clippy::too_many_lines)]
802 fn from_str(s: &str) -> Result<Self, Self::Err> {
803 match s {
804 "claude-fable-5" => Ok(Self::ClaudeFable5),
805 "claude-haiku-4-5" => Ok(Self::ClaudeHaiku45),
806 "claude-haiku-4-5-20251001" => Ok(Self::ClaudeHaiku4520251001),
807 "claude-opus-4-1" => Ok(Self::ClaudeOpus41),
808 "claude-opus-4-1-20250805" => Ok(Self::ClaudeOpus4120250805),
809 "claude-opus-4-5" => Ok(Self::ClaudeOpus45),
810 "claude-opus-4-5-20251101" => Ok(Self::ClaudeOpus4520251101),
811 "claude-opus-4-6" => Ok(Self::ClaudeOpus46),
812 "claude-opus-4-7" => Ok(Self::ClaudeOpus47),
813 "claude-opus-4-8" => Ok(Self::ClaudeOpus48),
814 "claude-sonnet-4-5" => Ok(Self::ClaudeSonnet45),
815 "claude-sonnet-4-5-20250929" => Ok(Self::ClaudeSonnet4520250929),
816 "claude-sonnet-4-6" => Ok(Self::ClaudeSonnet46),
817 "claude-sonnet-5" => Ok(Self::ClaudeSonnet5),
818 _ => Err(format!("Unknown anthropic model: '{s}'")),
819 }
820 }
821}
822impl CodexModel {
823 #[allow(clippy::too_many_lines)]
824 fn model_id(self) -> &'static str {
825 match self {
826 Self::Gpt52 => "gpt-5.2",
827 Self::Gpt54 => "gpt-5.4",
828 Self::Gpt54Mini => "gpt-5.4-mini",
829 Self::Gpt55 => "gpt-5.5",
830 Self::Gpt56Luna => "gpt-5.6-luna",
831 Self::Gpt56Sol => "gpt-5.6-sol",
832 Self::Gpt56Terra => "gpt-5.6-terra",
833 }
834 }
835 #[allow(clippy::too_many_lines)]
836 fn display_name(self) -> &'static str {
837 match self {
838 Self::Gpt52 => "GPT-5.2",
839 Self::Gpt54 => "GPT-5.4",
840 Self::Gpt54Mini => "GPT-5.4 mini",
841 Self::Gpt55 => "GPT-5.5",
842 Self::Gpt56Luna => "GPT-5.6 Luna",
843 Self::Gpt56Sol => "GPT-5.6 Sol",
844 Self::Gpt56Terra => "GPT-5.6 Terra",
845 }
846 }
847 #[allow(clippy::too_many_lines)]
848 fn context_window(self) -> u32 {
849 match self {
850 Self::Gpt52 | Self::Gpt54 | Self::Gpt54Mini | Self::Gpt55 => 272_000,
851 Self::Gpt56Luna | Self::Gpt56Sol | Self::Gpt56Terra => 372_000,
852 }
853 }
854 #[allow(clippy::too_many_lines)]
855 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
856 match self {
857 Self::Gpt52 | Self::Gpt54 | Self::Gpt54Mini | Self::Gpt55 => {
858 &[
859 ReasoningEffort::Low,
860 ReasoningEffort::Medium,
861 ReasoningEffort::High,
862 ReasoningEffort::Xhigh,
863 ]
864 }
865 Self::Gpt56Luna | Self::Gpt56Sol | Self::Gpt56Terra => {
866 &[
867 ReasoningEffort::Low,
868 ReasoningEffort::Medium,
869 ReasoningEffort::High,
870 ReasoningEffort::Xhigh,
871 ReasoningEffort::Max,
872 ]
873 }
874 }
875 }
876 pub fn supports_reasoning(self) -> bool {
877 !self.reasoning_levels().is_empty()
878 }
879 #[allow(clippy::too_many_lines)]
880 pub fn supports_prompt_caching(self) -> bool {
881 match self {
882 Self::Gpt52
883 | Self::Gpt54
884 | Self::Gpt54Mini
885 | Self::Gpt55
886 | Self::Gpt56Luna
887 | Self::Gpt56Sol
888 | Self::Gpt56Terra => true,
889 }
890 }
891 #[allow(clippy::too_many_lines)]
892 pub fn supports_image(self) -> bool {
893 match self {
894 Self::Gpt52
895 | Self::Gpt54
896 | Self::Gpt54Mini
897 | Self::Gpt55
898 | Self::Gpt56Luna
899 | Self::Gpt56Sol
900 | Self::Gpt56Terra => true,
901 }
902 }
903 #[allow(clippy::too_many_lines)]
904 pub fn supports_audio(self) -> bool {
905 match self {
906 Self::Gpt52
907 | Self::Gpt54
908 | Self::Gpt54Mini
909 | Self::Gpt55
910 | Self::Gpt56Luna
911 | Self::Gpt56Sol
912 | Self::Gpt56Terra => false,
913 }
914 }
915 const ALL: &[CodexModel] = &[
916 Self::Gpt52,
917 Self::Gpt54,
918 Self::Gpt54Mini,
919 Self::Gpt55,
920 Self::Gpt56Luna,
921 Self::Gpt56Sol,
922 Self::Gpt56Terra,
923 ];
924}
925impl std::str::FromStr for CodexModel {
926 type Err = String;
927 #[allow(clippy::too_many_lines)]
928 fn from_str(s: &str) -> Result<Self, Self::Err> {
929 match s {
930 "gpt-5.2" => Ok(Self::Gpt52),
931 "gpt-5.4" => Ok(Self::Gpt54),
932 "gpt-5.4-mini" => Ok(Self::Gpt54Mini),
933 "gpt-5.5" => Ok(Self::Gpt55),
934 "gpt-5.6-luna" => Ok(Self::Gpt56Luna),
935 "gpt-5.6-sol" => Ok(Self::Gpt56Sol),
936 "gpt-5.6-terra" => Ok(Self::Gpt56Terra),
937 _ => Err(format!("Unknown codex model: '{s}'")),
938 }
939 }
940}
941impl DeepSeekModel {
942 #[allow(clippy::too_many_lines)]
943 fn model_id(self) -> &'static str {
944 match self {
945 Self::DeepseekChat => "deepseek-chat",
946 Self::DeepseekReasoner => "deepseek-reasoner",
947 Self::DeepseekV4Flash => "deepseek-v4-flash",
948 Self::DeepseekV4Pro => "deepseek-v4-pro",
949 }
950 }
951 #[allow(clippy::too_many_lines)]
952 fn display_name(self) -> &'static str {
953 match self {
954 Self::DeepseekChat => "DeepSeek Chat",
955 Self::DeepseekReasoner => "DeepSeek Reasoner",
956 Self::DeepseekV4Flash => "DeepSeek V4 Flash",
957 Self::DeepseekV4Pro => "DeepSeek V4 Pro",
958 }
959 }
960 #[allow(clippy::too_many_lines)]
961 fn context_window(self) -> u32 {
962 match self {
963 Self::DeepseekChat
964 | Self::DeepseekReasoner
965 | Self::DeepseekV4Flash
966 | Self::DeepseekV4Pro => 1_000_000,
967 }
968 }
969 #[allow(clippy::too_many_lines)]
970 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
971 match self {
972 Self::DeepseekChat => &[],
973 Self::DeepseekV4Flash | Self::DeepseekV4Pro => {
974 &[ReasoningEffort::High, ReasoningEffort::Max]
975 }
976 Self::DeepseekReasoner => {
977 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
978 }
979 }
980 }
981 pub fn supports_reasoning(self) -> bool {
982 !self.reasoning_levels().is_empty()
983 }
984 #[allow(clippy::too_many_lines)]
985 pub fn supports_prompt_caching(self) -> bool {
986 match self {
987 Self::DeepseekChat
988 | Self::DeepseekReasoner
989 | Self::DeepseekV4Flash
990 | Self::DeepseekV4Pro => true,
991 }
992 }
993 #[allow(clippy::too_many_lines)]
994 pub fn supports_image(self) -> bool {
995 match self {
996 Self::DeepseekChat
997 | Self::DeepseekReasoner
998 | Self::DeepseekV4Flash
999 | Self::DeepseekV4Pro => false,
1000 }
1001 }
1002 #[allow(clippy::too_many_lines)]
1003 pub fn supports_audio(self) -> bool {
1004 match self {
1005 Self::DeepseekChat
1006 | Self::DeepseekReasoner
1007 | Self::DeepseekV4Flash
1008 | Self::DeepseekV4Pro => false,
1009 }
1010 }
1011 const ALL: &[DeepSeekModel] = &[
1012 Self::DeepseekChat,
1013 Self::DeepseekReasoner,
1014 Self::DeepseekV4Flash,
1015 Self::DeepseekV4Pro,
1016 ];
1017}
1018impl std::str::FromStr for DeepSeekModel {
1019 type Err = String;
1020 #[allow(clippy::too_many_lines)]
1021 fn from_str(s: &str) -> Result<Self, Self::Err> {
1022 match s {
1023 "deepseek-chat" => Ok(Self::DeepseekChat),
1024 "deepseek-reasoner" => Ok(Self::DeepseekReasoner),
1025 "deepseek-v4-flash" => Ok(Self::DeepseekV4Flash),
1026 "deepseek-v4-pro" => Ok(Self::DeepseekV4Pro),
1027 _ => Err(format!("Unknown deepseek model: '{s}'")),
1028 }
1029 }
1030}
1031impl GeminiModel {
1032 #[allow(clippy::too_many_lines)]
1033 fn model_id(self) -> &'static str {
1034 match self {
1035 Self::Gemini20Flash => "gemini-2.0-flash",
1036 Self::Gemini20FlashLite => "gemini-2.0-flash-lite",
1037 Self::Gemini25Flash => "gemini-2.5-flash",
1038 Self::Gemini25FlashLite => "gemini-2.5-flash-lite",
1039 Self::Gemini25Pro => "gemini-2.5-pro",
1040 Self::Gemini3FlashPreview => "gemini-3-flash-preview",
1041 Self::Gemini3ProPreview => "gemini-3-pro-preview",
1042 Self::Gemini31FlashLite => "gemini-3.1-flash-lite",
1043 Self::Gemini31FlashLitePreview => "gemini-3.1-flash-lite-preview",
1044 Self::Gemini31ProPreview => "gemini-3.1-pro-preview",
1045 Self::Gemini31ProPreviewCustomtools => "gemini-3.1-pro-preview-customtools",
1046 Self::Gemini35Flash => "gemini-3.5-flash",
1047 Self::Gemma426bA4bIt => "gemma-4-26b-a4b-it",
1048 Self::Gemma431bIt => "gemma-4-31b-it",
1049 }
1050 }
1051 #[allow(clippy::too_many_lines)]
1052 fn display_name(self) -> &'static str {
1053 match self {
1054 Self::Gemini20Flash => "Gemini 2.0 Flash",
1055 Self::Gemini20FlashLite => "Gemini 2.0 Flash-Lite",
1056 Self::Gemini25Flash => "Gemini 2.5 Flash",
1057 Self::Gemini25FlashLite => "Gemini 2.5 Flash-Lite",
1058 Self::Gemini25Pro => "Gemini 2.5 Pro",
1059 Self::Gemini3FlashPreview => "Gemini 3 Flash Preview",
1060 Self::Gemini3ProPreview => "Gemini 3 Pro Preview",
1061 Self::Gemini31FlashLite => "Gemini 3.1 Flash Lite",
1062 Self::Gemini31FlashLitePreview => "Gemini 3.1 Flash Lite Preview",
1063 Self::Gemini31ProPreview => "Gemini 3.1 Pro Preview",
1064 Self::Gemini31ProPreviewCustomtools => "Gemini 3.1 Pro Preview Custom Tools",
1065 Self::Gemini35Flash => "Gemini 3.5 Flash",
1066 Self::Gemma426bA4bIt => "Gemma 4 26B A4B IT",
1067 Self::Gemma431bIt => "Gemma 4 31B IT",
1068 }
1069 }
1070 #[allow(clippy::too_many_lines)]
1071 fn context_window(self) -> u32 {
1072 match self {
1073 Self::Gemma426bA4bIt | Self::Gemma431bIt => 262_144,
1074 Self::Gemini20Flash
1075 | Self::Gemini20FlashLite
1076 | Self::Gemini25Flash
1077 | Self::Gemini25FlashLite
1078 | Self::Gemini25Pro
1079 | Self::Gemini3FlashPreview
1080 | Self::Gemini3ProPreview
1081 | Self::Gemini31FlashLite
1082 | Self::Gemini31FlashLitePreview
1083 | Self::Gemini31ProPreview
1084 | Self::Gemini31ProPreviewCustomtools
1085 | Self::Gemini35Flash => 1_048_576,
1086 }
1087 }
1088 #[allow(clippy::too_many_lines)]
1089 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
1090 match self {
1091 Self::Gemini20Flash | Self::Gemini20FlashLite => &[],
1092 Self::Gemini3ProPreview => &[ReasoningEffort::Low, ReasoningEffort::High],
1093 Self::Gemini25Flash
1094 | Self::Gemini25FlashLite
1095 | Self::Gemini25Pro
1096 | Self::Gemini31ProPreview
1097 | Self::Gemini31ProPreviewCustomtools
1098 | Self::Gemma426bA4bIt
1099 | Self::Gemma431bIt => {
1100 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
1101 }
1102 Self::Gemini3FlashPreview
1103 | Self::Gemini31FlashLite
1104 | Self::Gemini31FlashLitePreview
1105 | Self::Gemini35Flash => {
1106 &[
1107 ReasoningEffort::Minimal,
1108 ReasoningEffort::Low,
1109 ReasoningEffort::Medium,
1110 ReasoningEffort::High,
1111 ]
1112 }
1113 }
1114 }
1115 pub fn supports_reasoning(self) -> bool {
1116 !self.reasoning_levels().is_empty()
1117 }
1118 #[allow(clippy::too_many_lines)]
1119 pub fn supports_prompt_caching(self) -> bool {
1120 match self {
1121 Self::Gemini20FlashLite | Self::Gemma426bA4bIt | Self::Gemma431bIt => false,
1122 Self::Gemini20Flash
1123 | Self::Gemini25Flash
1124 | Self::Gemini25FlashLite
1125 | Self::Gemini25Pro
1126 | Self::Gemini3FlashPreview
1127 | Self::Gemini3ProPreview
1128 | Self::Gemini31FlashLite
1129 | Self::Gemini31FlashLitePreview
1130 | Self::Gemini31ProPreview
1131 | Self::Gemini31ProPreviewCustomtools
1132 | Self::Gemini35Flash => true,
1133 }
1134 }
1135 #[allow(clippy::too_many_lines)]
1136 pub fn supports_image(self) -> bool {
1137 match self {
1138 Self::Gemini20Flash
1139 | Self::Gemini20FlashLite
1140 | Self::Gemini25Flash
1141 | Self::Gemini25FlashLite
1142 | Self::Gemini25Pro
1143 | Self::Gemini3FlashPreview
1144 | Self::Gemini3ProPreview
1145 | Self::Gemini31FlashLite
1146 | Self::Gemini31FlashLitePreview
1147 | Self::Gemini31ProPreview
1148 | Self::Gemini31ProPreviewCustomtools
1149 | Self::Gemini35Flash
1150 | Self::Gemma426bA4bIt
1151 | Self::Gemma431bIt => true,
1152 }
1153 }
1154 #[allow(clippy::too_many_lines)]
1155 pub fn supports_audio(self) -> bool {
1156 match self {
1157 Self::Gemma426bA4bIt | Self::Gemma431bIt => false,
1158 Self::Gemini20Flash
1159 | Self::Gemini20FlashLite
1160 | Self::Gemini25Flash
1161 | Self::Gemini25FlashLite
1162 | Self::Gemini25Pro
1163 | Self::Gemini3FlashPreview
1164 | Self::Gemini3ProPreview
1165 | Self::Gemini31FlashLite
1166 | Self::Gemini31FlashLitePreview
1167 | Self::Gemini31ProPreview
1168 | Self::Gemini31ProPreviewCustomtools
1169 | Self::Gemini35Flash => true,
1170 }
1171 }
1172 const ALL: &[GeminiModel] = &[
1173 Self::Gemini20Flash,
1174 Self::Gemini20FlashLite,
1175 Self::Gemini25Flash,
1176 Self::Gemini25FlashLite,
1177 Self::Gemini25Pro,
1178 Self::Gemini3FlashPreview,
1179 Self::Gemini3ProPreview,
1180 Self::Gemini31FlashLite,
1181 Self::Gemini31FlashLitePreview,
1182 Self::Gemini31ProPreview,
1183 Self::Gemini31ProPreviewCustomtools,
1184 Self::Gemini35Flash,
1185 Self::Gemma426bA4bIt,
1186 Self::Gemma431bIt,
1187 ];
1188}
1189impl std::str::FromStr for GeminiModel {
1190 type Err = String;
1191 #[allow(clippy::too_many_lines)]
1192 fn from_str(s: &str) -> Result<Self, Self::Err> {
1193 match s {
1194 "gemini-2.0-flash" => Ok(Self::Gemini20Flash),
1195 "gemini-2.0-flash-lite" => Ok(Self::Gemini20FlashLite),
1196 "gemini-2.5-flash" => Ok(Self::Gemini25Flash),
1197 "gemini-2.5-flash-lite" => Ok(Self::Gemini25FlashLite),
1198 "gemini-2.5-pro" => Ok(Self::Gemini25Pro),
1199 "gemini-3-flash-preview" => Ok(Self::Gemini3FlashPreview),
1200 "gemini-3-pro-preview" => Ok(Self::Gemini3ProPreview),
1201 "gemini-3.1-flash-lite" => Ok(Self::Gemini31FlashLite),
1202 "gemini-3.1-flash-lite-preview" => Ok(Self::Gemini31FlashLitePreview),
1203 "gemini-3.1-pro-preview" => Ok(Self::Gemini31ProPreview),
1204 "gemini-3.1-pro-preview-customtools" => {
1205 Ok(Self::Gemini31ProPreviewCustomtools)
1206 }
1207 "gemini-3.5-flash" => Ok(Self::Gemini35Flash),
1208 "gemma-4-26b-a4b-it" => Ok(Self::Gemma426bA4bIt),
1209 "gemma-4-31b-it" => Ok(Self::Gemma431bIt),
1210 _ => Err(format!("Unknown gemini model: '{s}'")),
1211 }
1212 }
1213}
1214impl MoonshotModel {
1215 #[allow(clippy::too_many_lines)]
1216 fn model_id(self) -> &'static str {
1217 match self {
1218 Self::KimiK20711Preview => "kimi-k2-0711-preview",
1219 Self::KimiK20905Preview => "kimi-k2-0905-preview",
1220 Self::KimiK2Thinking => "kimi-k2-thinking",
1221 Self::KimiK2ThinkingTurbo => "kimi-k2-thinking-turbo",
1222 Self::KimiK2TurboPreview => "kimi-k2-turbo-preview",
1223 Self::KimiK25 => "kimi-k2.5",
1224 Self::KimiK26 => "kimi-k2.6",
1225 Self::KimiK27Code => "kimi-k2.7-code",
1226 Self::KimiK27CodeHighspeed => "kimi-k2.7-code-highspeed",
1227 }
1228 }
1229 #[allow(clippy::too_many_lines)]
1230 fn display_name(self) -> &'static str {
1231 match self {
1232 Self::KimiK20711Preview => "Kimi K2 0711",
1233 Self::KimiK20905Preview => "Kimi K2 0905",
1234 Self::KimiK2Thinking => "Kimi K2 Thinking",
1235 Self::KimiK2ThinkingTurbo => "Kimi K2 Thinking Turbo",
1236 Self::KimiK2TurboPreview => "Kimi K2 Turbo",
1237 Self::KimiK25 => "Kimi K2.5",
1238 Self::KimiK26 => "Kimi K2.6",
1239 Self::KimiK27Code => "Kimi K2.7 Code",
1240 Self::KimiK27CodeHighspeed => "Kimi K2.7 Code HighSpeed",
1241 }
1242 }
1243 #[allow(clippy::too_many_lines)]
1244 fn context_window(self) -> u32 {
1245 match self {
1246 Self::KimiK20711Preview => 131_072,
1247 Self::KimiK20905Preview
1248 | Self::KimiK2Thinking
1249 | Self::KimiK2ThinkingTurbo
1250 | Self::KimiK2TurboPreview
1251 | Self::KimiK25
1252 | Self::KimiK26
1253 | Self::KimiK27Code
1254 | Self::KimiK27CodeHighspeed => 262_144,
1255 }
1256 }
1257 #[allow(clippy::too_many_lines)]
1258 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
1259 match self {
1260 Self::KimiK20711Preview
1261 | Self::KimiK20905Preview
1262 | Self::KimiK2TurboPreview => &[],
1263 Self::KimiK2Thinking
1264 | Self::KimiK2ThinkingTurbo
1265 | Self::KimiK25
1266 | Self::KimiK26
1267 | Self::KimiK27Code
1268 | Self::KimiK27CodeHighspeed => {
1269 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
1270 }
1271 }
1272 }
1273 pub fn supports_reasoning(self) -> bool {
1274 !self.reasoning_levels().is_empty()
1275 }
1276 #[allow(clippy::too_many_lines)]
1277 pub fn supports_prompt_caching(self) -> bool {
1278 match self {
1279 Self::KimiK20711Preview
1280 | Self::KimiK20905Preview
1281 | Self::KimiK2Thinking
1282 | Self::KimiK2ThinkingTurbo
1283 | Self::KimiK2TurboPreview
1284 | Self::KimiK25
1285 | Self::KimiK26
1286 | Self::KimiK27Code
1287 | Self::KimiK27CodeHighspeed => true,
1288 }
1289 }
1290 #[allow(clippy::too_many_lines)]
1291 pub fn supports_image(self) -> bool {
1292 match self {
1293 Self::KimiK20711Preview
1294 | Self::KimiK20905Preview
1295 | Self::KimiK2Thinking
1296 | Self::KimiK2ThinkingTurbo
1297 | Self::KimiK2TurboPreview => false,
1298 Self::KimiK25
1299 | Self::KimiK26
1300 | Self::KimiK27Code
1301 | Self::KimiK27CodeHighspeed => true,
1302 }
1303 }
1304 #[allow(clippy::too_many_lines)]
1305 pub fn supports_audio(self) -> bool {
1306 match self {
1307 Self::KimiK20711Preview
1308 | Self::KimiK20905Preview
1309 | Self::KimiK2Thinking
1310 | Self::KimiK2ThinkingTurbo
1311 | Self::KimiK2TurboPreview
1312 | Self::KimiK25
1313 | Self::KimiK26
1314 | Self::KimiK27Code
1315 | Self::KimiK27CodeHighspeed => false,
1316 }
1317 }
1318 const ALL: &[MoonshotModel] = &[
1319 Self::KimiK20711Preview,
1320 Self::KimiK20905Preview,
1321 Self::KimiK2Thinking,
1322 Self::KimiK2ThinkingTurbo,
1323 Self::KimiK2TurboPreview,
1324 Self::KimiK25,
1325 Self::KimiK26,
1326 Self::KimiK27Code,
1327 Self::KimiK27CodeHighspeed,
1328 ];
1329}
1330impl std::str::FromStr for MoonshotModel {
1331 type Err = String;
1332 #[allow(clippy::too_many_lines)]
1333 fn from_str(s: &str) -> Result<Self, Self::Err> {
1334 match s {
1335 "kimi-k2-0711-preview" => Ok(Self::KimiK20711Preview),
1336 "kimi-k2-0905-preview" => Ok(Self::KimiK20905Preview),
1337 "kimi-k2-thinking" => Ok(Self::KimiK2Thinking),
1338 "kimi-k2-thinking-turbo" => Ok(Self::KimiK2ThinkingTurbo),
1339 "kimi-k2-turbo-preview" => Ok(Self::KimiK2TurboPreview),
1340 "kimi-k2.5" => Ok(Self::KimiK25),
1341 "kimi-k2.6" => Ok(Self::KimiK26),
1342 "kimi-k2.7-code" => Ok(Self::KimiK27Code),
1343 "kimi-k2.7-code-highspeed" => Ok(Self::KimiK27CodeHighspeed),
1344 _ => Err(format!("Unknown moonshot model: '{s}'")),
1345 }
1346 }
1347}
1348impl OpenaiModel {
1349 #[allow(clippy::too_many_lines)]
1350 fn model_id(self) -> &'static str {
1351 match self {
1352 Self::Gpt4 => "gpt-4",
1353 Self::Gpt4Turbo => "gpt-4-turbo",
1354 Self::Gpt41 => "gpt-4.1",
1355 Self::Gpt41Mini => "gpt-4.1-mini",
1356 Self::Gpt41Nano => "gpt-4.1-nano",
1357 Self::Gpt4o => "gpt-4o",
1358 Self::Gpt4o20240513 => "gpt-4o-2024-05-13",
1359 Self::Gpt4o20240806 => "gpt-4o-2024-08-06",
1360 Self::Gpt4o20241120 => "gpt-4o-2024-11-20",
1361 Self::Gpt4oMini => "gpt-4o-mini",
1362 Self::Gpt5 => "gpt-5",
1363 Self::Gpt5Codex => "gpt-5-codex",
1364 Self::Gpt5Mini => "gpt-5-mini",
1365 Self::Gpt5Nano => "gpt-5-nano",
1366 Self::Gpt5Pro => "gpt-5-pro",
1367 Self::Gpt51 => "gpt-5.1",
1368 Self::Gpt51Codex => "gpt-5.1-codex",
1369 Self::Gpt51CodexMax => "gpt-5.1-codex-max",
1370 Self::Gpt51CodexMini => "gpt-5.1-codex-mini",
1371 Self::Gpt52 => "gpt-5.2",
1372 Self::Gpt52Codex => "gpt-5.2-codex",
1373 Self::Gpt52Pro => "gpt-5.2-pro",
1374 Self::Gpt53Codex => "gpt-5.3-codex",
1375 Self::Gpt53CodexSpark => "gpt-5.3-codex-spark",
1376 Self::Gpt54 => "gpt-5.4",
1377 Self::Gpt54Mini => "gpt-5.4-mini",
1378 Self::Gpt54Nano => "gpt-5.4-nano",
1379 Self::Gpt54Pro => "gpt-5.4-pro",
1380 Self::Gpt55 => "gpt-5.5",
1381 Self::Gpt55Pro => "gpt-5.5-pro",
1382 Self::Gpt56 => "gpt-5.6",
1383 Self::Gpt56Luna => "gpt-5.6-luna",
1384 Self::Gpt56Sol => "gpt-5.6-sol",
1385 Self::Gpt56Terra => "gpt-5.6-terra",
1386 Self::O1 => "o1",
1387 Self::O1Pro => "o1-pro",
1388 Self::O3 => "o3",
1389 Self::O3DeepResearch => "o3-deep-research",
1390 Self::O3Mini => "o3-mini",
1391 Self::O3Pro => "o3-pro",
1392 Self::O4Mini => "o4-mini",
1393 Self::O4MiniDeepResearch => "o4-mini-deep-research",
1394 }
1395 }
1396 #[allow(clippy::too_many_lines)]
1397 fn display_name(self) -> &'static str {
1398 match self {
1399 Self::Gpt4 => "GPT-4",
1400 Self::Gpt4Turbo => "GPT-4 Turbo",
1401 Self::Gpt41 => "GPT-4.1",
1402 Self::Gpt41Mini => "GPT-4.1 mini",
1403 Self::Gpt41Nano => "GPT-4.1 nano",
1404 Self::Gpt4o => "GPT-4o",
1405 Self::Gpt4o20240513 => "GPT-4o (2024-05-13)",
1406 Self::Gpt4o20240806 => "GPT-4o (2024-08-06)",
1407 Self::Gpt4o20241120 => "GPT-4o (2024-11-20)",
1408 Self::Gpt4oMini => "GPT-4o mini",
1409 Self::Gpt5 => "GPT-5",
1410 Self::Gpt5Mini => "GPT-5 Mini",
1411 Self::Gpt5Nano => "GPT-5 Nano",
1412 Self::Gpt5Pro => "GPT-5 Pro",
1413 Self::Gpt5Codex => "GPT-5-Codex",
1414 Self::Gpt51 => "GPT-5.1",
1415 Self::Gpt51Codex => "GPT-5.1 Codex",
1416 Self::Gpt51CodexMax => "GPT-5.1 Codex Max",
1417 Self::Gpt51CodexMini => "GPT-5.1 Codex mini",
1418 Self::Gpt52 => "GPT-5.2",
1419 Self::Gpt52Codex => "GPT-5.2 Codex",
1420 Self::Gpt52Pro => "GPT-5.2 Pro",
1421 Self::Gpt53Codex => "GPT-5.3 Codex",
1422 Self::Gpt53CodexSpark => "GPT-5.3 Codex Spark",
1423 Self::Gpt54 => "GPT-5.4",
1424 Self::Gpt54Pro => "GPT-5.4 Pro",
1425 Self::Gpt54Mini => "GPT-5.4 mini",
1426 Self::Gpt54Nano => "GPT-5.4 nano",
1427 Self::Gpt55 => "GPT-5.5",
1428 Self::Gpt55Pro => "GPT-5.5 Pro",
1429 Self::Gpt56Luna => "GPT-5.6 Luna",
1430 Self::Gpt56 | Self::Gpt56Sol => "GPT-5.6 Sol",
1431 Self::Gpt56Terra => "GPT-5.6 Terra",
1432 Self::O1 => "o1",
1433 Self::O1Pro => "o1-pro",
1434 Self::O3 => "o3",
1435 Self::O3DeepResearch => "o3-deep-research",
1436 Self::O3Mini => "o3-mini",
1437 Self::O3Pro => "o3-pro",
1438 Self::O4Mini => "o4-mini",
1439 Self::O4MiniDeepResearch => "o4-mini-deep-research",
1440 }
1441 }
1442 #[allow(clippy::too_many_lines)]
1443 fn context_window(self) -> u32 {
1444 match self {
1445 Self::Gpt4 => 8192,
1446 Self::Gpt4Turbo
1447 | Self::Gpt4o
1448 | Self::Gpt4o20240513
1449 | Self::Gpt4o20240806
1450 | Self::Gpt4o20241120
1451 | Self::Gpt4oMini
1452 | Self::Gpt53CodexSpark => 128_000,
1453 Self::O1
1454 | Self::O1Pro
1455 | Self::O3
1456 | Self::O3DeepResearch
1457 | Self::O3Mini
1458 | Self::O3Pro
1459 | Self::O4Mini
1460 | Self::O4MiniDeepResearch => 200_000,
1461 Self::Gpt5
1462 | Self::Gpt5Codex
1463 | Self::Gpt5Mini
1464 | Self::Gpt5Nano
1465 | Self::Gpt5Pro
1466 | Self::Gpt51
1467 | Self::Gpt51Codex
1468 | Self::Gpt51CodexMax
1469 | Self::Gpt51CodexMini
1470 | Self::Gpt52
1471 | Self::Gpt52Codex
1472 | Self::Gpt52Pro
1473 | Self::Gpt53Codex
1474 | Self::Gpt54Mini
1475 | Self::Gpt54Nano => 400_000,
1476 Self::Gpt41 | Self::Gpt41Mini | Self::Gpt41Nano => 1_047_576,
1477 Self::Gpt54
1478 | Self::Gpt54Pro
1479 | Self::Gpt55
1480 | Self::Gpt55Pro
1481 | Self::Gpt56
1482 | Self::Gpt56Luna
1483 | Self::Gpt56Sol
1484 | Self::Gpt56Terra => 1_050_000,
1485 }
1486 }
1487 #[allow(clippy::too_many_lines)]
1488 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
1489 match self {
1490 Self::Gpt4
1491 | Self::Gpt4Turbo
1492 | Self::Gpt41
1493 | Self::Gpt41Mini
1494 | Self::Gpt41Nano
1495 | Self::Gpt4o
1496 | Self::Gpt4o20240513
1497 | Self::Gpt4o20240806
1498 | Self::Gpt4o20241120
1499 | Self::Gpt4oMini => &[],
1500 Self::Gpt5Pro => &[ReasoningEffort::High],
1501 Self::Gpt5Codex
1502 | Self::Gpt51
1503 | Self::Gpt51Codex
1504 | Self::Gpt51CodexMini
1505 | Self::O1
1506 | Self::O1Pro
1507 | Self::O3
1508 | Self::O3Mini
1509 | Self::O3Pro
1510 | Self::O4Mini => {
1511 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
1512 }
1513 Self::Gpt51CodexMax
1514 | Self::Gpt52
1515 | Self::Gpt52Codex
1516 | Self::Gpt53Codex
1517 | Self::Gpt53CodexSpark
1518 | Self::Gpt54
1519 | Self::Gpt54Mini
1520 | Self::Gpt54Nano
1521 | Self::Gpt55 => {
1522 &[
1523 ReasoningEffort::Low,
1524 ReasoningEffort::Medium,
1525 ReasoningEffort::High,
1526 ReasoningEffort::Xhigh,
1527 ]
1528 }
1529 Self::Gpt56 | Self::Gpt56Luna | Self::Gpt56Sol | Self::Gpt56Terra => {
1530 &[
1531 ReasoningEffort::Low,
1532 ReasoningEffort::Medium,
1533 ReasoningEffort::High,
1534 ReasoningEffort::Xhigh,
1535 ReasoningEffort::Max,
1536 ]
1537 }
1538 Self::O3DeepResearch | Self::O4MiniDeepResearch => &[ReasoningEffort::Medium],
1539 Self::Gpt52Pro | Self::Gpt54Pro | Self::Gpt55Pro => {
1540 &[ReasoningEffort::Medium, ReasoningEffort::High, ReasoningEffort::Xhigh]
1541 }
1542 Self::Gpt5 | Self::Gpt5Mini | Self::Gpt5Nano => {
1543 &[
1544 ReasoningEffort::Minimal,
1545 ReasoningEffort::Low,
1546 ReasoningEffort::Medium,
1547 ReasoningEffort::High,
1548 ]
1549 }
1550 }
1551 }
1552 pub fn supports_reasoning(self) -> bool {
1553 !self.reasoning_levels().is_empty()
1554 }
1555 #[allow(clippy::too_many_lines)]
1556 pub fn supports_prompt_caching(self) -> bool {
1557 match self {
1558 Self::Gpt4
1559 | Self::Gpt4Turbo
1560 | Self::Gpt4o20240513
1561 | Self::Gpt5Pro
1562 | Self::Gpt52Pro
1563 | Self::Gpt54Pro
1564 | Self::Gpt55Pro
1565 | Self::O1Pro
1566 | Self::O3Pro => false,
1567 Self::Gpt41
1568 | Self::Gpt41Mini
1569 | Self::Gpt41Nano
1570 | Self::Gpt4o
1571 | Self::Gpt4o20240806
1572 | Self::Gpt4o20241120
1573 | Self::Gpt4oMini
1574 | Self::Gpt5
1575 | Self::Gpt5Codex
1576 | Self::Gpt5Mini
1577 | Self::Gpt5Nano
1578 | Self::Gpt51
1579 | Self::Gpt51Codex
1580 | Self::Gpt51CodexMax
1581 | Self::Gpt51CodexMini
1582 | Self::Gpt52
1583 | Self::Gpt52Codex
1584 | Self::Gpt53Codex
1585 | Self::Gpt53CodexSpark
1586 | Self::Gpt54
1587 | Self::Gpt54Mini
1588 | Self::Gpt54Nano
1589 | Self::Gpt55
1590 | Self::Gpt56
1591 | Self::Gpt56Luna
1592 | Self::Gpt56Sol
1593 | Self::Gpt56Terra
1594 | Self::O1
1595 | Self::O3
1596 | Self::O3DeepResearch
1597 | Self::O3Mini
1598 | Self::O4Mini
1599 | Self::O4MiniDeepResearch => true,
1600 }
1601 }
1602 #[allow(clippy::too_many_lines)]
1603 pub fn supports_image(self) -> bool {
1604 match self {
1605 Self::Gpt4 | Self::O3Mini => false,
1606 Self::Gpt4Turbo
1607 | Self::Gpt41
1608 | Self::Gpt41Mini
1609 | Self::Gpt41Nano
1610 | Self::Gpt4o
1611 | Self::Gpt4o20240513
1612 | Self::Gpt4o20240806
1613 | Self::Gpt4o20241120
1614 | Self::Gpt4oMini
1615 | Self::Gpt5
1616 | Self::Gpt5Codex
1617 | Self::Gpt5Mini
1618 | Self::Gpt5Nano
1619 | Self::Gpt5Pro
1620 | Self::Gpt51
1621 | Self::Gpt51Codex
1622 | Self::Gpt51CodexMax
1623 | Self::Gpt51CodexMini
1624 | Self::Gpt52
1625 | Self::Gpt52Codex
1626 | Self::Gpt52Pro
1627 | Self::Gpt53Codex
1628 | Self::Gpt53CodexSpark
1629 | Self::Gpt54
1630 | Self::Gpt54Mini
1631 | Self::Gpt54Nano
1632 | Self::Gpt54Pro
1633 | Self::Gpt55
1634 | Self::Gpt55Pro
1635 | Self::Gpt56
1636 | Self::Gpt56Luna
1637 | Self::Gpt56Sol
1638 | Self::Gpt56Terra
1639 | Self::O1
1640 | Self::O1Pro
1641 | Self::O3
1642 | Self::O3DeepResearch
1643 | Self::O3Pro
1644 | Self::O4Mini
1645 | Self::O4MiniDeepResearch => true,
1646 }
1647 }
1648 #[allow(clippy::too_many_lines)]
1649 pub fn supports_audio(self) -> bool {
1650 match self {
1651 Self::Gpt4
1652 | Self::Gpt4Turbo
1653 | Self::Gpt41
1654 | Self::Gpt41Mini
1655 | Self::Gpt41Nano
1656 | Self::Gpt4o
1657 | Self::Gpt4o20240513
1658 | Self::Gpt4o20240806
1659 | Self::Gpt4o20241120
1660 | Self::Gpt4oMini
1661 | Self::Gpt5
1662 | Self::Gpt5Codex
1663 | Self::Gpt5Mini
1664 | Self::Gpt5Nano
1665 | Self::Gpt5Pro
1666 | Self::Gpt51
1667 | Self::Gpt51Codex
1668 | Self::Gpt51CodexMax
1669 | Self::Gpt51CodexMini
1670 | Self::Gpt52
1671 | Self::Gpt52Codex
1672 | Self::Gpt52Pro
1673 | Self::Gpt53Codex
1674 | Self::Gpt53CodexSpark
1675 | Self::Gpt54
1676 | Self::Gpt54Mini
1677 | Self::Gpt54Nano
1678 | Self::Gpt54Pro
1679 | Self::Gpt55
1680 | Self::Gpt55Pro
1681 | Self::Gpt56
1682 | Self::Gpt56Luna
1683 | Self::Gpt56Sol
1684 | Self::Gpt56Terra
1685 | Self::O1
1686 | Self::O1Pro
1687 | Self::O3
1688 | Self::O3DeepResearch
1689 | Self::O3Mini
1690 | Self::O3Pro
1691 | Self::O4Mini
1692 | Self::O4MiniDeepResearch => false,
1693 }
1694 }
1695 const ALL: &[OpenaiModel] = &[
1696 Self::Gpt4,
1697 Self::Gpt4Turbo,
1698 Self::Gpt41,
1699 Self::Gpt41Mini,
1700 Self::Gpt41Nano,
1701 Self::Gpt4o,
1702 Self::Gpt4o20240513,
1703 Self::Gpt4o20240806,
1704 Self::Gpt4o20241120,
1705 Self::Gpt4oMini,
1706 Self::Gpt5,
1707 Self::Gpt5Codex,
1708 Self::Gpt5Mini,
1709 Self::Gpt5Nano,
1710 Self::Gpt5Pro,
1711 Self::Gpt51,
1712 Self::Gpt51Codex,
1713 Self::Gpt51CodexMax,
1714 Self::Gpt51CodexMini,
1715 Self::Gpt52,
1716 Self::Gpt52Codex,
1717 Self::Gpt52Pro,
1718 Self::Gpt53Codex,
1719 Self::Gpt53CodexSpark,
1720 Self::Gpt54,
1721 Self::Gpt54Mini,
1722 Self::Gpt54Nano,
1723 Self::Gpt54Pro,
1724 Self::Gpt55,
1725 Self::Gpt55Pro,
1726 Self::Gpt56,
1727 Self::Gpt56Luna,
1728 Self::Gpt56Sol,
1729 Self::Gpt56Terra,
1730 Self::O1,
1731 Self::O1Pro,
1732 Self::O3,
1733 Self::O3DeepResearch,
1734 Self::O3Mini,
1735 Self::O3Pro,
1736 Self::O4Mini,
1737 Self::O4MiniDeepResearch,
1738 ];
1739}
1740impl std::str::FromStr for OpenaiModel {
1741 type Err = String;
1742 #[allow(clippy::too_many_lines)]
1743 fn from_str(s: &str) -> Result<Self, Self::Err> {
1744 match s {
1745 "gpt-4" => Ok(Self::Gpt4),
1746 "gpt-4-turbo" => Ok(Self::Gpt4Turbo),
1747 "gpt-4.1" => Ok(Self::Gpt41),
1748 "gpt-4.1-mini" => Ok(Self::Gpt41Mini),
1749 "gpt-4.1-nano" => Ok(Self::Gpt41Nano),
1750 "gpt-4o" => Ok(Self::Gpt4o),
1751 "gpt-4o-2024-05-13" => Ok(Self::Gpt4o20240513),
1752 "gpt-4o-2024-08-06" => Ok(Self::Gpt4o20240806),
1753 "gpt-4o-2024-11-20" => Ok(Self::Gpt4o20241120),
1754 "gpt-4o-mini" => Ok(Self::Gpt4oMini),
1755 "gpt-5" => Ok(Self::Gpt5),
1756 "gpt-5-codex" => Ok(Self::Gpt5Codex),
1757 "gpt-5-mini" => Ok(Self::Gpt5Mini),
1758 "gpt-5-nano" => Ok(Self::Gpt5Nano),
1759 "gpt-5-pro" => Ok(Self::Gpt5Pro),
1760 "gpt-5.1" => Ok(Self::Gpt51),
1761 "gpt-5.1-codex" => Ok(Self::Gpt51Codex),
1762 "gpt-5.1-codex-max" => Ok(Self::Gpt51CodexMax),
1763 "gpt-5.1-codex-mini" => Ok(Self::Gpt51CodexMini),
1764 "gpt-5.2" => Ok(Self::Gpt52),
1765 "gpt-5.2-codex" => Ok(Self::Gpt52Codex),
1766 "gpt-5.2-pro" => Ok(Self::Gpt52Pro),
1767 "gpt-5.3-codex" => Ok(Self::Gpt53Codex),
1768 "gpt-5.3-codex-spark" => Ok(Self::Gpt53CodexSpark),
1769 "gpt-5.4" => Ok(Self::Gpt54),
1770 "gpt-5.4-mini" => Ok(Self::Gpt54Mini),
1771 "gpt-5.4-nano" => Ok(Self::Gpt54Nano),
1772 "gpt-5.4-pro" => Ok(Self::Gpt54Pro),
1773 "gpt-5.5" => Ok(Self::Gpt55),
1774 "gpt-5.5-pro" => Ok(Self::Gpt55Pro),
1775 "gpt-5.6" => Ok(Self::Gpt56),
1776 "gpt-5.6-luna" => Ok(Self::Gpt56Luna),
1777 "gpt-5.6-sol" => Ok(Self::Gpt56Sol),
1778 "gpt-5.6-terra" => Ok(Self::Gpt56Terra),
1779 "o1" => Ok(Self::O1),
1780 "o1-pro" => Ok(Self::O1Pro),
1781 "o3" => Ok(Self::O3),
1782 "o3-deep-research" => Ok(Self::O3DeepResearch),
1783 "o3-mini" => Ok(Self::O3Mini),
1784 "o3-pro" => Ok(Self::O3Pro),
1785 "o4-mini" => Ok(Self::O4Mini),
1786 "o4-mini-deep-research" => Ok(Self::O4MiniDeepResearch),
1787 _ => Err(format!("Unknown openai model: '{s}'")),
1788 }
1789 }
1790}
1791impl OpenRouterModel {
1792 #[allow(clippy::too_many_lines)]
1793 fn model_id(self) -> &'static str {
1794 match self {
1795 Self::Ai21JambaLarge17 => "ai21/jamba-large-1.7",
1796 Self::AionLabsAion20 => "aion-labs/aion-2.0",
1797 Self::AionLabsAion30 => "aion-labs/aion-3.0",
1798 Self::AionLabsAion30Mini => "aion-labs/aion-3.0-mini",
1799 Self::AmazonNova2LiteV1 => "amazon/nova-2-lite-v1",
1800 Self::AmazonNovaLiteV1 => "amazon/nova-lite-v1",
1801 Self::AmazonNovaMicroV1 => "amazon/nova-micro-v1",
1802 Self::AmazonNovaPremierV1 => "amazon/nova-premier-v1",
1803 Self::AmazonNovaProV1 => "amazon/nova-pro-v1",
1804 Self::AnthropicClaude3Haiku => "anthropic/claude-3-haiku",
1805 Self::AnthropicClaudeFable5 => "anthropic/claude-fable-5",
1806 Self::AnthropicClaudeHaiku45 => "anthropic/claude-haiku-4.5",
1807 Self::AnthropicClaudeOpus4 => "anthropic/claude-opus-4",
1808 Self::AnthropicClaudeOpus41 => "anthropic/claude-opus-4.1",
1809 Self::AnthropicClaudeOpus45 => "anthropic/claude-opus-4.5",
1810 Self::AnthropicClaudeOpus46 => "anthropic/claude-opus-4.6",
1811 Self::AnthropicClaudeOpus47 => "anthropic/claude-opus-4.7",
1812 Self::AnthropicClaudeOpus47Fast => "anthropic/claude-opus-4.7-fast",
1813 Self::AnthropicClaudeOpus48 => "anthropic/claude-opus-4.8",
1814 Self::AnthropicClaudeOpus48Fast => "anthropic/claude-opus-4.8-fast",
1815 Self::AnthropicClaudeSonnet4 => "anthropic/claude-sonnet-4",
1816 Self::AnthropicClaudeSonnet45 => "anthropic/claude-sonnet-4.5",
1817 Self::AnthropicClaudeSonnet46 => "anthropic/claude-sonnet-4.6",
1818 Self::AnthropicClaudeSonnet5 => "anthropic/claude-sonnet-5",
1819 Self::ArceeAiTrinityLargeThinking => "arcee-ai/trinity-large-thinking",
1820 Self::ArceeAiTrinityMini => "arcee-ai/trinity-mini",
1821 Self::ArceeAiVirtuosoLarge => "arcee-ai/virtuoso-large",
1822 Self::BytedanceSeedSeed16 => "bytedance-seed/seed-1.6",
1823 Self::BytedanceSeedSeed16Flash => "bytedance-seed/seed-1.6-flash",
1824 Self::BytedanceSeedSeed20Lite => "bytedance-seed/seed-2.0-lite",
1825 Self::BytedanceSeedSeed20Mini => "bytedance-seed/seed-2.0-mini",
1826 Self::CohereCommandR082024 => "cohere/command-r-08-2024",
1827 Self::CohereCommandRPlus082024 => "cohere/command-r-plus-08-2024",
1828 Self::CohereNorthMiniCodeFree => "cohere/north-mini-code:free",
1829 Self::DeepseekDeepseekChat => "deepseek/deepseek-chat",
1830 Self::DeepseekDeepseekChatV30324 => "deepseek/deepseek-chat-v3-0324",
1831 Self::DeepseekDeepseekChatV31 => "deepseek/deepseek-chat-v3.1",
1832 Self::DeepseekDeepseekR1 => "deepseek/deepseek-r1",
1833 Self::DeepseekDeepseekR10528 => "deepseek/deepseek-r1-0528",
1834 Self::DeepseekDeepseekV31Terminus => "deepseek/deepseek-v3.1-terminus",
1835 Self::DeepseekDeepseekV32 => "deepseek/deepseek-v3.2",
1836 Self::DeepseekDeepseekV32Exp => "deepseek/deepseek-v3.2-exp",
1837 Self::DeepseekDeepseekV4Flash => "deepseek/deepseek-v4-flash",
1838 Self::DeepseekDeepseekV4Pro => "deepseek/deepseek-v4-pro",
1839 Self::GoogleGemini25Flash => "google/gemini-2.5-flash",
1840 Self::GoogleGemini25FlashLite => "google/gemini-2.5-flash-lite",
1841 Self::GoogleGemini25Pro => "google/gemini-2.5-pro",
1842 Self::GoogleGemini25ProPreview => "google/gemini-2.5-pro-preview",
1843 Self::GoogleGemini25ProPreview0506 => "google/gemini-2.5-pro-preview-05-06",
1844 Self::GoogleGemini3FlashPreview => "google/gemini-3-flash-preview",
1845 Self::GoogleGemini3ProImage => "google/gemini-3-pro-image",
1846 Self::GoogleGemini31FlashLite => "google/gemini-3.1-flash-lite",
1847 Self::GoogleGemini31FlashLitePreview => {
1848 "google/gemini-3.1-flash-lite-preview"
1849 }
1850 Self::GoogleGemini31ProPreview => "google/gemini-3.1-pro-preview",
1851 Self::GoogleGemini31ProPreviewCustomtools => {
1852 "google/gemini-3.1-pro-preview-customtools"
1853 }
1854 Self::GoogleGemini35Flash => "google/gemini-3.5-flash",
1855 Self::GoogleGemma312bIt => "google/gemma-3-12b-it",
1856 Self::GoogleGemma327bIt => "google/gemma-3-27b-it",
1857 Self::GoogleGemma426bA4bIt => "google/gemma-4-26b-a4b-it",
1858 Self::GoogleGemma426bA4bItFree => "google/gemma-4-26b-a4b-it:free",
1859 Self::GoogleGemma431bIt => "google/gemma-4-31b-it",
1860 Self::GoogleGemma431bItFree => "google/gemma-4-31b-it:free",
1861 Self::IbmGraniteGranite418b => "ibm-granite/granite-4.1-8b",
1862 Self::InceptionMercury2 => "inception/mercury-2",
1863 Self::InclusionaiLing261t => "inclusionai/ling-2.6-1t",
1864 Self::InclusionaiLing26Flash => "inclusionai/ling-2.6-flash",
1865 Self::InclusionaiRing261t => "inclusionai/ring-2.6-1t",
1866 Self::KwaipilotKatCoderProV2 => "kwaipilot/kat-coder-pro-v2",
1867 Self::LiquidLfm2512bThinkingFree => "liquid/lfm-2.5-1.2b-thinking:free",
1868 Self::MetaLlamaLlama3170bInstruct => "meta-llama/llama-3.1-70b-instruct",
1869 Self::MetaLlamaLlama318bInstruct => "meta-llama/llama-3.1-8b-instruct",
1870 Self::MetaLlamaLlama3370bInstruct => "meta-llama/llama-3.3-70b-instruct",
1871 Self::MetaLlamaLlama3370bInstructFree => {
1872 "meta-llama/llama-3.3-70b-instruct:free"
1873 }
1874 Self::MetaLlamaLlama4Maverick => "meta-llama/llama-4-maverick",
1875 Self::MetaLlamaLlama4Scout => "meta-llama/llama-4-scout",
1876 Self::MinimaxMinimaxM1 => "minimax/minimax-m1",
1877 Self::MinimaxMinimaxM2 => "minimax/minimax-m2",
1878 Self::MinimaxMinimaxM21 => "minimax/minimax-m2.1",
1879 Self::MinimaxMinimaxM25 => "minimax/minimax-m2.5",
1880 Self::MinimaxMinimaxM27 => "minimax/minimax-m2.7",
1881 Self::MinimaxMinimaxM3 => "minimax/minimax-m3",
1882 Self::MistralaiCodestral2508 => "mistralai/codestral-2508",
1883 Self::MistralaiDevstral2512 => "mistralai/devstral-2512",
1884 Self::MistralaiMinistral14b2512 => "mistralai/ministral-14b-2512",
1885 Self::MistralaiMinistral3b2512 => "mistralai/ministral-3b-2512",
1886 Self::MistralaiMinistral8b2512 => "mistralai/ministral-8b-2512",
1887 Self::MistralaiMistralLarge => "mistralai/mistral-large",
1888 Self::MistralaiMistralLarge2407 => "mistralai/mistral-large-2407",
1889 Self::MistralaiMistralLarge2512 => "mistralai/mistral-large-2512",
1890 Self::MistralaiMistralMedium3 => "mistralai/mistral-medium-3",
1891 Self::MistralaiMistralMedium35 => "mistralai/mistral-medium-3-5",
1892 Self::MistralaiMistralMedium31 => "mistralai/mistral-medium-3.1",
1893 Self::MistralaiMistralNemo => "mistralai/mistral-nemo",
1894 Self::MistralaiMistralSaba => "mistralai/mistral-saba",
1895 Self::MistralaiMistralSmall2603 => "mistralai/mistral-small-2603",
1896 Self::MistralaiMistralSmall3224bInstruct => {
1897 "mistralai/mistral-small-3.2-24b-instruct"
1898 }
1899 Self::MistralaiMixtral8x22bInstruct => "mistralai/mixtral-8x22b-instruct",
1900 Self::MistralaiVoxtralSmall24b2507 => "mistralai/voxtral-small-24b-2507",
1901 Self::MoonshotaiKimiK2 => "moonshotai/kimi-k2",
1902 Self::MoonshotaiKimiK20905 => "moonshotai/kimi-k2-0905",
1903 Self::MoonshotaiKimiK2Thinking => "moonshotai/kimi-k2-thinking",
1904 Self::MoonshotaiKimiK25 => "moonshotai/kimi-k2.5",
1905 Self::MoonshotaiKimiK26 => "moonshotai/kimi-k2.6",
1906 Self::MoonshotaiKimiK27Code => "moonshotai/kimi-k2.7-code",
1907 Self::NexAgiNexN2Mini => "nex-agi/nex-n2-mini",
1908 Self::NexAgiNexN2Pro => "nex-agi/nex-n2-pro",
1909 Self::NvidiaLlama33NemotronSuper49bV15 => {
1910 "nvidia/llama-3.3-nemotron-super-49b-v1.5"
1911 }
1912 Self::NvidiaNemotron3Nano30bA3b => "nvidia/nemotron-3-nano-30b-a3b",
1913 Self::NvidiaNemotron3Nano30bA3bFree => "nvidia/nemotron-3-nano-30b-a3b:free",
1914 Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree => {
1915 "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free"
1916 }
1917 Self::NvidiaNemotron3Super120bA12b => "nvidia/nemotron-3-super-120b-a12b",
1918 Self::NvidiaNemotron3Super120bA12bFree => {
1919 "nvidia/nemotron-3-super-120b-a12b:free"
1920 }
1921 Self::NvidiaNemotron3Ultra550bA55b => "nvidia/nemotron-3-ultra-550b-a55b",
1922 Self::NvidiaNemotron3Ultra550bA55bFree => {
1923 "nvidia/nemotron-3-ultra-550b-a55b:free"
1924 }
1925 Self::NvidiaNemotronNano12bV2VlFree => "nvidia/nemotron-nano-12b-v2-vl:free",
1926 Self::NvidiaNemotronNano9bV2Free => "nvidia/nemotron-nano-9b-v2:free",
1927 Self::OpenaiGpt35Turbo => "openai/gpt-3.5-turbo",
1928 Self::OpenaiGpt35Turbo0613 => "openai/gpt-3.5-turbo-0613",
1929 Self::OpenaiGpt35Turbo16k => "openai/gpt-3.5-turbo-16k",
1930 Self::OpenaiGpt4 => "openai/gpt-4",
1931 Self::OpenaiGpt4Turbo => "openai/gpt-4-turbo",
1932 Self::OpenaiGpt4TurboPreview => "openai/gpt-4-turbo-preview",
1933 Self::OpenaiGpt41 => "openai/gpt-4.1",
1934 Self::OpenaiGpt41Mini => "openai/gpt-4.1-mini",
1935 Self::OpenaiGpt41Nano => "openai/gpt-4.1-nano",
1936 Self::OpenaiGpt4o => "openai/gpt-4o",
1937 Self::OpenaiGpt4o20240513 => "openai/gpt-4o-2024-05-13",
1938 Self::OpenaiGpt4o20240806 => "openai/gpt-4o-2024-08-06",
1939 Self::OpenaiGpt4o20241120 => "openai/gpt-4o-2024-11-20",
1940 Self::OpenaiGpt4oMini => "openai/gpt-4o-mini",
1941 Self::OpenaiGpt4oMini20240718 => "openai/gpt-4o-mini-2024-07-18",
1942 Self::OpenaiGpt5 => "openai/gpt-5",
1943 Self::OpenaiGpt5Codex => "openai/gpt-5-codex",
1944 Self::OpenaiGpt5Mini => "openai/gpt-5-mini",
1945 Self::OpenaiGpt5Nano => "openai/gpt-5-nano",
1946 Self::OpenaiGpt5Pro => "openai/gpt-5-pro",
1947 Self::OpenaiGpt51 => "openai/gpt-5.1",
1948 Self::OpenaiGpt51Chat => "openai/gpt-5.1-chat",
1949 Self::OpenaiGpt51Codex => "openai/gpt-5.1-codex",
1950 Self::OpenaiGpt51CodexMax => "openai/gpt-5.1-codex-max",
1951 Self::OpenaiGpt51CodexMini => "openai/gpt-5.1-codex-mini",
1952 Self::OpenaiGpt52 => "openai/gpt-5.2",
1953 Self::OpenaiGpt52Chat => "openai/gpt-5.2-chat",
1954 Self::OpenaiGpt52Codex => "openai/gpt-5.2-codex",
1955 Self::OpenaiGpt52Pro => "openai/gpt-5.2-pro",
1956 Self::OpenaiGpt53Chat => "openai/gpt-5.3-chat",
1957 Self::OpenaiGpt53Codex => "openai/gpt-5.3-codex",
1958 Self::OpenaiGpt54 => "openai/gpt-5.4",
1959 Self::OpenaiGpt54Mini => "openai/gpt-5.4-mini",
1960 Self::OpenaiGpt54Nano => "openai/gpt-5.4-nano",
1961 Self::OpenaiGpt54Pro => "openai/gpt-5.4-pro",
1962 Self::OpenaiGpt55 => "openai/gpt-5.5",
1963 Self::OpenaiGpt55Pro => "openai/gpt-5.5-pro",
1964 Self::OpenaiGptAudio => "openai/gpt-audio",
1965 Self::OpenaiGptAudioMini => "openai/gpt-audio-mini",
1966 Self::OpenaiGptOss120b => "openai/gpt-oss-120b",
1967 Self::OpenaiGptOss120bFree => "openai/gpt-oss-120b:free",
1968 Self::OpenaiGptOss20b => "openai/gpt-oss-20b",
1969 Self::OpenaiGptOss20bFree => "openai/gpt-oss-20b:free",
1970 Self::OpenaiGptOssSafeguard20b => "openai/gpt-oss-safeguard-20b",
1971 Self::OpenaiO1 => "openai/o1",
1972 Self::OpenaiO3 => "openai/o3",
1973 Self::OpenaiO3DeepResearch => "openai/o3-deep-research",
1974 Self::OpenaiO3Mini => "openai/o3-mini",
1975 Self::OpenaiO3MiniHigh => "openai/o3-mini-high",
1976 Self::OpenaiO3Pro => "openai/o3-pro",
1977 Self::OpenaiO4Mini => "openai/o4-mini",
1978 Self::OpenaiO4MiniDeepResearch => "openai/o4-mini-deep-research",
1979 Self::OpenaiO4MiniHigh => "openai/o4-mini-high",
1980 Self::OpenrouterAuto => "openrouter/auto",
1981 Self::OpenrouterFree => "openrouter/free",
1982 Self::PoolsideLagunaM1 => "poolside/laguna-m.1",
1983 Self::PoolsideLagunaM1Free => "poolside/laguna-m.1:free",
1984 Self::PoolsideLagunaXs21 => "poolside/laguna-xs-2.1",
1985 Self::PoolsideLagunaXs21Free => "poolside/laguna-xs-2.1:free",
1986 Self::QwenQwen2572bInstruct => "qwen/qwen-2.5-72b-instruct",
1987 Self::QwenQwen257bInstruct => "qwen/qwen-2.5-7b-instruct",
1988 Self::QwenQwenPlus => "qwen/qwen-plus",
1989 Self::QwenQwenPlus20250728 => "qwen/qwen-plus-2025-07-28",
1990 Self::QwenQwenPlus20250728Thinking => "qwen/qwen-plus-2025-07-28:thinking",
1991 Self::QwenQwen314b => "qwen/qwen3-14b",
1992 Self::QwenQwen3235bA22b => "qwen/qwen3-235b-a22b",
1993 Self::QwenQwen3235bA22b2507 => "qwen/qwen3-235b-a22b-2507",
1994 Self::QwenQwen3235bA22bThinking2507 => "qwen/qwen3-235b-a22b-thinking-2507",
1995 Self::QwenQwen330bA3b => "qwen/qwen3-30b-a3b",
1996 Self::QwenQwen330bA3bInstruct2507 => "qwen/qwen3-30b-a3b-instruct-2507",
1997 Self::QwenQwen330bA3bThinking2507 => "qwen/qwen3-30b-a3b-thinking-2507",
1998 Self::QwenQwen332b => "qwen/qwen3-32b",
1999 Self::QwenQwen38b => "qwen/qwen3-8b",
2000 Self::QwenQwen3Coder => "qwen/qwen3-coder",
2001 Self::QwenQwen3Coder30bA3bInstruct => "qwen/qwen3-coder-30b-a3b-instruct",
2002 Self::QwenQwen3CoderFlash => "qwen/qwen3-coder-flash",
2003 Self::QwenQwen3CoderNext => "qwen/qwen3-coder-next",
2004 Self::QwenQwen3CoderPlus => "qwen/qwen3-coder-plus",
2005 Self::QwenQwen3CoderFree => "qwen/qwen3-coder:free",
2006 Self::QwenQwen3Max => "qwen/qwen3-max",
2007 Self::QwenQwen3MaxThinking => "qwen/qwen3-max-thinking",
2008 Self::QwenQwen3Next80bA3bInstruct => "qwen/qwen3-next-80b-a3b-instruct",
2009 Self::QwenQwen3Next80bA3bInstructFree => {
2010 "qwen/qwen3-next-80b-a3b-instruct:free"
2011 }
2012 Self::QwenQwen3Next80bA3bThinking => "qwen/qwen3-next-80b-a3b-thinking",
2013 Self::QwenQwen3Vl235bA22bInstruct => "qwen/qwen3-vl-235b-a22b-instruct",
2014 Self::QwenQwen3Vl235bA22bThinking => "qwen/qwen3-vl-235b-a22b-thinking",
2015 Self::QwenQwen3Vl30bA3bInstruct => "qwen/qwen3-vl-30b-a3b-instruct",
2016 Self::QwenQwen3Vl30bA3bThinking => "qwen/qwen3-vl-30b-a3b-thinking",
2017 Self::QwenQwen3Vl32bInstruct => "qwen/qwen3-vl-32b-instruct",
2018 Self::QwenQwen3Vl8bInstruct => "qwen/qwen3-vl-8b-instruct",
2019 Self::QwenQwen3Vl8bThinking => "qwen/qwen3-vl-8b-thinking",
2020 Self::QwenQwen35122bA10b => "qwen/qwen3.5-122b-a10b",
2021 Self::QwenQwen3527b => "qwen/qwen3.5-27b",
2022 Self::QwenQwen3535bA3b => "qwen/qwen3.5-35b-a3b",
2023 Self::QwenQwen35397bA17b => "qwen/qwen3.5-397b-a17b",
2024 Self::QwenQwen359b => "qwen/qwen3.5-9b",
2025 Self::QwenQwen35Flash0223 => "qwen/qwen3.5-flash-02-23",
2026 Self::QwenQwen35Plus0215 => "qwen/qwen3.5-plus-02-15",
2027 Self::QwenQwen35Plus20260420 => "qwen/qwen3.5-plus-20260420",
2028 Self::QwenQwen3627b => "qwen/qwen3.6-27b",
2029 Self::QwenQwen3635bA3b => "qwen/qwen3.6-35b-a3b",
2030 Self::QwenQwen36Flash => "qwen/qwen3.6-flash",
2031 Self::QwenQwen36MaxPreview => "qwen/qwen3.6-max-preview",
2032 Self::QwenQwen36Plus => "qwen/qwen3.6-plus",
2033 Self::QwenQwen37Max => "qwen/qwen3.7-max",
2034 Self::QwenQwen37Plus => "qwen/qwen3.7-plus",
2035 Self::RekaaiRekaEdge => "rekaai/reka-edge",
2036 Self::RelaceRelaceSearch => "relace/relace-search",
2037 Self::SakanaFuguUltra => "sakana/fugu-ultra",
2038 Self::Sao10kL31Euryale70b => "sao10k/l3.1-euryale-70b",
2039 Self::StepfunStep35Flash => "stepfun/step-3.5-flash",
2040 Self::StepfunStep37Flash => "stepfun/step-3.7-flash",
2041 Self::TencentHy3 => "tencent/hy3",
2042 Self::TencentHy3Preview => "tencent/hy3-preview",
2043 Self::TencentHy3Free => "tencent/hy3:free",
2044 Self::ThedrummerUnslopnemo12b => "thedrummer/unslopnemo-12b",
2045 Self::UpstageSolarPro3 => "upstage/solar-pro-3",
2046 Self::XAiGrok420 => "x-ai/grok-4.20",
2047 Self::XAiGrok43 => "x-ai/grok-4.3",
2048 Self::XAiGrok45 => "x-ai/grok-4.5",
2049 Self::XAiGrokBuild01 => "x-ai/grok-build-0.1",
2050 Self::XiaomiMimoV25 => "xiaomi/mimo-v2.5",
2051 Self::XiaomiMimoV25Pro => "xiaomi/mimo-v2.5-pro",
2052 Self::ZAiGlm45 => "z-ai/glm-4.5",
2053 Self::ZAiGlm45Air => "z-ai/glm-4.5-air",
2054 Self::ZAiGlm45v => "z-ai/glm-4.5v",
2055 Self::ZAiGlm46 => "z-ai/glm-4.6",
2056 Self::ZAiGlm46v => "z-ai/glm-4.6v",
2057 Self::ZAiGlm47 => "z-ai/glm-4.7",
2058 Self::ZAiGlm47Flash => "z-ai/glm-4.7-flash",
2059 Self::ZAiGlm5 => "z-ai/glm-5",
2060 Self::ZAiGlm5Turbo => "z-ai/glm-5-turbo",
2061 Self::ZAiGlm51 => "z-ai/glm-5.1",
2062 Self::ZAiGlm52 => "z-ai/glm-5.2",
2063 Self::ZAiGlm5vTurbo => "z-ai/glm-5v-turbo",
2064 }
2065 }
2066 #[allow(clippy::too_many_lines)]
2067 fn display_name(self) -> &'static str {
2068 match self {
2069 Self::AionLabsAion20 => "Aion-2.0",
2070 Self::AionLabsAion30 => "Aion-3.0",
2071 Self::AionLabsAion30Mini => "Aion-3.0-Mini",
2072 Self::OpenrouterAuto => "Auto Router",
2073 Self::AnthropicClaude3Haiku => "Claude 3 Haiku",
2074 Self::AnthropicClaudeFable5 => "Claude Fable 5",
2075 Self::AnthropicClaudeHaiku45 => "Claude Haiku 4.5 (latest)",
2076 Self::AnthropicClaudeOpus4 => "Claude Opus 4",
2077 Self::AnthropicClaudeOpus41 => "Claude Opus 4.1 (latest)",
2078 Self::AnthropicClaudeOpus45 => "Claude Opus 4.5 (latest)",
2079 Self::AnthropicClaudeOpus46 => "Claude Opus 4.6",
2080 Self::AnthropicClaudeOpus47 => "Claude Opus 4.7",
2081 Self::AnthropicClaudeOpus47Fast => "Claude Opus 4.7 (Fast)",
2082 Self::AnthropicClaudeOpus48 => "Claude Opus 4.8",
2083 Self::AnthropicClaudeOpus48Fast => "Claude Opus 4.8 (Fast)",
2084 Self::AnthropicClaudeSonnet4 => "Claude Sonnet 4",
2085 Self::AnthropicClaudeSonnet45 => "Claude Sonnet 4.5 (latest)",
2086 Self::AnthropicClaudeSonnet46 => "Claude Sonnet 4.6",
2087 Self::AnthropicClaudeSonnet5 => "Claude Sonnet 5",
2088 Self::MistralaiCodestral2508 => "Codestral 2508",
2089 Self::CohereCommandR082024 => "Command R",
2090 Self::CohereCommandRPlus082024 => "Command R+",
2091 Self::DeepseekDeepseekChat => "DeepSeek Chat",
2092 Self::DeepseekDeepseekChatV30324 => "DeepSeek V3 0324",
2093 Self::DeepseekDeepseekChatV31 => "DeepSeek V3.1",
2094 Self::DeepseekDeepseekV31Terminus => "DeepSeek V3.1 Terminus",
2095 Self::DeepseekDeepseekV32 => "DeepSeek V3.2",
2096 Self::DeepseekDeepseekV32Exp => "DeepSeek V3.2 Exp",
2097 Self::DeepseekDeepseekV4Flash => "DeepSeek V4 Flash",
2098 Self::DeepseekDeepseekV4Pro => "DeepSeek V4 Pro",
2099 Self::DeepseekDeepseekR1 => "DeepSeek-R1",
2100 Self::MistralaiDevstral2512 => "Devstral 2",
2101 Self::OpenrouterFree => "Free Models Router",
2102 Self::SakanaFuguUltra => "Fugu Ultra",
2103 Self::ZAiGlm45 => "GLM-4.5",
2104 Self::ZAiGlm45Air => "GLM-4.5-Air",
2105 Self::ZAiGlm45v => "GLM-4.5V",
2106 Self::ZAiGlm46 => "GLM-4.6",
2107 Self::ZAiGlm46v => "GLM-4.6V",
2108 Self::ZAiGlm47 => "GLM-4.7",
2109 Self::ZAiGlm47Flash => "GLM-4.7-Flash",
2110 Self::ZAiGlm5 => "GLM-5",
2111 Self::ZAiGlm5Turbo => "GLM-5-Turbo",
2112 Self::ZAiGlm51 => "GLM-5.1",
2113 Self::ZAiGlm52 => "GLM-5.2",
2114 Self::ZAiGlm5vTurbo => "GLM-5V-Turbo",
2115 Self::OpenaiGptAudio => "GPT Audio",
2116 Self::OpenaiGptAudioMini => "GPT Audio Mini",
2117 Self::OpenaiGptOss120b => "GPT OSS 120B",
2118 Self::OpenaiGptOss20b => "GPT OSS 20B",
2119 Self::OpenaiGpt35Turbo0613 => "GPT-3.5 Turbo (older v0613)",
2120 Self::OpenaiGpt35Turbo16k => "GPT-3.5 Turbo 16k",
2121 Self::OpenaiGpt35Turbo => "GPT-3.5-turbo",
2122 Self::OpenaiGpt4 => "GPT-4",
2123 Self::OpenaiGpt4Turbo => "GPT-4 Turbo",
2124 Self::OpenaiGpt4TurboPreview => "GPT-4 Turbo Preview",
2125 Self::OpenaiGpt41 => "GPT-4.1",
2126 Self::OpenaiGpt41Mini => "GPT-4.1 mini",
2127 Self::OpenaiGpt41Nano => "GPT-4.1 nano",
2128 Self::OpenaiGpt4o => "GPT-4o",
2129 Self::OpenaiGpt4o20240513 => "GPT-4o (2024-05-13)",
2130 Self::OpenaiGpt4o20240806 => "GPT-4o (2024-08-06)",
2131 Self::OpenaiGpt4o20241120 => "GPT-4o (2024-11-20)",
2132 Self::OpenaiGpt4oMini => "GPT-4o mini",
2133 Self::OpenaiGpt4oMini20240718 => "GPT-4o-mini (2024-07-18)",
2134 Self::OpenaiGpt5 => "GPT-5",
2135 Self::OpenaiGpt5Mini => "GPT-5 Mini",
2136 Self::OpenaiGpt5Nano => "GPT-5 Nano",
2137 Self::OpenaiGpt5Pro => "GPT-5 Pro",
2138 Self::OpenaiGpt5Codex => "GPT-5-Codex",
2139 Self::OpenaiGpt51 => "GPT-5.1",
2140 Self::OpenaiGpt51Chat => "GPT-5.1 Chat",
2141 Self::OpenaiGpt51Codex => "GPT-5.1 Codex",
2142 Self::OpenaiGpt51CodexMax => "GPT-5.1 Codex Max",
2143 Self::OpenaiGpt51CodexMini => "GPT-5.1 Codex mini",
2144 Self::OpenaiGpt52 => "GPT-5.2",
2145 Self::OpenaiGpt52Chat => "GPT-5.2 Chat",
2146 Self::OpenaiGpt52Codex => "GPT-5.2 Codex",
2147 Self::OpenaiGpt52Pro => "GPT-5.2 Pro",
2148 Self::OpenaiGpt53Chat => "GPT-5.3 Chat",
2149 Self::OpenaiGpt53Codex => "GPT-5.3 Codex",
2150 Self::OpenaiGpt54 => "GPT-5.4",
2151 Self::OpenaiGpt54Pro => "GPT-5.4 Pro",
2152 Self::OpenaiGpt54Mini => "GPT-5.4 mini",
2153 Self::OpenaiGpt54Nano => "GPT-5.4 nano",
2154 Self::OpenaiGpt55 => "GPT-5.5",
2155 Self::OpenaiGpt55Pro => "GPT-5.5 Pro",
2156 Self::GoogleGemini25Flash => "Gemini 2.5 Flash",
2157 Self::GoogleGemini25FlashLite => "Gemini 2.5 Flash-Lite",
2158 Self::GoogleGemini25Pro => "Gemini 2.5 Pro",
2159 Self::GoogleGemini25ProPreview0506 => "Gemini 2.5 Pro Preview 05-06",
2160 Self::GoogleGemini25ProPreview => "Gemini 2.5 Pro Preview 06-05",
2161 Self::GoogleGemini3FlashPreview => "Gemini 3 Flash Preview",
2162 Self::GoogleGemini31FlashLite => "Gemini 3.1 Flash Lite",
2163 Self::GoogleGemini31FlashLitePreview => "Gemini 3.1 Flash Lite Preview",
2164 Self::GoogleGemini31ProPreview => "Gemini 3.1 Pro Preview",
2165 Self::GoogleGemini31ProPreviewCustomtools => {
2166 "Gemini 3.1 Pro Preview Custom Tools"
2167 }
2168 Self::GoogleGemini35Flash => "Gemini 3.5 Flash",
2169 Self::GoogleGemma312bIt => "Gemma 3 12B",
2170 Self::GoogleGemma327bIt => "Gemma 3 27B",
2171 Self::GoogleGemma426bA4bItFree => "Gemma 4 26B A4B (free)",
2172 Self::GoogleGemma426bA4bIt => "Gemma 4 26B A4B IT",
2173 Self::GoogleGemma431bItFree => "Gemma 4 31B (free)",
2174 Self::GoogleGemma431bIt => "Gemma 4 31B IT",
2175 Self::IbmGraniteGranite418b => "Granite 4.1 8B",
2176 Self::XAiGrok420 => "Grok 4.20",
2177 Self::XAiGrok43 => "Grok 4.3",
2178 Self::XAiGrok45 => "Grok 4.5",
2179 Self::XAiGrokBuild01 => "Grok Build 0.1",
2180 Self::TencentHy3 => "Hy3",
2181 Self::TencentHy3Free => "Hy3 (free)",
2182 Self::TencentHy3Preview => "Hy3 preview",
2183 Self::Ai21JambaLarge17 => "Jamba Large 1.7",
2184 Self::KwaipilotKatCoderProV2 => "KAT-Coder-Pro V2",
2185 Self::MoonshotaiKimiK2 => "Kimi K2 0711",
2186 Self::MoonshotaiKimiK20905 => "Kimi K2 0905",
2187 Self::MoonshotaiKimiK2Thinking => "Kimi K2 Thinking",
2188 Self::MoonshotaiKimiK25 => "Kimi K2.5",
2189 Self::MoonshotaiKimiK26 => "Kimi K2.6",
2190 Self::MoonshotaiKimiK27Code => "Kimi K2.7 Code",
2191 Self::LiquidLfm2512bThinkingFree => "LFM2.5-1.2B-Thinking (free)",
2192 Self::PoolsideLagunaM1 => "Laguna M.1",
2193 Self::PoolsideLagunaM1Free => "Laguna M.1 (free)",
2194 Self::PoolsideLagunaXs21 => "Laguna XS 2.1",
2195 Self::PoolsideLagunaXs21Free => "Laguna XS 2.1 (free)",
2196 Self::InclusionaiLing261t => "Ling-2.6-1T",
2197 Self::InclusionaiLing26Flash => "Ling-2.6-flash",
2198 Self::MetaLlamaLlama3170bInstruct => "Llama 3.1 70B Instruct",
2199 Self::MetaLlamaLlama318bInstruct => "Llama 3.1 8B Instruct",
2200 Self::Sao10kL31Euryale70b => "Llama 3.1 Euryale 70B v2.2",
2201 Self::MetaLlamaLlama3370bInstructFree => "Llama 3.3 70B Instruct (free)",
2202 Self::NvidiaLlama33NemotronSuper49bV15 => "Llama 3.3 Nemotron Super 49B v1.5",
2203 Self::MetaLlamaLlama4Maverick => "Llama 4 Maverick",
2204 Self::MetaLlamaLlama4Scout => "Llama 4 Scout",
2205 Self::MetaLlamaLlama3370bInstruct => "Llama-3.3-70B-Instruct",
2206 Self::InceptionMercury2 => "Mercury 2",
2207 Self::XiaomiMimoV25 => "MiMo-V2.5",
2208 Self::XiaomiMimoV25Pro => "MiMo-V2.5-Pro",
2209 Self::MinimaxMinimaxM1 => "MiniMax M1",
2210 Self::MinimaxMinimaxM2 => "MiniMax-M2",
2211 Self::MinimaxMinimaxM21 => "MiniMax-M2.1",
2212 Self::MinimaxMinimaxM25 => "MiniMax-M2.5",
2213 Self::MinimaxMinimaxM27 => "MiniMax-M2.7",
2214 Self::MinimaxMinimaxM3 => "MiniMax-M3",
2215 Self::MistralaiMinistral14b2512 => "Ministral 3 14B 2512",
2216 Self::MistralaiMinistral3b2512 => "Ministral 3 3B 2512",
2217 Self::MistralaiMinistral8b2512 => "Ministral 3 8B 2512",
2218 Self::MistralaiMistralLarge => "Mistral Large",
2219 Self::MistralaiMistralLarge2407 => "Mistral Large 2407",
2220 Self::MistralaiMistralLarge2512 => "Mistral Large 3",
2221 Self::MistralaiMistralMedium3 => "Mistral Medium 3",
2222 Self::MistralaiMistralMedium31 => "Mistral Medium 3.1",
2223 Self::MistralaiMistralMedium35 => "Mistral Medium 3.5",
2224 Self::MistralaiMistralNemo => "Mistral Nemo",
2225 Self::MistralaiMistralSmall3224bInstruct => "Mistral Small 3.2 24B",
2226 Self::MistralaiMistralSmall2603 => "Mistral Small 4",
2227 Self::MistralaiMixtral8x22bInstruct => "Mixtral 8x22B Instruct",
2228 Self::GoogleGemini3ProImage => "Nano Banana Pro (Gemini 3 Pro Image)",
2229 Self::NvidiaNemotron3Nano30bA3b => "Nemotron 3 Nano 30B A3B",
2230 Self::NvidiaNemotron3Nano30bA3bFree => "Nemotron 3 Nano 30B A3B (free)",
2231 Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree => {
2232 "Nemotron 3 Nano Omni (free)"
2233 }
2234 Self::NvidiaNemotron3Super120bA12bFree => "Nemotron 3 Super (free)",
2235 Self::NvidiaNemotron3Super120bA12b => "Nemotron 3 Super 120B A12B",
2236 Self::NvidiaNemotron3Ultra550bA55bFree => "Nemotron 3 Ultra (free)",
2237 Self::NvidiaNemotron3Ultra550bA55b => "Nemotron 3 Ultra 550B A55B",
2238 Self::NvidiaNemotronNano12bV2VlFree => "Nemotron Nano 12B 2 VL (free)",
2239 Self::NvidiaNemotronNano9bV2Free => "Nemotron Nano 9B V2 (free)",
2240 Self::NexAgiNexN2Mini => "Nex-N2-Mini",
2241 Self::NexAgiNexN2Pro => "Nex-N2-Pro",
2242 Self::CohereNorthMiniCodeFree => "North Mini Code (free)",
2243 Self::AmazonNova2LiteV1 => "Nova 2 Lite",
2244 Self::AmazonNovaLiteV1 => "Nova Lite 1.0",
2245 Self::AmazonNovaMicroV1 => "Nova Micro 1.0",
2246 Self::AmazonNovaPremierV1 => "Nova Premier 1.0",
2247 Self::AmazonNovaProV1 => "Nova Pro 1.0",
2248 Self::QwenQwenPlus => "Qwen Plus",
2249 Self::QwenQwenPlus20250728 => "Qwen Plus 0728",
2250 Self::QwenQwenPlus20250728Thinking => "Qwen Plus 0728 (thinking)",
2251 Self::QwenQwen2572bInstruct => "Qwen2.5 72B Instruct",
2252 Self::QwenQwen257bInstruct => "Qwen2.5 7B Instruct",
2253 Self::QwenQwen314b => "Qwen3 14B",
2254 Self::QwenQwen3235bA22b2507 => "Qwen3 235B A22B Instruct 2507",
2255 Self::QwenQwen3235bA22bThinking2507 => "Qwen3 235B A22B Thinking 2507",
2256 Self::QwenQwen3235bA22b => "Qwen3 235B-A22B",
2257 Self::QwenQwen330bA3b => "Qwen3 30B A3B",
2258 Self::QwenQwen330bA3bInstruct2507 => "Qwen3 30B A3B Instruct 2507",
2259 Self::QwenQwen330bA3bThinking2507 => "Qwen3 30B A3B Thinking 2507",
2260 Self::QwenQwen332b => "Qwen3 32B",
2261 Self::QwenQwen38b => "Qwen3 8B",
2262 Self::QwenQwen3Coder => "Qwen3 Coder 480B A35B",
2263 Self::QwenQwen3CoderFree => "Qwen3 Coder 480B A35B (free)",
2264 Self::QwenQwen3CoderFlash => "Qwen3 Coder Flash",
2265 Self::QwenQwen3CoderNext => "Qwen3 Coder Next",
2266 Self::QwenQwen3CoderPlus => "Qwen3 Coder Plus",
2267 Self::QwenQwen3Max => "Qwen3 Max",
2268 Self::QwenQwen3MaxThinking => "Qwen3 Max Thinking",
2269 Self::QwenQwen3Next80bA3bInstructFree => "Qwen3 Next 80B A3B Instruct (free)",
2270 Self::QwenQwen3Vl235bA22bInstruct => "Qwen3 VL 235B A22B Instruct",
2271 Self::QwenQwen3Vl235bA22bThinking => "Qwen3 VL 235B A22B Thinking",
2272 Self::QwenQwen3Vl30bA3bInstruct => "Qwen3 VL 30B A3B Instruct",
2273 Self::QwenQwen3Vl30bA3bThinking => "Qwen3 VL 30B A3B Thinking",
2274 Self::QwenQwen3Vl32bInstruct => "Qwen3 VL 32B Instruct",
2275 Self::QwenQwen3Vl8bInstruct => "Qwen3 VL 8B Instruct",
2276 Self::QwenQwen3Vl8bThinking => "Qwen3 VL 8B Thinking",
2277 Self::QwenQwen3Coder30bA3bInstruct => "Qwen3-Coder 30B-A3B Instruct",
2278 Self::QwenQwen3Next80bA3bThinking => "Qwen3-Next 80B-A3B (Thinking)",
2279 Self::QwenQwen3Next80bA3bInstruct => "Qwen3-Next 80B-A3B Instruct",
2280 Self::QwenQwen35122bA10b => "Qwen3.5 122B-A10B",
2281 Self::QwenQwen3527b => "Qwen3.5 27B",
2282 Self::QwenQwen3535bA3b => "Qwen3.5 35B-A3B",
2283 Self::QwenQwen35397bA17b => "Qwen3.5 397B-A17B",
2284 Self::QwenQwen359b => "Qwen3.5 9B",
2285 Self::QwenQwen35Plus0215 => "Qwen3.5 Plus 2026-02-15",
2286 Self::QwenQwen35Plus20260420 => "Qwen3.5 Plus 2026-04-20",
2287 Self::QwenQwen35Flash0223 => "Qwen3.5-Flash",
2288 Self::QwenQwen3627b => "Qwen3.6 27B",
2289 Self::QwenQwen3635bA3b => "Qwen3.6 35B-A3B",
2290 Self::QwenQwen36Flash => "Qwen3.6 Flash",
2291 Self::QwenQwen36MaxPreview => "Qwen3.6 Max Preview",
2292 Self::QwenQwen36Plus => "Qwen3.6 Plus",
2293 Self::QwenQwen37Max => "Qwen3.7 Max",
2294 Self::QwenQwen37Plus => "Qwen3.7 Plus",
2295 Self::DeepseekDeepseekR10528 => "R1 0528",
2296 Self::RekaaiRekaEdge => "Reka Edge",
2297 Self::RelaceRelaceSearch => "Relace Search",
2298 Self::InclusionaiRing261t => "Ring-2.6-1T",
2299 Self::MistralaiMistralSaba => "Saba",
2300 Self::BytedanceSeedSeed16 => "Seed 1.6",
2301 Self::BytedanceSeedSeed16Flash => "Seed 1.6 Flash",
2302 Self::BytedanceSeedSeed20Lite => "Seed-2.0-Lite",
2303 Self::BytedanceSeedSeed20Mini => "Seed-2.0-Mini",
2304 Self::UpstageSolarPro3 => "Solar Pro 3",
2305 Self::StepfunStep35Flash => "Step 3.5 Flash",
2306 Self::StepfunStep37Flash => "Step 3.7 Flash",
2307 Self::ArceeAiTrinityLargeThinking => "Trinity Large Thinking",
2308 Self::ArceeAiTrinityMini => "Trinity Mini",
2309 Self::ThedrummerUnslopnemo12b => "UnslopNemo 12B",
2310 Self::ArceeAiVirtuosoLarge => "Virtuoso Large",
2311 Self::MistralaiVoxtralSmall24b2507 => "Voxtral Small 24B 2507",
2312 Self::OpenaiGptOss120bFree => "gpt-oss-120b (free)",
2313 Self::OpenaiGptOss20bFree => "gpt-oss-20b (free)",
2314 Self::OpenaiGptOssSafeguard20b => "gpt-oss-safeguard-20b",
2315 Self::OpenaiO1 => "o1",
2316 Self::OpenaiO3 => "o3",
2317 Self::OpenaiO3MiniHigh => "o3 Mini High",
2318 Self::OpenaiO3DeepResearch => "o3-deep-research",
2319 Self::OpenaiO3Mini => "o3-mini",
2320 Self::OpenaiO3Pro => "o3-pro",
2321 Self::OpenaiO4MiniHigh => "o4 Mini High",
2322 Self::OpenaiO4Mini => "o4-mini",
2323 Self::OpenaiO4MiniDeepResearch => "o4-mini-deep-research",
2324 }
2325 }
2326 #[allow(clippy::too_many_lines)]
2327 fn context_window(self) -> u32 {
2328 match self {
2329 Self::OpenaiGpt35Turbo0613 => 4095,
2330 Self::OpenaiGpt4 => 8191,
2331 Self::RekaaiRekaEdge => 16_384,
2332 Self::OpenaiGpt35Turbo | Self::OpenaiGpt35Turbo16k => 16_385,
2333 Self::MistralaiVoxtralSmall24b2507 | Self::XiaomiMimoV25 => 32_000,
2334 Self::LiquidLfm2512bThinkingFree
2335 | Self::MistralaiMistralSaba
2336 | Self::QwenQwen2572bInstruct
2337 | Self::QwenQwen257bInstruct
2338 | Self::ThedrummerUnslopnemo12b => 32_768,
2339 Self::QwenQwen314b | Self::QwenQwen330bA3b | Self::QwenQwen332b => 40_960,
2340 Self::DeepseekDeepseekR1 => 64_000,
2341 Self::GoogleGemini3ProImage
2342 | Self::MetaLlamaLlama3370bInstructFree
2343 | Self::MistralaiMixtral8x22bInstruct
2344 | Self::ZAiGlm45v => 65_536,
2345 Self::QwenQwen330bA3bThinking2507 => 81_920,
2346 Self::AmazonNovaMicroV1
2347 | Self::CohereCommandR082024
2348 | Self::CohereCommandRPlus082024
2349 | Self::DeepseekDeepseekChat
2350 | Self::DeepseekDeepseekV32
2351 | Self::InceptionMercury2
2352 | Self::MistralaiMistralLarge
2353 | Self::MistralaiMistralSmall3224bInstruct
2354 | Self::NvidiaNemotronNano12bV2VlFree
2355 | Self::NvidiaNemotronNano9bV2Free
2356 | Self::OpenaiGpt4Turbo
2357 | Self::OpenaiGpt4TurboPreview
2358 | Self::OpenaiGpt4o
2359 | Self::OpenaiGpt4o20240513
2360 | Self::OpenaiGpt4o20240806
2361 | Self::OpenaiGpt4o20241120
2362 | Self::OpenaiGpt4oMini
2363 | Self::OpenaiGpt4oMini20240718
2364 | Self::OpenaiGpt51Chat
2365 | Self::OpenaiGpt52Chat
2366 | Self::OpenaiGpt53Chat
2367 | Self::OpenaiGptAudio
2368 | Self::OpenaiGptAudioMini
2369 | Self::QwenQwen330bA3bInstruct2507
2370 | Self::UpstageSolarPro3 => 128_000,
2371 Self::AionLabsAion20
2372 | Self::AionLabsAion30
2373 | Self::AionLabsAion30Mini
2374 | Self::ArceeAiTrinityMini
2375 | Self::ArceeAiVirtuosoLarge
2376 | Self::GoogleGemma312bIt
2377 | Self::GoogleGemma327bIt
2378 | Self::GoogleGemma426bA4bItFree
2379 | Self::IbmGraniteGranite418b
2380 | Self::MetaLlamaLlama3170bInstruct
2381 | Self::MetaLlamaLlama318bInstruct
2382 | Self::MetaLlamaLlama3370bInstruct
2383 | Self::MistralaiMinistral3b2512
2384 | Self::MistralaiMistralLarge2407
2385 | Self::MistralaiMistralMedium3
2386 | Self::MistralaiMistralMedium31
2387 | Self::MistralaiMistralNemo
2388 | Self::MoonshotaiKimiK2
2389 | Self::NvidiaLlama33NemotronSuper49bV15
2390 | Self::OpenaiGptOss120b
2391 | Self::OpenaiGptOss120bFree
2392 | Self::OpenaiGptOss20b
2393 | Self::OpenaiGptOss20bFree
2394 | Self::OpenaiGptOssSafeguard20b
2395 | Self::QwenQwen3235bA22b
2396 | Self::QwenQwen3235bA22bThinking2507
2397 | Self::QwenQwen38b
2398 | Self::QwenQwen3Next80bA3bThinking
2399 | Self::QwenQwen3Vl235bA22bThinking
2400 | Self::QwenQwen3Vl30bA3bInstruct
2401 | Self::QwenQwen3Vl30bA3bThinking
2402 | Self::QwenQwen3Vl32bInstruct
2403 | Self::QwenQwen3Vl8bInstruct
2404 | Self::QwenQwen3Vl8bThinking
2405 | Self::QwenQwen35397bA17b
2406 | Self::Sao10kL31Euryale70b
2407 | Self::ZAiGlm45
2408 | Self::ZAiGlm45Air
2409 | Self::ZAiGlm46v => 131_072,
2410 Self::QwenQwen3Coder30bA3bInstruct => 160_000,
2411 Self::DeepseekDeepseekChatV30324
2412 | Self::DeepseekDeepseekChatV31
2413 | Self::DeepseekDeepseekR10528
2414 | Self::DeepseekDeepseekV31Terminus
2415 | Self::DeepseekDeepseekV32Exp => 163_840,
2416 Self::MinimaxMinimaxM25 | Self::MinimaxMinimaxM27 => 196_608,
2417 Self::AnthropicClaude3Haiku
2418 | Self::AnthropicClaudeHaiku45
2419 | Self::AnthropicClaudeOpus4
2420 | Self::AnthropicClaudeOpus41
2421 | Self::AnthropicClaudeOpus45
2422 | Self::OpenaiO1
2423 | Self::OpenaiO3
2424 | Self::OpenaiO3DeepResearch
2425 | Self::OpenaiO3Mini
2426 | Self::OpenaiO3MiniHigh
2427 | Self::OpenaiO3Pro
2428 | Self::OpenaiO4Mini
2429 | Self::OpenaiO4MiniDeepResearch
2430 | Self::OpenaiO4MiniHigh
2431 | Self::OpenrouterFree
2432 | Self::ZAiGlm51 => 200_000,
2433 Self::ZAiGlm46
2434 | Self::ZAiGlm47
2435 | Self::ZAiGlm47Flash
2436 | Self::ZAiGlm5
2437 | Self::ZAiGlm5vTurbo => 202_752,
2438 Self::MinimaxMinimaxM2 | Self::MinimaxMinimaxM21 => 204_800,
2439 Self::Ai21JambaLarge17
2440 | Self::CohereNorthMiniCodeFree
2441 | Self::KwaipilotKatCoderProV2
2442 | Self::MistralaiCodestral2508
2443 | Self::MoonshotaiKimiK25
2444 | Self::NvidiaNemotron3Nano30bA3bFree
2445 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
2446 | Self::RelaceRelaceSearch
2447 | Self::StepfunStep37Flash
2448 | Self::XAiGrokBuild01 => 256_000,
2449 Self::QwenQwen3CoderFree => 262_000,
2450 Self::QwenQwen3627b => 262_140,
2451 Self::ArceeAiTrinityLargeThinking
2452 | Self::BytedanceSeedSeed16
2453 | Self::BytedanceSeedSeed16Flash
2454 | Self::BytedanceSeedSeed20Lite
2455 | Self::BytedanceSeedSeed20Mini
2456 | Self::GoogleGemma426bA4bIt
2457 | Self::GoogleGemma431bIt
2458 | Self::GoogleGemma431bItFree
2459 | Self::InclusionaiLing261t
2460 | Self::InclusionaiLing26Flash
2461 | Self::InclusionaiRing261t
2462 | Self::MistralaiDevstral2512
2463 | Self::MistralaiMinistral14b2512
2464 | Self::MistralaiMinistral8b2512
2465 | Self::MistralaiMistralLarge2512
2466 | Self::MistralaiMistralMedium35
2467 | Self::MistralaiMistralSmall2603
2468 | Self::MoonshotaiKimiK20905
2469 | Self::MoonshotaiKimiK2Thinking
2470 | Self::MoonshotaiKimiK26
2471 | Self::MoonshotaiKimiK27Code
2472 | Self::NexAgiNexN2Mini
2473 | Self::NexAgiNexN2Pro
2474 | Self::NvidiaNemotron3Nano30bA3b
2475 | Self::NvidiaNemotron3Super120bA12b
2476 | Self::NvidiaNemotron3Super120bA12bFree
2477 | Self::NvidiaNemotron3Ultra550bA55b
2478 | Self::PoolsideLagunaM1
2479 | Self::PoolsideLagunaM1Free
2480 | Self::PoolsideLagunaXs21
2481 | Self::PoolsideLagunaXs21Free
2482 | Self::QwenQwen3235bA22b2507
2483 | Self::QwenQwen3Coder
2484 | Self::QwenQwen3CoderNext
2485 | Self::QwenQwen3Max
2486 | Self::QwenQwen3MaxThinking
2487 | Self::QwenQwen3Next80bA3bInstruct
2488 | Self::QwenQwen3Next80bA3bInstructFree
2489 | Self::QwenQwen3Vl235bA22bInstruct
2490 | Self::QwenQwen35122bA10b
2491 | Self::QwenQwen3527b
2492 | Self::QwenQwen3535bA3b
2493 | Self::QwenQwen359b
2494 | Self::QwenQwen3635bA3b
2495 | Self::QwenQwen36MaxPreview
2496 | Self::StepfunStep35Flash
2497 | Self::TencentHy3
2498 | Self::TencentHy3Preview
2499 | Self::TencentHy3Free
2500 | Self::ZAiGlm5Turbo => 262_144,
2501 Self::AmazonNovaLiteV1 | Self::AmazonNovaProV1 => 300_000,
2502 Self::MetaLlamaLlama4Scout => 327_680,
2503 Self::OpenaiGpt5
2504 | Self::OpenaiGpt5Codex
2505 | Self::OpenaiGpt5Mini
2506 | Self::OpenaiGpt5Nano
2507 | Self::OpenaiGpt5Pro
2508 | Self::OpenaiGpt51
2509 | Self::OpenaiGpt51Codex
2510 | Self::OpenaiGpt51CodexMax
2511 | Self::OpenaiGpt51CodexMini
2512 | Self::OpenaiGpt52
2513 | Self::OpenaiGpt52Codex
2514 | Self::OpenaiGpt52Pro
2515 | Self::OpenaiGpt53Codex
2516 | Self::OpenaiGpt54Mini
2517 | Self::OpenaiGpt54Nano => 400_000,
2518 Self::XAiGrok45 => 500_000,
2519 Self::MinimaxMinimaxM3 => 524_288,
2520 Self::AmazonNova2LiteV1
2521 | Self::AmazonNovaPremierV1
2522 | Self::AnthropicClaudeFable5
2523 | Self::AnthropicClaudeOpus46
2524 | Self::AnthropicClaudeOpus47
2525 | Self::AnthropicClaudeOpus47Fast
2526 | Self::AnthropicClaudeOpus48
2527 | Self::AnthropicClaudeOpus48Fast
2528 | Self::AnthropicClaudeSonnet4
2529 | Self::AnthropicClaudeSonnet45
2530 | Self::AnthropicClaudeSonnet46
2531 | Self::AnthropicClaudeSonnet5
2532 | Self::MinimaxMinimaxM1
2533 | Self::NvidiaNemotron3Ultra550bA55bFree
2534 | Self::QwenQwenPlus
2535 | Self::QwenQwenPlus20250728
2536 | Self::QwenQwenPlus20250728Thinking
2537 | Self::QwenQwen3CoderFlash
2538 | Self::QwenQwen3CoderPlus
2539 | Self::QwenQwen35Flash0223
2540 | Self::QwenQwen35Plus0215
2541 | Self::QwenQwen35Plus20260420
2542 | Self::QwenQwen36Flash
2543 | Self::QwenQwen36Plus
2544 | Self::QwenQwen37Max
2545 | Self::QwenQwen37Plus
2546 | Self::SakanaFuguUltra
2547 | Self::XAiGrok43 => 1_000_000,
2548 Self::ZAiGlm52 => 1_024_000,
2549 Self::OpenaiGpt41 | Self::OpenaiGpt41Mini | Self::OpenaiGpt41Nano => {
2550 1_047_576
2551 }
2552 Self::DeepseekDeepseekV4Flash
2553 | Self::DeepseekDeepseekV4Pro
2554 | Self::GoogleGemini25Flash
2555 | Self::GoogleGemini25FlashLite
2556 | Self::GoogleGemini25Pro
2557 | Self::GoogleGemini25ProPreview
2558 | Self::GoogleGemini25ProPreview0506
2559 | Self::GoogleGemini3FlashPreview
2560 | Self::GoogleGemini31FlashLite
2561 | Self::GoogleGemini31FlashLitePreview
2562 | Self::GoogleGemini31ProPreview
2563 | Self::GoogleGemini31ProPreviewCustomtools
2564 | Self::GoogleGemini35Flash
2565 | Self::MetaLlamaLlama4Maverick
2566 | Self::XiaomiMimoV25Pro => 1_048_576,
2567 Self::OpenaiGpt54
2568 | Self::OpenaiGpt54Pro
2569 | Self::OpenaiGpt55
2570 | Self::OpenaiGpt55Pro => 1_050_000,
2571 Self::OpenrouterAuto | Self::XAiGrok420 => 2_000_000,
2572 }
2573 }
2574 #[allow(clippy::too_many_lines)]
2575 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
2576 match self {
2577 Self::Ai21JambaLarge17
2578 | Self::AmazonNovaLiteV1
2579 | Self::AmazonNovaMicroV1
2580 | Self::AmazonNovaPremierV1
2581 | Self::AmazonNovaProV1
2582 | Self::AnthropicClaude3Haiku
2583 | Self::ArceeAiVirtuosoLarge
2584 | Self::CohereCommandR082024
2585 | Self::CohereCommandRPlus082024
2586 | Self::DeepseekDeepseekChat
2587 | Self::DeepseekDeepseekChatV30324
2588 | Self::GoogleGemma312bIt
2589 | Self::GoogleGemma327bIt
2590 | Self::IbmGraniteGranite418b
2591 | Self::InclusionaiLing261t
2592 | Self::InclusionaiLing26Flash
2593 | Self::KwaipilotKatCoderProV2
2594 | Self::MetaLlamaLlama3170bInstruct
2595 | Self::MetaLlamaLlama318bInstruct
2596 | Self::MetaLlamaLlama3370bInstruct
2597 | Self::MetaLlamaLlama3370bInstructFree
2598 | Self::MetaLlamaLlama4Maverick
2599 | Self::MetaLlamaLlama4Scout
2600 | Self::MistralaiCodestral2508
2601 | Self::MistralaiDevstral2512
2602 | Self::MistralaiMinistral14b2512
2603 | Self::MistralaiMinistral3b2512
2604 | Self::MistralaiMinistral8b2512
2605 | Self::MistralaiMistralLarge
2606 | Self::MistralaiMistralLarge2407
2607 | Self::MistralaiMistralLarge2512
2608 | Self::MistralaiMistralMedium3
2609 | Self::MistralaiMistralMedium31
2610 | Self::MistralaiMistralNemo
2611 | Self::MistralaiMistralSaba
2612 | Self::MistralaiMistralSmall3224bInstruct
2613 | Self::MistralaiMixtral8x22bInstruct
2614 | Self::MistralaiVoxtralSmall24b2507
2615 | Self::MoonshotaiKimiK2
2616 | Self::MoonshotaiKimiK20905
2617 | Self::OpenaiGpt35Turbo
2618 | Self::OpenaiGpt35Turbo0613
2619 | Self::OpenaiGpt35Turbo16k
2620 | Self::OpenaiGpt4
2621 | Self::OpenaiGpt4Turbo
2622 | Self::OpenaiGpt4TurboPreview
2623 | Self::OpenaiGpt41
2624 | Self::OpenaiGpt41Mini
2625 | Self::OpenaiGpt41Nano
2626 | Self::OpenaiGpt4o
2627 | Self::OpenaiGpt4o20240513
2628 | Self::OpenaiGpt4o20240806
2629 | Self::OpenaiGpt4o20241120
2630 | Self::OpenaiGpt4oMini
2631 | Self::OpenaiGpt4oMini20240718
2632 | Self::OpenaiGpt51Chat
2633 | Self::OpenaiGpt52Chat
2634 | Self::OpenaiGpt53Chat
2635 | Self::OpenaiGptAudio
2636 | Self::OpenaiGptAudioMini
2637 | Self::QwenQwen2572bInstruct
2638 | Self::QwenQwen257bInstruct
2639 | Self::QwenQwenPlus
2640 | Self::QwenQwenPlus20250728
2641 | Self::QwenQwen3235bA22b2507
2642 | Self::QwenQwen330bA3bInstruct2507
2643 | Self::QwenQwen3Coder
2644 | Self::QwenQwen3Coder30bA3bInstruct
2645 | Self::QwenQwen3CoderFlash
2646 | Self::QwenQwen3CoderNext
2647 | Self::QwenQwen3CoderPlus
2648 | Self::QwenQwen3CoderFree
2649 | Self::QwenQwen3Max
2650 | Self::QwenQwen3Next80bA3bInstruct
2651 | Self::QwenQwen3Next80bA3bInstructFree
2652 | Self::QwenQwen3Vl235bA22bInstruct
2653 | Self::QwenQwen3Vl30bA3bInstruct
2654 | Self::QwenQwen3Vl32bInstruct
2655 | Self::QwenQwen3Vl8bInstruct
2656 | Self::RekaaiRekaEdge
2657 | Self::RelaceRelaceSearch
2658 | Self::Sao10kL31Euryale70b
2659 | Self::ThedrummerUnslopnemo12b => &[],
2660 Self::MistralaiMistralMedium35
2661 | Self::MistralaiMistralSmall2603
2662 | Self::OpenaiGpt5Pro
2663 | Self::OpenaiO3MiniHigh
2664 | Self::OpenaiO4MiniHigh => &[ReasoningEffort::High],
2665 Self::DeepseekDeepseekV4Flash
2666 | Self::DeepseekDeepseekV4Pro
2667 | Self::InclusionaiRing261t
2668 | Self::ZAiGlm52 => &[ReasoningEffort::High, ReasoningEffort::Xhigh],
2669 Self::TencentHy3 | Self::TencentHy3Preview | Self::TencentHy3Free => {
2670 &[ReasoningEffort::Low, ReasoningEffort::High]
2671 }
2672 Self::NvidiaNemotron3Super120bA12b
2673 | Self::NvidiaNemotron3Super120bA12bFree => {
2674 &[ReasoningEffort::Low, ReasoningEffort::Medium]
2675 }
2676 Self::AionLabsAion20
2677 | Self::AionLabsAion30
2678 | Self::AionLabsAion30Mini
2679 | Self::AmazonNova2LiteV1
2680 | Self::AnthropicClaudeHaiku45
2681 | Self::AnthropicClaudeOpus4
2682 | Self::AnthropicClaudeOpus41
2683 | Self::AnthropicClaudeOpus45
2684 | Self::AnthropicClaudeSonnet4
2685 | Self::AnthropicClaudeSonnet45
2686 | Self::ArceeAiTrinityLargeThinking
2687 | Self::ArceeAiTrinityMini
2688 | Self::BytedanceSeedSeed16
2689 | Self::BytedanceSeedSeed16Flash
2690 | Self::CohereNorthMiniCodeFree
2691 | Self::DeepseekDeepseekChatV31
2692 | Self::DeepseekDeepseekR1
2693 | Self::DeepseekDeepseekR10528
2694 | Self::DeepseekDeepseekV31Terminus
2695 | Self::DeepseekDeepseekV32
2696 | Self::DeepseekDeepseekV32Exp
2697 | Self::GoogleGemini25Flash
2698 | Self::GoogleGemini25FlashLite
2699 | Self::GoogleGemini25Pro
2700 | Self::GoogleGemini25ProPreview
2701 | Self::GoogleGemini25ProPreview0506
2702 | Self::GoogleGemini3ProImage
2703 | Self::GoogleGemini31ProPreview
2704 | Self::GoogleGemini31ProPreviewCustomtools
2705 | Self::GoogleGemma426bA4bIt
2706 | Self::GoogleGemma426bA4bItFree
2707 | Self::GoogleGemma431bIt
2708 | Self::GoogleGemma431bItFree
2709 | Self::InceptionMercury2
2710 | Self::LiquidLfm2512bThinkingFree
2711 | Self::MinimaxMinimaxM1
2712 | Self::MinimaxMinimaxM2
2713 | Self::MinimaxMinimaxM21
2714 | Self::MinimaxMinimaxM25
2715 | Self::MinimaxMinimaxM27
2716 | Self::MinimaxMinimaxM3
2717 | Self::MoonshotaiKimiK2Thinking
2718 | Self::MoonshotaiKimiK25
2719 | Self::MoonshotaiKimiK26
2720 | Self::MoonshotaiKimiK27Code
2721 | Self::NexAgiNexN2Mini
2722 | Self::NexAgiNexN2Pro
2723 | Self::NvidiaLlama33NemotronSuper49bV15
2724 | Self::NvidiaNemotron3Nano30bA3b
2725 | Self::NvidiaNemotron3Nano30bA3bFree
2726 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
2727 | Self::NvidiaNemotronNano12bV2VlFree
2728 | Self::NvidiaNemotronNano9bV2Free
2729 | Self::OpenaiGpt5Codex
2730 | Self::OpenaiGpt51
2731 | Self::OpenaiGpt51Codex
2732 | Self::OpenaiGpt51CodexMini
2733 | Self::OpenaiGptOss120b
2734 | Self::OpenaiGptOss120bFree
2735 | Self::OpenaiGptOss20b
2736 | Self::OpenaiGptOss20bFree
2737 | Self::OpenaiGptOssSafeguard20b
2738 | Self::OpenaiO1
2739 | Self::OpenaiO3
2740 | Self::OpenaiO3DeepResearch
2741 | Self::OpenaiO3Mini
2742 | Self::OpenaiO3Pro
2743 | Self::OpenaiO4Mini
2744 | Self::OpenaiO4MiniDeepResearch
2745 | Self::OpenrouterAuto
2746 | Self::OpenrouterFree
2747 | Self::PoolsideLagunaM1
2748 | Self::PoolsideLagunaM1Free
2749 | Self::PoolsideLagunaXs21
2750 | Self::PoolsideLagunaXs21Free
2751 | Self::QwenQwenPlus20250728Thinking
2752 | Self::QwenQwen314b
2753 | Self::QwenQwen3235bA22b
2754 | Self::QwenQwen3235bA22bThinking2507
2755 | Self::QwenQwen330bA3b
2756 | Self::QwenQwen330bA3bThinking2507
2757 | Self::QwenQwen332b
2758 | Self::QwenQwen38b
2759 | Self::QwenQwen3MaxThinking
2760 | Self::QwenQwen3Next80bA3bThinking
2761 | Self::QwenQwen3Vl235bA22bThinking
2762 | Self::QwenQwen3Vl30bA3bThinking
2763 | Self::QwenQwen3Vl8bThinking
2764 | Self::QwenQwen35122bA10b
2765 | Self::QwenQwen3527b
2766 | Self::QwenQwen3535bA3b
2767 | Self::QwenQwen35397bA17b
2768 | Self::QwenQwen359b
2769 | Self::QwenQwen35Flash0223
2770 | Self::QwenQwen35Plus0215
2771 | Self::QwenQwen35Plus20260420
2772 | Self::QwenQwen3627b
2773 | Self::QwenQwen3635bA3b
2774 | Self::QwenQwen36Flash
2775 | Self::QwenQwen36MaxPreview
2776 | Self::QwenQwen36Plus
2777 | Self::QwenQwen37Max
2778 | Self::QwenQwen37Plus
2779 | Self::StepfunStep35Flash
2780 | Self::StepfunStep37Flash
2781 | Self::UpstageSolarPro3
2782 | Self::XAiGrok420
2783 | Self::XAiGrok43
2784 | Self::XAiGrok45
2785 | Self::XAiGrokBuild01
2786 | Self::XiaomiMimoV25
2787 | Self::XiaomiMimoV25Pro
2788 | Self::ZAiGlm45
2789 | Self::ZAiGlm45Air
2790 | Self::ZAiGlm45v
2791 | Self::ZAiGlm46
2792 | Self::ZAiGlm46v
2793 | Self::ZAiGlm47
2794 | Self::ZAiGlm47Flash
2795 | Self::ZAiGlm5
2796 | Self::ZAiGlm5Turbo
2797 | Self::ZAiGlm51
2798 | Self::ZAiGlm5vTurbo => {
2799 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
2800 }
2801 Self::AnthropicClaudeOpus46 | Self::AnthropicClaudeSonnet46 => {
2802 &[
2803 ReasoningEffort::Low,
2804 ReasoningEffort::Medium,
2805 ReasoningEffort::High,
2806 ReasoningEffort::Max,
2807 ]
2808 }
2809 Self::OpenaiGpt51CodexMax
2810 | Self::OpenaiGpt52
2811 | Self::OpenaiGpt52Codex
2812 | Self::OpenaiGpt53Codex
2813 | Self::OpenaiGpt54
2814 | Self::OpenaiGpt54Mini
2815 | Self::OpenaiGpt54Nano
2816 | Self::OpenaiGpt55 => {
2817 &[
2818 ReasoningEffort::Low,
2819 ReasoningEffort::Medium,
2820 ReasoningEffort::High,
2821 ReasoningEffort::Xhigh,
2822 ]
2823 }
2824 Self::AnthropicClaudeFable5
2825 | Self::AnthropicClaudeOpus47
2826 | Self::AnthropicClaudeOpus47Fast
2827 | Self::AnthropicClaudeOpus48
2828 | Self::AnthropicClaudeOpus48Fast
2829 | Self::AnthropicClaudeSonnet5 => {
2830 &[
2831 ReasoningEffort::Low,
2832 ReasoningEffort::Medium,
2833 ReasoningEffort::High,
2834 ReasoningEffort::Xhigh,
2835 ReasoningEffort::Max,
2836 ]
2837 }
2838 Self::SakanaFuguUltra => {
2839 &[ReasoningEffort::Max, ReasoningEffort::Xhigh, ReasoningEffort::High]
2840 }
2841 Self::NvidiaNemotron3Ultra550bA55b
2842 | Self::NvidiaNemotron3Ultra550bA55bFree => {
2843 &[ReasoningEffort::Medium, ReasoningEffort::High]
2844 }
2845 Self::OpenaiGpt52Pro | Self::OpenaiGpt54Pro | Self::OpenaiGpt55Pro => {
2846 &[ReasoningEffort::Medium, ReasoningEffort::High, ReasoningEffort::Xhigh]
2847 }
2848 Self::BytedanceSeedSeed20Lite
2849 | Self::BytedanceSeedSeed20Mini
2850 | Self::GoogleGemini3FlashPreview
2851 | Self::GoogleGemini31FlashLite
2852 | Self::GoogleGemini31FlashLitePreview
2853 | Self::GoogleGemini35Flash
2854 | Self::OpenaiGpt5
2855 | Self::OpenaiGpt5Mini
2856 | Self::OpenaiGpt5Nano => {
2857 &[
2858 ReasoningEffort::Minimal,
2859 ReasoningEffort::Low,
2860 ReasoningEffort::Medium,
2861 ReasoningEffort::High,
2862 ]
2863 }
2864 }
2865 }
2866 pub fn supports_reasoning(self) -> bool {
2867 !self.reasoning_levels().is_empty()
2868 }
2869 #[allow(clippy::too_many_lines)]
2870 pub fn supports_prompt_caching(self) -> bool {
2871 match self {
2872 Self::Ai21JambaLarge17
2873 | Self::AmazonNova2LiteV1
2874 | Self::AmazonNovaLiteV1
2875 | Self::AmazonNovaMicroV1
2876 | Self::AmazonNovaProV1
2877 | Self::ArceeAiTrinityMini
2878 | Self::ArceeAiVirtuosoLarge
2879 | Self::BytedanceSeedSeed16
2880 | Self::BytedanceSeedSeed16Flash
2881 | Self::BytedanceSeedSeed20Lite
2882 | Self::BytedanceSeedSeed20Mini
2883 | Self::CohereCommandR082024
2884 | Self::CohereCommandRPlus082024
2885 | Self::CohereNorthMiniCodeFree
2886 | Self::DeepseekDeepseekChat
2887 | Self::DeepseekDeepseekR1
2888 | Self::DeepseekDeepseekV32Exp
2889 | Self::GoogleGemma312bIt
2890 | Self::GoogleGemma327bIt
2891 | Self::GoogleGemma426bA4bIt
2892 | Self::GoogleGemma426bA4bItFree
2893 | Self::GoogleGemma431bItFree
2894 | Self::LiquidLfm2512bThinkingFree
2895 | Self::MetaLlamaLlama3170bInstruct
2896 | Self::MetaLlamaLlama318bInstruct
2897 | Self::MetaLlamaLlama3370bInstruct
2898 | Self::MetaLlamaLlama3370bInstructFree
2899 | Self::MetaLlamaLlama4Maverick
2900 | Self::MetaLlamaLlama4Scout
2901 | Self::MinimaxMinimaxM1
2902 | Self::MinimaxMinimaxM2
2903 | Self::MinimaxMinimaxM27
2904 | Self::MistralaiMistralMedium35
2905 | Self::MistralaiMistralNemo
2906 | Self::MistralaiMistralSmall3224bInstruct
2907 | Self::MoonshotaiKimiK2
2908 | Self::MoonshotaiKimiK20905
2909 | Self::NvidiaLlama33NemotronSuper49bV15
2910 | Self::NvidiaNemotron3Nano30bA3b
2911 | Self::NvidiaNemotron3Nano30bA3bFree
2912 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
2913 | Self::NvidiaNemotron3Super120bA12b
2914 | Self::NvidiaNemotron3Super120bA12bFree
2915 | Self::NvidiaNemotron3Ultra550bA55bFree
2916 | Self::NvidiaNemotronNano12bV2VlFree
2917 | Self::NvidiaNemotronNano9bV2Free
2918 | Self::OpenaiGpt35Turbo
2919 | Self::OpenaiGpt35Turbo0613
2920 | Self::OpenaiGpt35Turbo16k
2921 | Self::OpenaiGpt4
2922 | Self::OpenaiGpt4Turbo
2923 | Self::OpenaiGpt4TurboPreview
2924 | Self::OpenaiGpt4o
2925 | Self::OpenaiGpt4o20240513
2926 | Self::OpenaiGpt5Pro
2927 | Self::OpenaiGpt52Pro
2928 | Self::OpenaiGpt54Pro
2929 | Self::OpenaiGpt55Pro
2930 | Self::OpenaiGptAudio
2931 | Self::OpenaiGptAudioMini
2932 | Self::OpenaiGptOss120b
2933 | Self::OpenaiGptOss120bFree
2934 | Self::OpenaiGptOss20b
2935 | Self::OpenaiGptOss20bFree
2936 | Self::OpenaiO3Pro
2937 | Self::OpenrouterAuto
2938 | Self::OpenrouterFree
2939 | Self::PoolsideLagunaM1Free
2940 | Self::PoolsideLagunaXs21Free
2941 | Self::QwenQwen2572bInstruct
2942 | Self::QwenQwen257bInstruct
2943 | Self::QwenQwenPlus20250728
2944 | Self::QwenQwen314b
2945 | Self::QwenQwen3235bA22b
2946 | Self::QwenQwen3235bA22b2507
2947 | Self::QwenQwen3235bA22bThinking2507
2948 | Self::QwenQwen330bA3b
2949 | Self::QwenQwen330bA3bInstruct2507
2950 | Self::QwenQwen330bA3bThinking2507
2951 | Self::QwenQwen332b
2952 | Self::QwenQwen38b
2953 | Self::QwenQwen3Coder
2954 | Self::QwenQwen3Coder30bA3bInstruct
2955 | Self::QwenQwen3CoderFree
2956 | Self::QwenQwen3MaxThinking
2957 | Self::QwenQwen3Next80bA3bInstruct
2958 | Self::QwenQwen3Next80bA3bInstructFree
2959 | Self::QwenQwen3Next80bA3bThinking
2960 | Self::QwenQwen3Vl235bA22bThinking
2961 | Self::QwenQwen3Vl30bA3bInstruct
2962 | Self::QwenQwen3Vl30bA3bThinking
2963 | Self::QwenQwen3Vl32bInstruct
2964 | Self::QwenQwen3Vl8bInstruct
2965 | Self::QwenQwen3Vl8bThinking
2966 | Self::QwenQwen35122bA10b
2967 | Self::QwenQwen3527b
2968 | Self::QwenQwen359b
2969 | Self::QwenQwen35Flash0223
2970 | Self::QwenQwen35Plus0215
2971 | Self::QwenQwen3635bA3b
2972 | Self::RekaaiRekaEdge
2973 | Self::RelaceRelaceSearch
2974 | Self::Sao10kL31Euryale70b
2975 | Self::StepfunStep35Flash
2976 | Self::TencentHy3Free
2977 | Self::ThedrummerUnslopnemo12b => false,
2978 Self::AionLabsAion20
2979 | Self::AionLabsAion30
2980 | Self::AionLabsAion30Mini
2981 | Self::AmazonNovaPremierV1
2982 | Self::AnthropicClaude3Haiku
2983 | Self::AnthropicClaudeFable5
2984 | Self::AnthropicClaudeHaiku45
2985 | Self::AnthropicClaudeOpus4
2986 | Self::AnthropicClaudeOpus41
2987 | Self::AnthropicClaudeOpus45
2988 | Self::AnthropicClaudeOpus46
2989 | Self::AnthropicClaudeOpus47
2990 | Self::AnthropicClaudeOpus47Fast
2991 | Self::AnthropicClaudeOpus48
2992 | Self::AnthropicClaudeOpus48Fast
2993 | Self::AnthropicClaudeSonnet4
2994 | Self::AnthropicClaudeSonnet45
2995 | Self::AnthropicClaudeSonnet46
2996 | Self::AnthropicClaudeSonnet5
2997 | Self::ArceeAiTrinityLargeThinking
2998 | Self::DeepseekDeepseekChatV30324
2999 | Self::DeepseekDeepseekChatV31
3000 | Self::DeepseekDeepseekR10528
3001 | Self::DeepseekDeepseekV31Terminus
3002 | Self::DeepseekDeepseekV32
3003 | Self::DeepseekDeepseekV4Flash
3004 | Self::DeepseekDeepseekV4Pro
3005 | Self::GoogleGemini25Flash
3006 | Self::GoogleGemini25FlashLite
3007 | Self::GoogleGemini25Pro
3008 | Self::GoogleGemini25ProPreview
3009 | Self::GoogleGemini25ProPreview0506
3010 | Self::GoogleGemini3FlashPreview
3011 | Self::GoogleGemini3ProImage
3012 | Self::GoogleGemini31FlashLite
3013 | Self::GoogleGemini31FlashLitePreview
3014 | Self::GoogleGemini31ProPreview
3015 | Self::GoogleGemini31ProPreviewCustomtools
3016 | Self::GoogleGemini35Flash
3017 | Self::GoogleGemma431bIt
3018 | Self::IbmGraniteGranite418b
3019 | Self::InceptionMercury2
3020 | Self::InclusionaiLing261t
3021 | Self::InclusionaiLing26Flash
3022 | Self::InclusionaiRing261t
3023 | Self::KwaipilotKatCoderProV2
3024 | Self::MinimaxMinimaxM21
3025 | Self::MinimaxMinimaxM25
3026 | Self::MinimaxMinimaxM3
3027 | Self::MistralaiCodestral2508
3028 | Self::MistralaiDevstral2512
3029 | Self::MistralaiMinistral14b2512
3030 | Self::MistralaiMinistral3b2512
3031 | Self::MistralaiMinistral8b2512
3032 | Self::MistralaiMistralLarge
3033 | Self::MistralaiMistralLarge2407
3034 | Self::MistralaiMistralLarge2512
3035 | Self::MistralaiMistralMedium3
3036 | Self::MistralaiMistralMedium31
3037 | Self::MistralaiMistralSaba
3038 | Self::MistralaiMistralSmall2603
3039 | Self::MistralaiMixtral8x22bInstruct
3040 | Self::MistralaiVoxtralSmall24b2507
3041 | Self::MoonshotaiKimiK2Thinking
3042 | Self::MoonshotaiKimiK25
3043 | Self::MoonshotaiKimiK26
3044 | Self::MoonshotaiKimiK27Code
3045 | Self::NexAgiNexN2Mini
3046 | Self::NexAgiNexN2Pro
3047 | Self::NvidiaNemotron3Ultra550bA55b
3048 | Self::OpenaiGpt41
3049 | Self::OpenaiGpt41Mini
3050 | Self::OpenaiGpt41Nano
3051 | Self::OpenaiGpt4o20240806
3052 | Self::OpenaiGpt4o20241120
3053 | Self::OpenaiGpt4oMini
3054 | Self::OpenaiGpt4oMini20240718
3055 | Self::OpenaiGpt5
3056 | Self::OpenaiGpt5Codex
3057 | Self::OpenaiGpt5Mini
3058 | Self::OpenaiGpt5Nano
3059 | Self::OpenaiGpt51
3060 | Self::OpenaiGpt51Chat
3061 | Self::OpenaiGpt51Codex
3062 | Self::OpenaiGpt51CodexMax
3063 | Self::OpenaiGpt51CodexMini
3064 | Self::OpenaiGpt52
3065 | Self::OpenaiGpt52Chat
3066 | Self::OpenaiGpt52Codex
3067 | Self::OpenaiGpt53Chat
3068 | Self::OpenaiGpt53Codex
3069 | Self::OpenaiGpt54
3070 | Self::OpenaiGpt54Mini
3071 | Self::OpenaiGpt54Nano
3072 | Self::OpenaiGpt55
3073 | Self::OpenaiGptOssSafeguard20b
3074 | Self::OpenaiO1
3075 | Self::OpenaiO3
3076 | Self::OpenaiO3DeepResearch
3077 | Self::OpenaiO3Mini
3078 | Self::OpenaiO3MiniHigh
3079 | Self::OpenaiO4Mini
3080 | Self::OpenaiO4MiniDeepResearch
3081 | Self::OpenaiO4MiniHigh
3082 | Self::PoolsideLagunaM1
3083 | Self::PoolsideLagunaXs21
3084 | Self::QwenQwenPlus
3085 | Self::QwenQwenPlus20250728Thinking
3086 | Self::QwenQwen3CoderFlash
3087 | Self::QwenQwen3CoderNext
3088 | Self::QwenQwen3CoderPlus
3089 | Self::QwenQwen3Max
3090 | Self::QwenQwen3Vl235bA22bInstruct
3091 | Self::QwenQwen3535bA3b
3092 | Self::QwenQwen35397bA17b
3093 | Self::QwenQwen35Plus20260420
3094 | Self::QwenQwen3627b
3095 | Self::QwenQwen36Flash
3096 | Self::QwenQwen36MaxPreview
3097 | Self::QwenQwen36Plus
3098 | Self::QwenQwen37Max
3099 | Self::QwenQwen37Plus
3100 | Self::SakanaFuguUltra
3101 | Self::StepfunStep37Flash
3102 | Self::TencentHy3
3103 | Self::TencentHy3Preview
3104 | Self::UpstageSolarPro3
3105 | Self::XAiGrok420
3106 | Self::XAiGrok43
3107 | Self::XAiGrok45
3108 | Self::XAiGrokBuild01
3109 | Self::XiaomiMimoV25
3110 | Self::XiaomiMimoV25Pro
3111 | Self::ZAiGlm45
3112 | Self::ZAiGlm45Air
3113 | Self::ZAiGlm45v
3114 | Self::ZAiGlm46
3115 | Self::ZAiGlm46v
3116 | Self::ZAiGlm47
3117 | Self::ZAiGlm47Flash
3118 | Self::ZAiGlm5
3119 | Self::ZAiGlm5Turbo
3120 | Self::ZAiGlm51
3121 | Self::ZAiGlm52
3122 | Self::ZAiGlm5vTurbo => true,
3123 }
3124 }
3125 #[allow(clippy::too_many_lines)]
3126 pub fn supports_image(self) -> bool {
3127 match self {
3128 Self::Ai21JambaLarge17
3129 | Self::AionLabsAion20
3130 | Self::AionLabsAion30
3131 | Self::AionLabsAion30Mini
3132 | Self::AmazonNovaMicroV1
3133 | Self::ArceeAiTrinityLargeThinking
3134 | Self::ArceeAiTrinityMini
3135 | Self::ArceeAiVirtuosoLarge
3136 | Self::CohereCommandR082024
3137 | Self::CohereCommandRPlus082024
3138 | Self::CohereNorthMiniCodeFree
3139 | Self::DeepseekDeepseekChat
3140 | Self::DeepseekDeepseekChatV30324
3141 | Self::DeepseekDeepseekChatV31
3142 | Self::DeepseekDeepseekR1
3143 | Self::DeepseekDeepseekR10528
3144 | Self::DeepseekDeepseekV31Terminus
3145 | Self::DeepseekDeepseekV32
3146 | Self::DeepseekDeepseekV32Exp
3147 | Self::DeepseekDeepseekV4Flash
3148 | Self::DeepseekDeepseekV4Pro
3149 | Self::IbmGraniteGranite418b
3150 | Self::InceptionMercury2
3151 | Self::InclusionaiLing261t
3152 | Self::InclusionaiLing26Flash
3153 | Self::InclusionaiRing261t
3154 | Self::KwaipilotKatCoderProV2
3155 | Self::LiquidLfm2512bThinkingFree
3156 | Self::MetaLlamaLlama3170bInstruct
3157 | Self::MetaLlamaLlama318bInstruct
3158 | Self::MetaLlamaLlama3370bInstruct
3159 | Self::MetaLlamaLlama3370bInstructFree
3160 | Self::MinimaxMinimaxM1
3161 | Self::MinimaxMinimaxM2
3162 | Self::MinimaxMinimaxM21
3163 | Self::MinimaxMinimaxM25
3164 | Self::MinimaxMinimaxM27
3165 | Self::MistralaiCodestral2508
3166 | Self::MistralaiDevstral2512
3167 | Self::MistralaiMistralLarge
3168 | Self::MistralaiMistralLarge2407
3169 | Self::MistralaiMistralNemo
3170 | Self::MistralaiMistralSaba
3171 | Self::MistralaiMixtral8x22bInstruct
3172 | Self::MistralaiVoxtralSmall24b2507
3173 | Self::MoonshotaiKimiK2
3174 | Self::MoonshotaiKimiK20905
3175 | Self::MoonshotaiKimiK2Thinking
3176 | Self::NvidiaLlama33NemotronSuper49bV15
3177 | Self::NvidiaNemotron3Nano30bA3b
3178 | Self::NvidiaNemotron3Nano30bA3bFree
3179 | Self::NvidiaNemotron3Super120bA12b
3180 | Self::NvidiaNemotron3Super120bA12bFree
3181 | Self::NvidiaNemotron3Ultra550bA55b
3182 | Self::NvidiaNemotron3Ultra550bA55bFree
3183 | Self::NvidiaNemotronNano9bV2Free
3184 | Self::OpenaiGpt35Turbo
3185 | Self::OpenaiGpt35Turbo0613
3186 | Self::OpenaiGpt35Turbo16k
3187 | Self::OpenaiGpt4
3188 | Self::OpenaiGpt4TurboPreview
3189 | Self::OpenaiGptAudio
3190 | Self::OpenaiGptAudioMini
3191 | Self::OpenaiGptOss120b
3192 | Self::OpenaiGptOss120bFree
3193 | Self::OpenaiGptOss20b
3194 | Self::OpenaiGptOss20bFree
3195 | Self::OpenaiGptOssSafeguard20b
3196 | Self::OpenaiO3Mini
3197 | Self::OpenaiO3MiniHigh
3198 | Self::PoolsideLagunaM1
3199 | Self::PoolsideLagunaM1Free
3200 | Self::PoolsideLagunaXs21
3201 | Self::PoolsideLagunaXs21Free
3202 | Self::QwenQwen2572bInstruct
3203 | Self::QwenQwen257bInstruct
3204 | Self::QwenQwenPlus
3205 | Self::QwenQwenPlus20250728
3206 | Self::QwenQwenPlus20250728Thinking
3207 | Self::QwenQwen314b
3208 | Self::QwenQwen3235bA22b
3209 | Self::QwenQwen3235bA22b2507
3210 | Self::QwenQwen3235bA22bThinking2507
3211 | Self::QwenQwen330bA3b
3212 | Self::QwenQwen330bA3bInstruct2507
3213 | Self::QwenQwen330bA3bThinking2507
3214 | Self::QwenQwen332b
3215 | Self::QwenQwen38b
3216 | Self::QwenQwen3Coder
3217 | Self::QwenQwen3Coder30bA3bInstruct
3218 | Self::QwenQwen3CoderFlash
3219 | Self::QwenQwen3CoderNext
3220 | Self::QwenQwen3CoderPlus
3221 | Self::QwenQwen3CoderFree
3222 | Self::QwenQwen3Max
3223 | Self::QwenQwen3MaxThinking
3224 | Self::QwenQwen3Next80bA3bInstruct
3225 | Self::QwenQwen3Next80bA3bInstructFree
3226 | Self::QwenQwen3Next80bA3bThinking
3227 | Self::QwenQwen36MaxPreview
3228 | Self::QwenQwen37Max
3229 | Self::RelaceRelaceSearch
3230 | Self::Sao10kL31Euryale70b
3231 | Self::StepfunStep35Flash
3232 | Self::TencentHy3
3233 | Self::TencentHy3Preview
3234 | Self::TencentHy3Free
3235 | Self::ThedrummerUnslopnemo12b
3236 | Self::UpstageSolarPro3
3237 | Self::XiaomiMimoV25Pro
3238 | Self::ZAiGlm45
3239 | Self::ZAiGlm45Air
3240 | Self::ZAiGlm46
3241 | Self::ZAiGlm47
3242 | Self::ZAiGlm47Flash
3243 | Self::ZAiGlm5
3244 | Self::ZAiGlm5Turbo
3245 | Self::ZAiGlm51
3246 | Self::ZAiGlm52 => false,
3247 Self::AmazonNova2LiteV1
3248 | Self::AmazonNovaLiteV1
3249 | Self::AmazonNovaPremierV1
3250 | Self::AmazonNovaProV1
3251 | Self::AnthropicClaude3Haiku
3252 | Self::AnthropicClaudeFable5
3253 | Self::AnthropicClaudeHaiku45
3254 | Self::AnthropicClaudeOpus4
3255 | Self::AnthropicClaudeOpus41
3256 | Self::AnthropicClaudeOpus45
3257 | Self::AnthropicClaudeOpus46
3258 | Self::AnthropicClaudeOpus47
3259 | Self::AnthropicClaudeOpus47Fast
3260 | Self::AnthropicClaudeOpus48
3261 | Self::AnthropicClaudeOpus48Fast
3262 | Self::AnthropicClaudeSonnet4
3263 | Self::AnthropicClaudeSonnet45
3264 | Self::AnthropicClaudeSonnet46
3265 | Self::AnthropicClaudeSonnet5
3266 | Self::BytedanceSeedSeed16
3267 | Self::BytedanceSeedSeed16Flash
3268 | Self::BytedanceSeedSeed20Lite
3269 | Self::BytedanceSeedSeed20Mini
3270 | Self::GoogleGemini25Flash
3271 | Self::GoogleGemini25FlashLite
3272 | Self::GoogleGemini25Pro
3273 | Self::GoogleGemini25ProPreview
3274 | Self::GoogleGemini25ProPreview0506
3275 | Self::GoogleGemini3FlashPreview
3276 | Self::GoogleGemini3ProImage
3277 | Self::GoogleGemini31FlashLite
3278 | Self::GoogleGemini31FlashLitePreview
3279 | Self::GoogleGemini31ProPreview
3280 | Self::GoogleGemini31ProPreviewCustomtools
3281 | Self::GoogleGemini35Flash
3282 | Self::GoogleGemma312bIt
3283 | Self::GoogleGemma327bIt
3284 | Self::GoogleGemma426bA4bIt
3285 | Self::GoogleGemma426bA4bItFree
3286 | Self::GoogleGemma431bIt
3287 | Self::GoogleGemma431bItFree
3288 | Self::MetaLlamaLlama4Maverick
3289 | Self::MetaLlamaLlama4Scout
3290 | Self::MinimaxMinimaxM3
3291 | Self::MistralaiMinistral14b2512
3292 | Self::MistralaiMinistral3b2512
3293 | Self::MistralaiMinistral8b2512
3294 | Self::MistralaiMistralLarge2512
3295 | Self::MistralaiMistralMedium3
3296 | Self::MistralaiMistralMedium35
3297 | Self::MistralaiMistralMedium31
3298 | Self::MistralaiMistralSmall2603
3299 | Self::MistralaiMistralSmall3224bInstruct
3300 | Self::MoonshotaiKimiK25
3301 | Self::MoonshotaiKimiK26
3302 | Self::MoonshotaiKimiK27Code
3303 | Self::NexAgiNexN2Mini
3304 | Self::NexAgiNexN2Pro
3305 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
3306 | Self::NvidiaNemotronNano12bV2VlFree
3307 | Self::OpenaiGpt4Turbo
3308 | Self::OpenaiGpt41
3309 | Self::OpenaiGpt41Mini
3310 | Self::OpenaiGpt41Nano
3311 | Self::OpenaiGpt4o
3312 | Self::OpenaiGpt4o20240513
3313 | Self::OpenaiGpt4o20240806
3314 | Self::OpenaiGpt4o20241120
3315 | Self::OpenaiGpt4oMini
3316 | Self::OpenaiGpt4oMini20240718
3317 | Self::OpenaiGpt5
3318 | Self::OpenaiGpt5Codex
3319 | Self::OpenaiGpt5Mini
3320 | Self::OpenaiGpt5Nano
3321 | Self::OpenaiGpt5Pro
3322 | Self::OpenaiGpt51
3323 | Self::OpenaiGpt51Chat
3324 | Self::OpenaiGpt51Codex
3325 | Self::OpenaiGpt51CodexMax
3326 | Self::OpenaiGpt51CodexMini
3327 | Self::OpenaiGpt52
3328 | Self::OpenaiGpt52Chat
3329 | Self::OpenaiGpt52Codex
3330 | Self::OpenaiGpt52Pro
3331 | Self::OpenaiGpt53Chat
3332 | Self::OpenaiGpt53Codex
3333 | Self::OpenaiGpt54
3334 | Self::OpenaiGpt54Mini
3335 | Self::OpenaiGpt54Nano
3336 | Self::OpenaiGpt54Pro
3337 | Self::OpenaiGpt55
3338 | Self::OpenaiGpt55Pro
3339 | Self::OpenaiO1
3340 | Self::OpenaiO3
3341 | Self::OpenaiO3DeepResearch
3342 | Self::OpenaiO3Pro
3343 | Self::OpenaiO4Mini
3344 | Self::OpenaiO4MiniDeepResearch
3345 | Self::OpenaiO4MiniHigh
3346 | Self::OpenrouterAuto
3347 | Self::OpenrouterFree
3348 | Self::QwenQwen3Vl235bA22bInstruct
3349 | Self::QwenQwen3Vl235bA22bThinking
3350 | Self::QwenQwen3Vl30bA3bInstruct
3351 | Self::QwenQwen3Vl30bA3bThinking
3352 | Self::QwenQwen3Vl32bInstruct
3353 | Self::QwenQwen3Vl8bInstruct
3354 | Self::QwenQwen3Vl8bThinking
3355 | Self::QwenQwen35122bA10b
3356 | Self::QwenQwen3527b
3357 | Self::QwenQwen3535bA3b
3358 | Self::QwenQwen35397bA17b
3359 | Self::QwenQwen359b
3360 | Self::QwenQwen35Flash0223
3361 | Self::QwenQwen35Plus0215
3362 | Self::QwenQwen35Plus20260420
3363 | Self::QwenQwen3627b
3364 | Self::QwenQwen3635bA3b
3365 | Self::QwenQwen36Flash
3366 | Self::QwenQwen36Plus
3367 | Self::QwenQwen37Plus
3368 | Self::RekaaiRekaEdge
3369 | Self::SakanaFuguUltra
3370 | Self::StepfunStep37Flash
3371 | Self::XAiGrok420
3372 | Self::XAiGrok43
3373 | Self::XAiGrok45
3374 | Self::XAiGrokBuild01
3375 | Self::XiaomiMimoV25
3376 | Self::ZAiGlm45v
3377 | Self::ZAiGlm46v
3378 | Self::ZAiGlm5vTurbo => true,
3379 }
3380 }
3381 #[allow(clippy::too_many_lines)]
3382 pub fn supports_audio(self) -> bool {
3383 match self {
3384 Self::Ai21JambaLarge17
3385 | Self::AionLabsAion20
3386 | Self::AionLabsAion30
3387 | Self::AionLabsAion30Mini
3388 | Self::AmazonNova2LiteV1
3389 | Self::AmazonNovaLiteV1
3390 | Self::AmazonNovaMicroV1
3391 | Self::AmazonNovaPremierV1
3392 | Self::AmazonNovaProV1
3393 | Self::AnthropicClaude3Haiku
3394 | Self::AnthropicClaudeFable5
3395 | Self::AnthropicClaudeHaiku45
3396 | Self::AnthropicClaudeOpus4
3397 | Self::AnthropicClaudeOpus41
3398 | Self::AnthropicClaudeOpus45
3399 | Self::AnthropicClaudeOpus46
3400 | Self::AnthropicClaudeOpus47
3401 | Self::AnthropicClaudeOpus47Fast
3402 | Self::AnthropicClaudeOpus48
3403 | Self::AnthropicClaudeOpus48Fast
3404 | Self::AnthropicClaudeSonnet4
3405 | Self::AnthropicClaudeSonnet45
3406 | Self::AnthropicClaudeSonnet46
3407 | Self::AnthropicClaudeSonnet5
3408 | Self::ArceeAiTrinityLargeThinking
3409 | Self::ArceeAiTrinityMini
3410 | Self::ArceeAiVirtuosoLarge
3411 | Self::BytedanceSeedSeed16
3412 | Self::BytedanceSeedSeed16Flash
3413 | Self::BytedanceSeedSeed20Lite
3414 | Self::BytedanceSeedSeed20Mini
3415 | Self::CohereCommandR082024
3416 | Self::CohereCommandRPlus082024
3417 | Self::CohereNorthMiniCodeFree
3418 | Self::DeepseekDeepseekChat
3419 | Self::DeepseekDeepseekChatV30324
3420 | Self::DeepseekDeepseekChatV31
3421 | Self::DeepseekDeepseekR1
3422 | Self::DeepseekDeepseekR10528
3423 | Self::DeepseekDeepseekV31Terminus
3424 | Self::DeepseekDeepseekV32
3425 | Self::DeepseekDeepseekV32Exp
3426 | Self::DeepseekDeepseekV4Flash
3427 | Self::DeepseekDeepseekV4Pro
3428 | Self::GoogleGemini3ProImage
3429 | Self::GoogleGemma312bIt
3430 | Self::GoogleGemma327bIt
3431 | Self::GoogleGemma426bA4bIt
3432 | Self::GoogleGemma426bA4bItFree
3433 | Self::GoogleGemma431bIt
3434 | Self::GoogleGemma431bItFree
3435 | Self::IbmGraniteGranite418b
3436 | Self::InceptionMercury2
3437 | Self::InclusionaiLing261t
3438 | Self::InclusionaiLing26Flash
3439 | Self::InclusionaiRing261t
3440 | Self::KwaipilotKatCoderProV2
3441 | Self::LiquidLfm2512bThinkingFree
3442 | Self::MetaLlamaLlama3170bInstruct
3443 | Self::MetaLlamaLlama318bInstruct
3444 | Self::MetaLlamaLlama3370bInstruct
3445 | Self::MetaLlamaLlama3370bInstructFree
3446 | Self::MetaLlamaLlama4Maverick
3447 | Self::MetaLlamaLlama4Scout
3448 | Self::MinimaxMinimaxM1
3449 | Self::MinimaxMinimaxM2
3450 | Self::MinimaxMinimaxM21
3451 | Self::MinimaxMinimaxM25
3452 | Self::MinimaxMinimaxM27
3453 | Self::MinimaxMinimaxM3
3454 | Self::MistralaiCodestral2508
3455 | Self::MistralaiDevstral2512
3456 | Self::MistralaiMinistral14b2512
3457 | Self::MistralaiMinistral3b2512
3458 | Self::MistralaiMinistral8b2512
3459 | Self::MistralaiMistralLarge
3460 | Self::MistralaiMistralLarge2407
3461 | Self::MistralaiMistralLarge2512
3462 | Self::MistralaiMistralMedium3
3463 | Self::MistralaiMistralMedium35
3464 | Self::MistralaiMistralMedium31
3465 | Self::MistralaiMistralNemo
3466 | Self::MistralaiMistralSaba
3467 | Self::MistralaiMistralSmall2603
3468 | Self::MistralaiMistralSmall3224bInstruct
3469 | Self::MistralaiMixtral8x22bInstruct
3470 | Self::MoonshotaiKimiK2
3471 | Self::MoonshotaiKimiK20905
3472 | Self::MoonshotaiKimiK2Thinking
3473 | Self::MoonshotaiKimiK25
3474 | Self::MoonshotaiKimiK26
3475 | Self::MoonshotaiKimiK27Code
3476 | Self::NexAgiNexN2Mini
3477 | Self::NexAgiNexN2Pro
3478 | Self::NvidiaLlama33NemotronSuper49bV15
3479 | Self::NvidiaNemotron3Nano30bA3b
3480 | Self::NvidiaNemotron3Nano30bA3bFree
3481 | Self::NvidiaNemotron3Super120bA12b
3482 | Self::NvidiaNemotron3Super120bA12bFree
3483 | Self::NvidiaNemotron3Ultra550bA55b
3484 | Self::NvidiaNemotron3Ultra550bA55bFree
3485 | Self::NvidiaNemotronNano12bV2VlFree
3486 | Self::NvidiaNemotronNano9bV2Free
3487 | Self::OpenaiGpt35Turbo
3488 | Self::OpenaiGpt35Turbo0613
3489 | Self::OpenaiGpt35Turbo16k
3490 | Self::OpenaiGpt4
3491 | Self::OpenaiGpt4Turbo
3492 | Self::OpenaiGpt4TurboPreview
3493 | Self::OpenaiGpt41
3494 | Self::OpenaiGpt41Mini
3495 | Self::OpenaiGpt41Nano
3496 | Self::OpenaiGpt4o
3497 | Self::OpenaiGpt4o20240513
3498 | Self::OpenaiGpt4o20240806
3499 | Self::OpenaiGpt4o20241120
3500 | Self::OpenaiGpt4oMini
3501 | Self::OpenaiGpt4oMini20240718
3502 | Self::OpenaiGpt5
3503 | Self::OpenaiGpt5Codex
3504 | Self::OpenaiGpt5Mini
3505 | Self::OpenaiGpt5Nano
3506 | Self::OpenaiGpt5Pro
3507 | Self::OpenaiGpt51
3508 | Self::OpenaiGpt51Chat
3509 | Self::OpenaiGpt51Codex
3510 | Self::OpenaiGpt51CodexMax
3511 | Self::OpenaiGpt51CodexMini
3512 | Self::OpenaiGpt52
3513 | Self::OpenaiGpt52Chat
3514 | Self::OpenaiGpt52Codex
3515 | Self::OpenaiGpt52Pro
3516 | Self::OpenaiGpt53Chat
3517 | Self::OpenaiGpt53Codex
3518 | Self::OpenaiGpt54
3519 | Self::OpenaiGpt54Mini
3520 | Self::OpenaiGpt54Nano
3521 | Self::OpenaiGpt54Pro
3522 | Self::OpenaiGpt55
3523 | Self::OpenaiGpt55Pro
3524 | Self::OpenaiGptOss120b
3525 | Self::OpenaiGptOss120bFree
3526 | Self::OpenaiGptOss20b
3527 | Self::OpenaiGptOss20bFree
3528 | Self::OpenaiGptOssSafeguard20b
3529 | Self::OpenaiO1
3530 | Self::OpenaiO3
3531 | Self::OpenaiO3DeepResearch
3532 | Self::OpenaiO3Mini
3533 | Self::OpenaiO3MiniHigh
3534 | Self::OpenaiO3Pro
3535 | Self::OpenaiO4Mini
3536 | Self::OpenaiO4MiniDeepResearch
3537 | Self::OpenaiO4MiniHigh
3538 | Self::OpenrouterFree
3539 | Self::PoolsideLagunaM1
3540 | Self::PoolsideLagunaM1Free
3541 | Self::PoolsideLagunaXs21
3542 | Self::PoolsideLagunaXs21Free
3543 | Self::QwenQwen2572bInstruct
3544 | Self::QwenQwen257bInstruct
3545 | Self::QwenQwenPlus
3546 | Self::QwenQwenPlus20250728
3547 | Self::QwenQwenPlus20250728Thinking
3548 | Self::QwenQwen314b
3549 | Self::QwenQwen3235bA22b
3550 | Self::QwenQwen3235bA22b2507
3551 | Self::QwenQwen3235bA22bThinking2507
3552 | Self::QwenQwen330bA3b
3553 | Self::QwenQwen330bA3bInstruct2507
3554 | Self::QwenQwen330bA3bThinking2507
3555 | Self::QwenQwen332b
3556 | Self::QwenQwen38b
3557 | Self::QwenQwen3Coder
3558 | Self::QwenQwen3Coder30bA3bInstruct
3559 | Self::QwenQwen3CoderFlash
3560 | Self::QwenQwen3CoderNext
3561 | Self::QwenQwen3CoderPlus
3562 | Self::QwenQwen3CoderFree
3563 | Self::QwenQwen3Max
3564 | Self::QwenQwen3MaxThinking
3565 | Self::QwenQwen3Next80bA3bInstruct
3566 | Self::QwenQwen3Next80bA3bInstructFree
3567 | Self::QwenQwen3Next80bA3bThinking
3568 | Self::QwenQwen3Vl235bA22bInstruct
3569 | Self::QwenQwen3Vl235bA22bThinking
3570 | Self::QwenQwen3Vl30bA3bInstruct
3571 | Self::QwenQwen3Vl30bA3bThinking
3572 | Self::QwenQwen3Vl32bInstruct
3573 | Self::QwenQwen3Vl8bInstruct
3574 | Self::QwenQwen3Vl8bThinking
3575 | Self::QwenQwen35122bA10b
3576 | Self::QwenQwen3527b
3577 | Self::QwenQwen3535bA3b
3578 | Self::QwenQwen35397bA17b
3579 | Self::QwenQwen359b
3580 | Self::QwenQwen35Flash0223
3581 | Self::QwenQwen35Plus0215
3582 | Self::QwenQwen35Plus20260420
3583 | Self::QwenQwen3627b
3584 | Self::QwenQwen3635bA3b
3585 | Self::QwenQwen36Flash
3586 | Self::QwenQwen36MaxPreview
3587 | Self::QwenQwen36Plus
3588 | Self::QwenQwen37Max
3589 | Self::QwenQwen37Plus
3590 | Self::RekaaiRekaEdge
3591 | Self::RelaceRelaceSearch
3592 | Self::SakanaFuguUltra
3593 | Self::Sao10kL31Euryale70b
3594 | Self::StepfunStep35Flash
3595 | Self::StepfunStep37Flash
3596 | Self::TencentHy3
3597 | Self::TencentHy3Preview
3598 | Self::TencentHy3Free
3599 | Self::ThedrummerUnslopnemo12b
3600 | Self::UpstageSolarPro3
3601 | Self::XAiGrok420
3602 | Self::XAiGrok43
3603 | Self::XAiGrok45
3604 | Self::XAiGrokBuild01
3605 | Self::XiaomiMimoV25Pro
3606 | Self::ZAiGlm45
3607 | Self::ZAiGlm45Air
3608 | Self::ZAiGlm45v
3609 | Self::ZAiGlm46
3610 | Self::ZAiGlm46v
3611 | Self::ZAiGlm47
3612 | Self::ZAiGlm47Flash
3613 | Self::ZAiGlm5
3614 | Self::ZAiGlm5Turbo
3615 | Self::ZAiGlm51
3616 | Self::ZAiGlm52
3617 | Self::ZAiGlm5vTurbo => false,
3618 Self::GoogleGemini25Flash
3619 | Self::GoogleGemini25FlashLite
3620 | Self::GoogleGemini25Pro
3621 | Self::GoogleGemini25ProPreview
3622 | Self::GoogleGemini25ProPreview0506
3623 | Self::GoogleGemini3FlashPreview
3624 | Self::GoogleGemini31FlashLite
3625 | Self::GoogleGemini31FlashLitePreview
3626 | Self::GoogleGemini31ProPreview
3627 | Self::GoogleGemini31ProPreviewCustomtools
3628 | Self::GoogleGemini35Flash
3629 | Self::MistralaiVoxtralSmall24b2507
3630 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
3631 | Self::OpenaiGptAudio
3632 | Self::OpenaiGptAudioMini
3633 | Self::OpenrouterAuto
3634 | Self::XiaomiMimoV25 => true,
3635 }
3636 }
3637 const ALL: &[OpenRouterModel] = &[
3638 Self::Ai21JambaLarge17,
3639 Self::AionLabsAion20,
3640 Self::AionLabsAion30,
3641 Self::AionLabsAion30Mini,
3642 Self::AmazonNova2LiteV1,
3643 Self::AmazonNovaLiteV1,
3644 Self::AmazonNovaMicroV1,
3645 Self::AmazonNovaPremierV1,
3646 Self::AmazonNovaProV1,
3647 Self::AnthropicClaude3Haiku,
3648 Self::AnthropicClaudeFable5,
3649 Self::AnthropicClaudeHaiku45,
3650 Self::AnthropicClaudeOpus4,
3651 Self::AnthropicClaudeOpus41,
3652 Self::AnthropicClaudeOpus45,
3653 Self::AnthropicClaudeOpus46,
3654 Self::AnthropicClaudeOpus47,
3655 Self::AnthropicClaudeOpus47Fast,
3656 Self::AnthropicClaudeOpus48,
3657 Self::AnthropicClaudeOpus48Fast,
3658 Self::AnthropicClaudeSonnet4,
3659 Self::AnthropicClaudeSonnet45,
3660 Self::AnthropicClaudeSonnet46,
3661 Self::AnthropicClaudeSonnet5,
3662 Self::ArceeAiTrinityLargeThinking,
3663 Self::ArceeAiTrinityMini,
3664 Self::ArceeAiVirtuosoLarge,
3665 Self::BytedanceSeedSeed16,
3666 Self::BytedanceSeedSeed16Flash,
3667 Self::BytedanceSeedSeed20Lite,
3668 Self::BytedanceSeedSeed20Mini,
3669 Self::CohereCommandR082024,
3670 Self::CohereCommandRPlus082024,
3671 Self::CohereNorthMiniCodeFree,
3672 Self::DeepseekDeepseekChat,
3673 Self::DeepseekDeepseekChatV30324,
3674 Self::DeepseekDeepseekChatV31,
3675 Self::DeepseekDeepseekR1,
3676 Self::DeepseekDeepseekR10528,
3677 Self::DeepseekDeepseekV31Terminus,
3678 Self::DeepseekDeepseekV32,
3679 Self::DeepseekDeepseekV32Exp,
3680 Self::DeepseekDeepseekV4Flash,
3681 Self::DeepseekDeepseekV4Pro,
3682 Self::GoogleGemini25Flash,
3683 Self::GoogleGemini25FlashLite,
3684 Self::GoogleGemini25Pro,
3685 Self::GoogleGemini25ProPreview,
3686 Self::GoogleGemini25ProPreview0506,
3687 Self::GoogleGemini3FlashPreview,
3688 Self::GoogleGemini3ProImage,
3689 Self::GoogleGemini31FlashLite,
3690 Self::GoogleGemini31FlashLitePreview,
3691 Self::GoogleGemini31ProPreview,
3692 Self::GoogleGemini31ProPreviewCustomtools,
3693 Self::GoogleGemini35Flash,
3694 Self::GoogleGemma312bIt,
3695 Self::GoogleGemma327bIt,
3696 Self::GoogleGemma426bA4bIt,
3697 Self::GoogleGemma426bA4bItFree,
3698 Self::GoogleGemma431bIt,
3699 Self::GoogleGemma431bItFree,
3700 Self::IbmGraniteGranite418b,
3701 Self::InceptionMercury2,
3702 Self::InclusionaiLing261t,
3703 Self::InclusionaiLing26Flash,
3704 Self::InclusionaiRing261t,
3705 Self::KwaipilotKatCoderProV2,
3706 Self::LiquidLfm2512bThinkingFree,
3707 Self::MetaLlamaLlama3170bInstruct,
3708 Self::MetaLlamaLlama318bInstruct,
3709 Self::MetaLlamaLlama3370bInstruct,
3710 Self::MetaLlamaLlama3370bInstructFree,
3711 Self::MetaLlamaLlama4Maverick,
3712 Self::MetaLlamaLlama4Scout,
3713 Self::MinimaxMinimaxM1,
3714 Self::MinimaxMinimaxM2,
3715 Self::MinimaxMinimaxM21,
3716 Self::MinimaxMinimaxM25,
3717 Self::MinimaxMinimaxM27,
3718 Self::MinimaxMinimaxM3,
3719 Self::MistralaiCodestral2508,
3720 Self::MistralaiDevstral2512,
3721 Self::MistralaiMinistral14b2512,
3722 Self::MistralaiMinistral3b2512,
3723 Self::MistralaiMinistral8b2512,
3724 Self::MistralaiMistralLarge,
3725 Self::MistralaiMistralLarge2407,
3726 Self::MistralaiMistralLarge2512,
3727 Self::MistralaiMistralMedium3,
3728 Self::MistralaiMistralMedium35,
3729 Self::MistralaiMistralMedium31,
3730 Self::MistralaiMistralNemo,
3731 Self::MistralaiMistralSaba,
3732 Self::MistralaiMistralSmall2603,
3733 Self::MistralaiMistralSmall3224bInstruct,
3734 Self::MistralaiMixtral8x22bInstruct,
3735 Self::MistralaiVoxtralSmall24b2507,
3736 Self::MoonshotaiKimiK2,
3737 Self::MoonshotaiKimiK20905,
3738 Self::MoonshotaiKimiK2Thinking,
3739 Self::MoonshotaiKimiK25,
3740 Self::MoonshotaiKimiK26,
3741 Self::MoonshotaiKimiK27Code,
3742 Self::NexAgiNexN2Mini,
3743 Self::NexAgiNexN2Pro,
3744 Self::NvidiaLlama33NemotronSuper49bV15,
3745 Self::NvidiaNemotron3Nano30bA3b,
3746 Self::NvidiaNemotron3Nano30bA3bFree,
3747 Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree,
3748 Self::NvidiaNemotron3Super120bA12b,
3749 Self::NvidiaNemotron3Super120bA12bFree,
3750 Self::NvidiaNemotron3Ultra550bA55b,
3751 Self::NvidiaNemotron3Ultra550bA55bFree,
3752 Self::NvidiaNemotronNano12bV2VlFree,
3753 Self::NvidiaNemotronNano9bV2Free,
3754 Self::OpenaiGpt35Turbo,
3755 Self::OpenaiGpt35Turbo0613,
3756 Self::OpenaiGpt35Turbo16k,
3757 Self::OpenaiGpt4,
3758 Self::OpenaiGpt4Turbo,
3759 Self::OpenaiGpt4TurboPreview,
3760 Self::OpenaiGpt41,
3761 Self::OpenaiGpt41Mini,
3762 Self::OpenaiGpt41Nano,
3763 Self::OpenaiGpt4o,
3764 Self::OpenaiGpt4o20240513,
3765 Self::OpenaiGpt4o20240806,
3766 Self::OpenaiGpt4o20241120,
3767 Self::OpenaiGpt4oMini,
3768 Self::OpenaiGpt4oMini20240718,
3769 Self::OpenaiGpt5,
3770 Self::OpenaiGpt5Codex,
3771 Self::OpenaiGpt5Mini,
3772 Self::OpenaiGpt5Nano,
3773 Self::OpenaiGpt5Pro,
3774 Self::OpenaiGpt51,
3775 Self::OpenaiGpt51Chat,
3776 Self::OpenaiGpt51Codex,
3777 Self::OpenaiGpt51CodexMax,
3778 Self::OpenaiGpt51CodexMini,
3779 Self::OpenaiGpt52,
3780 Self::OpenaiGpt52Chat,
3781 Self::OpenaiGpt52Codex,
3782 Self::OpenaiGpt52Pro,
3783 Self::OpenaiGpt53Chat,
3784 Self::OpenaiGpt53Codex,
3785 Self::OpenaiGpt54,
3786 Self::OpenaiGpt54Mini,
3787 Self::OpenaiGpt54Nano,
3788 Self::OpenaiGpt54Pro,
3789 Self::OpenaiGpt55,
3790 Self::OpenaiGpt55Pro,
3791 Self::OpenaiGptAudio,
3792 Self::OpenaiGptAudioMini,
3793 Self::OpenaiGptOss120b,
3794 Self::OpenaiGptOss120bFree,
3795 Self::OpenaiGptOss20b,
3796 Self::OpenaiGptOss20bFree,
3797 Self::OpenaiGptOssSafeguard20b,
3798 Self::OpenaiO1,
3799 Self::OpenaiO3,
3800 Self::OpenaiO3DeepResearch,
3801 Self::OpenaiO3Mini,
3802 Self::OpenaiO3MiniHigh,
3803 Self::OpenaiO3Pro,
3804 Self::OpenaiO4Mini,
3805 Self::OpenaiO4MiniDeepResearch,
3806 Self::OpenaiO4MiniHigh,
3807 Self::OpenrouterAuto,
3808 Self::OpenrouterFree,
3809 Self::PoolsideLagunaM1,
3810 Self::PoolsideLagunaM1Free,
3811 Self::PoolsideLagunaXs21,
3812 Self::PoolsideLagunaXs21Free,
3813 Self::QwenQwen2572bInstruct,
3814 Self::QwenQwen257bInstruct,
3815 Self::QwenQwenPlus,
3816 Self::QwenQwenPlus20250728,
3817 Self::QwenQwenPlus20250728Thinking,
3818 Self::QwenQwen314b,
3819 Self::QwenQwen3235bA22b,
3820 Self::QwenQwen3235bA22b2507,
3821 Self::QwenQwen3235bA22bThinking2507,
3822 Self::QwenQwen330bA3b,
3823 Self::QwenQwen330bA3bInstruct2507,
3824 Self::QwenQwen330bA3bThinking2507,
3825 Self::QwenQwen332b,
3826 Self::QwenQwen38b,
3827 Self::QwenQwen3Coder,
3828 Self::QwenQwen3Coder30bA3bInstruct,
3829 Self::QwenQwen3CoderFlash,
3830 Self::QwenQwen3CoderNext,
3831 Self::QwenQwen3CoderPlus,
3832 Self::QwenQwen3CoderFree,
3833 Self::QwenQwen3Max,
3834 Self::QwenQwen3MaxThinking,
3835 Self::QwenQwen3Next80bA3bInstruct,
3836 Self::QwenQwen3Next80bA3bInstructFree,
3837 Self::QwenQwen3Next80bA3bThinking,
3838 Self::QwenQwen3Vl235bA22bInstruct,
3839 Self::QwenQwen3Vl235bA22bThinking,
3840 Self::QwenQwen3Vl30bA3bInstruct,
3841 Self::QwenQwen3Vl30bA3bThinking,
3842 Self::QwenQwen3Vl32bInstruct,
3843 Self::QwenQwen3Vl8bInstruct,
3844 Self::QwenQwen3Vl8bThinking,
3845 Self::QwenQwen35122bA10b,
3846 Self::QwenQwen3527b,
3847 Self::QwenQwen3535bA3b,
3848 Self::QwenQwen35397bA17b,
3849 Self::QwenQwen359b,
3850 Self::QwenQwen35Flash0223,
3851 Self::QwenQwen35Plus0215,
3852 Self::QwenQwen35Plus20260420,
3853 Self::QwenQwen3627b,
3854 Self::QwenQwen3635bA3b,
3855 Self::QwenQwen36Flash,
3856 Self::QwenQwen36MaxPreview,
3857 Self::QwenQwen36Plus,
3858 Self::QwenQwen37Max,
3859 Self::QwenQwen37Plus,
3860 Self::RekaaiRekaEdge,
3861 Self::RelaceRelaceSearch,
3862 Self::SakanaFuguUltra,
3863 Self::Sao10kL31Euryale70b,
3864 Self::StepfunStep35Flash,
3865 Self::StepfunStep37Flash,
3866 Self::TencentHy3,
3867 Self::TencentHy3Preview,
3868 Self::TencentHy3Free,
3869 Self::ThedrummerUnslopnemo12b,
3870 Self::UpstageSolarPro3,
3871 Self::XAiGrok420,
3872 Self::XAiGrok43,
3873 Self::XAiGrok45,
3874 Self::XAiGrokBuild01,
3875 Self::XiaomiMimoV25,
3876 Self::XiaomiMimoV25Pro,
3877 Self::ZAiGlm45,
3878 Self::ZAiGlm45Air,
3879 Self::ZAiGlm45v,
3880 Self::ZAiGlm46,
3881 Self::ZAiGlm46v,
3882 Self::ZAiGlm47,
3883 Self::ZAiGlm47Flash,
3884 Self::ZAiGlm5,
3885 Self::ZAiGlm5Turbo,
3886 Self::ZAiGlm51,
3887 Self::ZAiGlm52,
3888 Self::ZAiGlm5vTurbo,
3889 ];
3890}
3891impl std::str::FromStr for OpenRouterModel {
3892 type Err = String;
3893 #[allow(clippy::too_many_lines)]
3894 fn from_str(s: &str) -> Result<Self, Self::Err> {
3895 match s {
3896 "ai21/jamba-large-1.7" => Ok(Self::Ai21JambaLarge17),
3897 "aion-labs/aion-2.0" => Ok(Self::AionLabsAion20),
3898 "aion-labs/aion-3.0" => Ok(Self::AionLabsAion30),
3899 "aion-labs/aion-3.0-mini" => Ok(Self::AionLabsAion30Mini),
3900 "amazon/nova-2-lite-v1" => Ok(Self::AmazonNova2LiteV1),
3901 "amazon/nova-lite-v1" => Ok(Self::AmazonNovaLiteV1),
3902 "amazon/nova-micro-v1" => Ok(Self::AmazonNovaMicroV1),
3903 "amazon/nova-premier-v1" => Ok(Self::AmazonNovaPremierV1),
3904 "amazon/nova-pro-v1" => Ok(Self::AmazonNovaProV1),
3905 "anthropic/claude-3-haiku" => Ok(Self::AnthropicClaude3Haiku),
3906 "anthropic/claude-fable-5" => Ok(Self::AnthropicClaudeFable5),
3907 "anthropic/claude-haiku-4.5" => Ok(Self::AnthropicClaudeHaiku45),
3908 "anthropic/claude-opus-4" => Ok(Self::AnthropicClaudeOpus4),
3909 "anthropic/claude-opus-4.1" => Ok(Self::AnthropicClaudeOpus41),
3910 "anthropic/claude-opus-4.5" => Ok(Self::AnthropicClaudeOpus45),
3911 "anthropic/claude-opus-4.6" => Ok(Self::AnthropicClaudeOpus46),
3912 "anthropic/claude-opus-4.7" => Ok(Self::AnthropicClaudeOpus47),
3913 "anthropic/claude-opus-4.7-fast" => Ok(Self::AnthropicClaudeOpus47Fast),
3914 "anthropic/claude-opus-4.8" => Ok(Self::AnthropicClaudeOpus48),
3915 "anthropic/claude-opus-4.8-fast" => Ok(Self::AnthropicClaudeOpus48Fast),
3916 "anthropic/claude-sonnet-4" => Ok(Self::AnthropicClaudeSonnet4),
3917 "anthropic/claude-sonnet-4.5" => Ok(Self::AnthropicClaudeSonnet45),
3918 "anthropic/claude-sonnet-4.6" => Ok(Self::AnthropicClaudeSonnet46),
3919 "anthropic/claude-sonnet-5" => Ok(Self::AnthropicClaudeSonnet5),
3920 "arcee-ai/trinity-large-thinking" => Ok(Self::ArceeAiTrinityLargeThinking),
3921 "arcee-ai/trinity-mini" => Ok(Self::ArceeAiTrinityMini),
3922 "arcee-ai/virtuoso-large" => Ok(Self::ArceeAiVirtuosoLarge),
3923 "bytedance-seed/seed-1.6" => Ok(Self::BytedanceSeedSeed16),
3924 "bytedance-seed/seed-1.6-flash" => Ok(Self::BytedanceSeedSeed16Flash),
3925 "bytedance-seed/seed-2.0-lite" => Ok(Self::BytedanceSeedSeed20Lite),
3926 "bytedance-seed/seed-2.0-mini" => Ok(Self::BytedanceSeedSeed20Mini),
3927 "cohere/command-r-08-2024" => Ok(Self::CohereCommandR082024),
3928 "cohere/command-r-plus-08-2024" => Ok(Self::CohereCommandRPlus082024),
3929 "cohere/north-mini-code:free" => Ok(Self::CohereNorthMiniCodeFree),
3930 "deepseek/deepseek-chat" => Ok(Self::DeepseekDeepseekChat),
3931 "deepseek/deepseek-chat-v3-0324" => Ok(Self::DeepseekDeepseekChatV30324),
3932 "deepseek/deepseek-chat-v3.1" => Ok(Self::DeepseekDeepseekChatV31),
3933 "deepseek/deepseek-r1" => Ok(Self::DeepseekDeepseekR1),
3934 "deepseek/deepseek-r1-0528" => Ok(Self::DeepseekDeepseekR10528),
3935 "deepseek/deepseek-v3.1-terminus" => Ok(Self::DeepseekDeepseekV31Terminus),
3936 "deepseek/deepseek-v3.2" => Ok(Self::DeepseekDeepseekV32),
3937 "deepseek/deepseek-v3.2-exp" => Ok(Self::DeepseekDeepseekV32Exp),
3938 "deepseek/deepseek-v4-flash" => Ok(Self::DeepseekDeepseekV4Flash),
3939 "deepseek/deepseek-v4-pro" => Ok(Self::DeepseekDeepseekV4Pro),
3940 "google/gemini-2.5-flash" => Ok(Self::GoogleGemini25Flash),
3941 "google/gemini-2.5-flash-lite" => Ok(Self::GoogleGemini25FlashLite),
3942 "google/gemini-2.5-pro" => Ok(Self::GoogleGemini25Pro),
3943 "google/gemini-2.5-pro-preview" => Ok(Self::GoogleGemini25ProPreview),
3944 "google/gemini-2.5-pro-preview-05-06" => {
3945 Ok(Self::GoogleGemini25ProPreview0506)
3946 }
3947 "google/gemini-3-flash-preview" => Ok(Self::GoogleGemini3FlashPreview),
3948 "google/gemini-3-pro-image" => Ok(Self::GoogleGemini3ProImage),
3949 "google/gemini-3.1-flash-lite" => Ok(Self::GoogleGemini31FlashLite),
3950 "google/gemini-3.1-flash-lite-preview" => {
3951 Ok(Self::GoogleGemini31FlashLitePreview)
3952 }
3953 "google/gemini-3.1-pro-preview" => Ok(Self::GoogleGemini31ProPreview),
3954 "google/gemini-3.1-pro-preview-customtools" => {
3955 Ok(Self::GoogleGemini31ProPreviewCustomtools)
3956 }
3957 "google/gemini-3.5-flash" => Ok(Self::GoogleGemini35Flash),
3958 "google/gemma-3-12b-it" => Ok(Self::GoogleGemma312bIt),
3959 "google/gemma-3-27b-it" => Ok(Self::GoogleGemma327bIt),
3960 "google/gemma-4-26b-a4b-it" => Ok(Self::GoogleGemma426bA4bIt),
3961 "google/gemma-4-26b-a4b-it:free" => Ok(Self::GoogleGemma426bA4bItFree),
3962 "google/gemma-4-31b-it" => Ok(Self::GoogleGemma431bIt),
3963 "google/gemma-4-31b-it:free" => Ok(Self::GoogleGemma431bItFree),
3964 "ibm-granite/granite-4.1-8b" => Ok(Self::IbmGraniteGranite418b),
3965 "inception/mercury-2" => Ok(Self::InceptionMercury2),
3966 "inclusionai/ling-2.6-1t" => Ok(Self::InclusionaiLing261t),
3967 "inclusionai/ling-2.6-flash" => Ok(Self::InclusionaiLing26Flash),
3968 "inclusionai/ring-2.6-1t" => Ok(Self::InclusionaiRing261t),
3969 "kwaipilot/kat-coder-pro-v2" => Ok(Self::KwaipilotKatCoderProV2),
3970 "liquid/lfm-2.5-1.2b-thinking:free" => Ok(Self::LiquidLfm2512bThinkingFree),
3971 "meta-llama/llama-3.1-70b-instruct" => Ok(Self::MetaLlamaLlama3170bInstruct),
3972 "meta-llama/llama-3.1-8b-instruct" => Ok(Self::MetaLlamaLlama318bInstruct),
3973 "meta-llama/llama-3.3-70b-instruct" => Ok(Self::MetaLlamaLlama3370bInstruct),
3974 "meta-llama/llama-3.3-70b-instruct:free" => {
3975 Ok(Self::MetaLlamaLlama3370bInstructFree)
3976 }
3977 "meta-llama/llama-4-maverick" => Ok(Self::MetaLlamaLlama4Maverick),
3978 "meta-llama/llama-4-scout" => Ok(Self::MetaLlamaLlama4Scout),
3979 "minimax/minimax-m1" => Ok(Self::MinimaxMinimaxM1),
3980 "minimax/minimax-m2" => Ok(Self::MinimaxMinimaxM2),
3981 "minimax/minimax-m2.1" => Ok(Self::MinimaxMinimaxM21),
3982 "minimax/minimax-m2.5" => Ok(Self::MinimaxMinimaxM25),
3983 "minimax/minimax-m2.7" => Ok(Self::MinimaxMinimaxM27),
3984 "minimax/minimax-m3" => Ok(Self::MinimaxMinimaxM3),
3985 "mistralai/codestral-2508" => Ok(Self::MistralaiCodestral2508),
3986 "mistralai/devstral-2512" => Ok(Self::MistralaiDevstral2512),
3987 "mistralai/ministral-14b-2512" => Ok(Self::MistralaiMinistral14b2512),
3988 "mistralai/ministral-3b-2512" => Ok(Self::MistralaiMinistral3b2512),
3989 "mistralai/ministral-8b-2512" => Ok(Self::MistralaiMinistral8b2512),
3990 "mistralai/mistral-large" => Ok(Self::MistralaiMistralLarge),
3991 "mistralai/mistral-large-2407" => Ok(Self::MistralaiMistralLarge2407),
3992 "mistralai/mistral-large-2512" => Ok(Self::MistralaiMistralLarge2512),
3993 "mistralai/mistral-medium-3" => Ok(Self::MistralaiMistralMedium3),
3994 "mistralai/mistral-medium-3-5" => Ok(Self::MistralaiMistralMedium35),
3995 "mistralai/mistral-medium-3.1" => Ok(Self::MistralaiMistralMedium31),
3996 "mistralai/mistral-nemo" => Ok(Self::MistralaiMistralNemo),
3997 "mistralai/mistral-saba" => Ok(Self::MistralaiMistralSaba),
3998 "mistralai/mistral-small-2603" => Ok(Self::MistralaiMistralSmall2603),
3999 "mistralai/mistral-small-3.2-24b-instruct" => {
4000 Ok(Self::MistralaiMistralSmall3224bInstruct)
4001 }
4002 "mistralai/mixtral-8x22b-instruct" => Ok(Self::MistralaiMixtral8x22bInstruct),
4003 "mistralai/voxtral-small-24b-2507" => Ok(Self::MistralaiVoxtralSmall24b2507),
4004 "moonshotai/kimi-k2" => Ok(Self::MoonshotaiKimiK2),
4005 "moonshotai/kimi-k2-0905" => Ok(Self::MoonshotaiKimiK20905),
4006 "moonshotai/kimi-k2-thinking" => Ok(Self::MoonshotaiKimiK2Thinking),
4007 "moonshotai/kimi-k2.5" => Ok(Self::MoonshotaiKimiK25),
4008 "moonshotai/kimi-k2.6" => Ok(Self::MoonshotaiKimiK26),
4009 "moonshotai/kimi-k2.7-code" => Ok(Self::MoonshotaiKimiK27Code),
4010 "nex-agi/nex-n2-mini" => Ok(Self::NexAgiNexN2Mini),
4011 "nex-agi/nex-n2-pro" => Ok(Self::NexAgiNexN2Pro),
4012 "nvidia/llama-3.3-nemotron-super-49b-v1.5" => {
4013 Ok(Self::NvidiaLlama33NemotronSuper49bV15)
4014 }
4015 "nvidia/nemotron-3-nano-30b-a3b" => Ok(Self::NvidiaNemotron3Nano30bA3b),
4016 "nvidia/nemotron-3-nano-30b-a3b:free" => {
4017 Ok(Self::NvidiaNemotron3Nano30bA3bFree)
4018 }
4019 "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free" => {
4020 Ok(Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree)
4021 }
4022 "nvidia/nemotron-3-super-120b-a12b" => Ok(Self::NvidiaNemotron3Super120bA12b),
4023 "nvidia/nemotron-3-super-120b-a12b:free" => {
4024 Ok(Self::NvidiaNemotron3Super120bA12bFree)
4025 }
4026 "nvidia/nemotron-3-ultra-550b-a55b" => Ok(Self::NvidiaNemotron3Ultra550bA55b),
4027 "nvidia/nemotron-3-ultra-550b-a55b:free" => {
4028 Ok(Self::NvidiaNemotron3Ultra550bA55bFree)
4029 }
4030 "nvidia/nemotron-nano-12b-v2-vl:free" => {
4031 Ok(Self::NvidiaNemotronNano12bV2VlFree)
4032 }
4033 "nvidia/nemotron-nano-9b-v2:free" => Ok(Self::NvidiaNemotronNano9bV2Free),
4034 "openai/gpt-3.5-turbo" => Ok(Self::OpenaiGpt35Turbo),
4035 "openai/gpt-3.5-turbo-0613" => Ok(Self::OpenaiGpt35Turbo0613),
4036 "openai/gpt-3.5-turbo-16k" => Ok(Self::OpenaiGpt35Turbo16k),
4037 "openai/gpt-4" => Ok(Self::OpenaiGpt4),
4038 "openai/gpt-4-turbo" => Ok(Self::OpenaiGpt4Turbo),
4039 "openai/gpt-4-turbo-preview" => Ok(Self::OpenaiGpt4TurboPreview),
4040 "openai/gpt-4.1" => Ok(Self::OpenaiGpt41),
4041 "openai/gpt-4.1-mini" => Ok(Self::OpenaiGpt41Mini),
4042 "openai/gpt-4.1-nano" => Ok(Self::OpenaiGpt41Nano),
4043 "openai/gpt-4o" => Ok(Self::OpenaiGpt4o),
4044 "openai/gpt-4o-2024-05-13" => Ok(Self::OpenaiGpt4o20240513),
4045 "openai/gpt-4o-2024-08-06" => Ok(Self::OpenaiGpt4o20240806),
4046 "openai/gpt-4o-2024-11-20" => Ok(Self::OpenaiGpt4o20241120),
4047 "openai/gpt-4o-mini" => Ok(Self::OpenaiGpt4oMini),
4048 "openai/gpt-4o-mini-2024-07-18" => Ok(Self::OpenaiGpt4oMini20240718),
4049 "openai/gpt-5" => Ok(Self::OpenaiGpt5),
4050 "openai/gpt-5-codex" => Ok(Self::OpenaiGpt5Codex),
4051 "openai/gpt-5-mini" => Ok(Self::OpenaiGpt5Mini),
4052 "openai/gpt-5-nano" => Ok(Self::OpenaiGpt5Nano),
4053 "openai/gpt-5-pro" => Ok(Self::OpenaiGpt5Pro),
4054 "openai/gpt-5.1" => Ok(Self::OpenaiGpt51),
4055 "openai/gpt-5.1-chat" => Ok(Self::OpenaiGpt51Chat),
4056 "openai/gpt-5.1-codex" => Ok(Self::OpenaiGpt51Codex),
4057 "openai/gpt-5.1-codex-max" => Ok(Self::OpenaiGpt51CodexMax),
4058 "openai/gpt-5.1-codex-mini" => Ok(Self::OpenaiGpt51CodexMini),
4059 "openai/gpt-5.2" => Ok(Self::OpenaiGpt52),
4060 "openai/gpt-5.2-chat" => Ok(Self::OpenaiGpt52Chat),
4061 "openai/gpt-5.2-codex" => Ok(Self::OpenaiGpt52Codex),
4062 "openai/gpt-5.2-pro" => Ok(Self::OpenaiGpt52Pro),
4063 "openai/gpt-5.3-chat" => Ok(Self::OpenaiGpt53Chat),
4064 "openai/gpt-5.3-codex" => Ok(Self::OpenaiGpt53Codex),
4065 "openai/gpt-5.4" => Ok(Self::OpenaiGpt54),
4066 "openai/gpt-5.4-mini" => Ok(Self::OpenaiGpt54Mini),
4067 "openai/gpt-5.4-nano" => Ok(Self::OpenaiGpt54Nano),
4068 "openai/gpt-5.4-pro" => Ok(Self::OpenaiGpt54Pro),
4069 "openai/gpt-5.5" => Ok(Self::OpenaiGpt55),
4070 "openai/gpt-5.5-pro" => Ok(Self::OpenaiGpt55Pro),
4071 "openai/gpt-audio" => Ok(Self::OpenaiGptAudio),
4072 "openai/gpt-audio-mini" => Ok(Self::OpenaiGptAudioMini),
4073 "openai/gpt-oss-120b" => Ok(Self::OpenaiGptOss120b),
4074 "openai/gpt-oss-120b:free" => Ok(Self::OpenaiGptOss120bFree),
4075 "openai/gpt-oss-20b" => Ok(Self::OpenaiGptOss20b),
4076 "openai/gpt-oss-20b:free" => Ok(Self::OpenaiGptOss20bFree),
4077 "openai/gpt-oss-safeguard-20b" => Ok(Self::OpenaiGptOssSafeguard20b),
4078 "openai/o1" => Ok(Self::OpenaiO1),
4079 "openai/o3" => Ok(Self::OpenaiO3),
4080 "openai/o3-deep-research" => Ok(Self::OpenaiO3DeepResearch),
4081 "openai/o3-mini" => Ok(Self::OpenaiO3Mini),
4082 "openai/o3-mini-high" => Ok(Self::OpenaiO3MiniHigh),
4083 "openai/o3-pro" => Ok(Self::OpenaiO3Pro),
4084 "openai/o4-mini" => Ok(Self::OpenaiO4Mini),
4085 "openai/o4-mini-deep-research" => Ok(Self::OpenaiO4MiniDeepResearch),
4086 "openai/o4-mini-high" => Ok(Self::OpenaiO4MiniHigh),
4087 "openrouter/auto" => Ok(Self::OpenrouterAuto),
4088 "openrouter/free" => Ok(Self::OpenrouterFree),
4089 "poolside/laguna-m.1" => Ok(Self::PoolsideLagunaM1),
4090 "poolside/laguna-m.1:free" => Ok(Self::PoolsideLagunaM1Free),
4091 "poolside/laguna-xs-2.1" => Ok(Self::PoolsideLagunaXs21),
4092 "poolside/laguna-xs-2.1:free" => Ok(Self::PoolsideLagunaXs21Free),
4093 "qwen/qwen-2.5-72b-instruct" => Ok(Self::QwenQwen2572bInstruct),
4094 "qwen/qwen-2.5-7b-instruct" => Ok(Self::QwenQwen257bInstruct),
4095 "qwen/qwen-plus" => Ok(Self::QwenQwenPlus),
4096 "qwen/qwen-plus-2025-07-28" => Ok(Self::QwenQwenPlus20250728),
4097 "qwen/qwen-plus-2025-07-28:thinking" => {
4098 Ok(Self::QwenQwenPlus20250728Thinking)
4099 }
4100 "qwen/qwen3-14b" => Ok(Self::QwenQwen314b),
4101 "qwen/qwen3-235b-a22b" => Ok(Self::QwenQwen3235bA22b),
4102 "qwen/qwen3-235b-a22b-2507" => Ok(Self::QwenQwen3235bA22b2507),
4103 "qwen/qwen3-235b-a22b-thinking-2507" => {
4104 Ok(Self::QwenQwen3235bA22bThinking2507)
4105 }
4106 "qwen/qwen3-30b-a3b" => Ok(Self::QwenQwen330bA3b),
4107 "qwen/qwen3-30b-a3b-instruct-2507" => Ok(Self::QwenQwen330bA3bInstruct2507),
4108 "qwen/qwen3-30b-a3b-thinking-2507" => Ok(Self::QwenQwen330bA3bThinking2507),
4109 "qwen/qwen3-32b" => Ok(Self::QwenQwen332b),
4110 "qwen/qwen3-8b" => Ok(Self::QwenQwen38b),
4111 "qwen/qwen3-coder" => Ok(Self::QwenQwen3Coder),
4112 "qwen/qwen3-coder-30b-a3b-instruct" => Ok(Self::QwenQwen3Coder30bA3bInstruct),
4113 "qwen/qwen3-coder-flash" => Ok(Self::QwenQwen3CoderFlash),
4114 "qwen/qwen3-coder-next" => Ok(Self::QwenQwen3CoderNext),
4115 "qwen/qwen3-coder-plus" => Ok(Self::QwenQwen3CoderPlus),
4116 "qwen/qwen3-coder:free" => Ok(Self::QwenQwen3CoderFree),
4117 "qwen/qwen3-max" => Ok(Self::QwenQwen3Max),
4118 "qwen/qwen3-max-thinking" => Ok(Self::QwenQwen3MaxThinking),
4119 "qwen/qwen3-next-80b-a3b-instruct" => Ok(Self::QwenQwen3Next80bA3bInstruct),
4120 "qwen/qwen3-next-80b-a3b-instruct:free" => {
4121 Ok(Self::QwenQwen3Next80bA3bInstructFree)
4122 }
4123 "qwen/qwen3-next-80b-a3b-thinking" => Ok(Self::QwenQwen3Next80bA3bThinking),
4124 "qwen/qwen3-vl-235b-a22b-instruct" => Ok(Self::QwenQwen3Vl235bA22bInstruct),
4125 "qwen/qwen3-vl-235b-a22b-thinking" => Ok(Self::QwenQwen3Vl235bA22bThinking),
4126 "qwen/qwen3-vl-30b-a3b-instruct" => Ok(Self::QwenQwen3Vl30bA3bInstruct),
4127 "qwen/qwen3-vl-30b-a3b-thinking" => Ok(Self::QwenQwen3Vl30bA3bThinking),
4128 "qwen/qwen3-vl-32b-instruct" => Ok(Self::QwenQwen3Vl32bInstruct),
4129 "qwen/qwen3-vl-8b-instruct" => Ok(Self::QwenQwen3Vl8bInstruct),
4130 "qwen/qwen3-vl-8b-thinking" => Ok(Self::QwenQwen3Vl8bThinking),
4131 "qwen/qwen3.5-122b-a10b" => Ok(Self::QwenQwen35122bA10b),
4132 "qwen/qwen3.5-27b" => Ok(Self::QwenQwen3527b),
4133 "qwen/qwen3.5-35b-a3b" => Ok(Self::QwenQwen3535bA3b),
4134 "qwen/qwen3.5-397b-a17b" => Ok(Self::QwenQwen35397bA17b),
4135 "qwen/qwen3.5-9b" => Ok(Self::QwenQwen359b),
4136 "qwen/qwen3.5-flash-02-23" => Ok(Self::QwenQwen35Flash0223),
4137 "qwen/qwen3.5-plus-02-15" => Ok(Self::QwenQwen35Plus0215),
4138 "qwen/qwen3.5-plus-20260420" => Ok(Self::QwenQwen35Plus20260420),
4139 "qwen/qwen3.6-27b" => Ok(Self::QwenQwen3627b),
4140 "qwen/qwen3.6-35b-a3b" => Ok(Self::QwenQwen3635bA3b),
4141 "qwen/qwen3.6-flash" => Ok(Self::QwenQwen36Flash),
4142 "qwen/qwen3.6-max-preview" => Ok(Self::QwenQwen36MaxPreview),
4143 "qwen/qwen3.6-plus" => Ok(Self::QwenQwen36Plus),
4144 "qwen/qwen3.7-max" => Ok(Self::QwenQwen37Max),
4145 "qwen/qwen3.7-plus" => Ok(Self::QwenQwen37Plus),
4146 "rekaai/reka-edge" => Ok(Self::RekaaiRekaEdge),
4147 "relace/relace-search" => Ok(Self::RelaceRelaceSearch),
4148 "sakana/fugu-ultra" => Ok(Self::SakanaFuguUltra),
4149 "sao10k/l3.1-euryale-70b" => Ok(Self::Sao10kL31Euryale70b),
4150 "stepfun/step-3.5-flash" => Ok(Self::StepfunStep35Flash),
4151 "stepfun/step-3.7-flash" => Ok(Self::StepfunStep37Flash),
4152 "tencent/hy3" => Ok(Self::TencentHy3),
4153 "tencent/hy3-preview" => Ok(Self::TencentHy3Preview),
4154 "tencent/hy3:free" => Ok(Self::TencentHy3Free),
4155 "thedrummer/unslopnemo-12b" => Ok(Self::ThedrummerUnslopnemo12b),
4156 "upstage/solar-pro-3" => Ok(Self::UpstageSolarPro3),
4157 "x-ai/grok-4.20" => Ok(Self::XAiGrok420),
4158 "x-ai/grok-4.3" => Ok(Self::XAiGrok43),
4159 "x-ai/grok-4.5" => Ok(Self::XAiGrok45),
4160 "x-ai/grok-build-0.1" => Ok(Self::XAiGrokBuild01),
4161 "xiaomi/mimo-v2.5" => Ok(Self::XiaomiMimoV25),
4162 "xiaomi/mimo-v2.5-pro" => Ok(Self::XiaomiMimoV25Pro),
4163 "z-ai/glm-4.5" => Ok(Self::ZAiGlm45),
4164 "z-ai/glm-4.5-air" => Ok(Self::ZAiGlm45Air),
4165 "z-ai/glm-4.5v" => Ok(Self::ZAiGlm45v),
4166 "z-ai/glm-4.6" => Ok(Self::ZAiGlm46),
4167 "z-ai/glm-4.6v" => Ok(Self::ZAiGlm46v),
4168 "z-ai/glm-4.7" => Ok(Self::ZAiGlm47),
4169 "z-ai/glm-4.7-flash" => Ok(Self::ZAiGlm47Flash),
4170 "z-ai/glm-5" => Ok(Self::ZAiGlm5),
4171 "z-ai/glm-5-turbo" => Ok(Self::ZAiGlm5Turbo),
4172 "z-ai/glm-5.1" => Ok(Self::ZAiGlm51),
4173 "z-ai/glm-5.2" => Ok(Self::ZAiGlm52),
4174 "z-ai/glm-5v-turbo" => Ok(Self::ZAiGlm5vTurbo),
4175 _ => Err(format!("Unknown openrouter model: '{s}'")),
4176 }
4177 }
4178}
4179impl ZAiModel {
4180 #[allow(clippy::too_many_lines)]
4181 fn model_id(self) -> &'static str {
4182 match self {
4183 Self::Glm45 => "glm-4.5",
4184 Self::Glm45Air => "glm-4.5-air",
4185 Self::Glm45Flash => "glm-4.5-flash",
4186 Self::Glm45v => "glm-4.5v",
4187 Self::Glm46 => "glm-4.6",
4188 Self::Glm46v => "glm-4.6v",
4189 Self::Glm47 => "glm-4.7",
4190 Self::Glm47Flash => "glm-4.7-flash",
4191 Self::Glm47Flashx => "glm-4.7-flashx",
4192 Self::Glm5 => "glm-5",
4193 Self::Glm5Turbo => "glm-5-turbo",
4194 Self::Glm51 => "glm-5.1",
4195 Self::Glm52 => "glm-5.2",
4196 Self::Glm5vTurbo => "glm-5v-turbo",
4197 }
4198 }
4199 #[allow(clippy::too_many_lines)]
4200 fn display_name(self) -> &'static str {
4201 match self {
4202 Self::Glm45 => "GLM-4.5",
4203 Self::Glm45Air => "GLM-4.5-Air",
4204 Self::Glm45Flash => "GLM-4.5-Flash",
4205 Self::Glm45v => "GLM-4.5V",
4206 Self::Glm46 => "GLM-4.6",
4207 Self::Glm46v => "GLM-4.6V",
4208 Self::Glm47 => "GLM-4.7",
4209 Self::Glm47Flash => "GLM-4.7-Flash",
4210 Self::Glm47Flashx => "GLM-4.7-FlashX",
4211 Self::Glm5 => "GLM-5",
4212 Self::Glm5Turbo => "GLM-5-Turbo",
4213 Self::Glm51 => "GLM-5.1",
4214 Self::Glm52 => "GLM-5.2",
4215 Self::Glm5vTurbo => "GLM-5V-Turbo",
4216 }
4217 }
4218 #[allow(clippy::too_many_lines)]
4219 fn context_window(self) -> u32 {
4220 match self {
4221 Self::Glm45v => 64_000,
4222 Self::Glm46v => 128_000,
4223 Self::Glm45 | Self::Glm45Air | Self::Glm45Flash => 131_072,
4224 Self::Glm47Flash
4225 | Self::Glm47Flashx
4226 | Self::Glm5Turbo
4227 | Self::Glm51
4228 | Self::Glm5vTurbo => 200_000,
4229 Self::Glm46 | Self::Glm47 | Self::Glm5 => 204_800,
4230 Self::Glm52 => 1_000_000,
4231 }
4232 }
4233 #[allow(clippy::too_many_lines)]
4234 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
4235 match self {
4236 Self::Glm52 => &[ReasoningEffort::High, ReasoningEffort::Max],
4237 Self::Glm45
4238 | Self::Glm45Air
4239 | Self::Glm45Flash
4240 | Self::Glm45v
4241 | Self::Glm46
4242 | Self::Glm46v
4243 | Self::Glm47
4244 | Self::Glm47Flash
4245 | Self::Glm47Flashx
4246 | Self::Glm5
4247 | Self::Glm5Turbo
4248 | Self::Glm51
4249 | Self::Glm5vTurbo => {
4250 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
4251 }
4252 }
4253 }
4254 pub fn supports_reasoning(self) -> bool {
4255 !self.reasoning_levels().is_empty()
4256 }
4257 #[allow(clippy::too_many_lines)]
4258 pub fn supports_prompt_caching(self) -> bool {
4259 match self {
4260 Self::Glm45v | Self::Glm46v => false,
4261 Self::Glm45
4262 | Self::Glm45Air
4263 | Self::Glm45Flash
4264 | Self::Glm46
4265 | Self::Glm47
4266 | Self::Glm47Flash
4267 | Self::Glm47Flashx
4268 | Self::Glm5
4269 | Self::Glm5Turbo
4270 | Self::Glm51
4271 | Self::Glm52
4272 | Self::Glm5vTurbo => true,
4273 }
4274 }
4275 #[allow(clippy::too_many_lines)]
4276 pub fn supports_image(self) -> bool {
4277 match self {
4278 Self::Glm45
4279 | Self::Glm45Air
4280 | Self::Glm45Flash
4281 | Self::Glm46
4282 | Self::Glm47
4283 | Self::Glm47Flash
4284 | Self::Glm47Flashx
4285 | Self::Glm5
4286 | Self::Glm5Turbo
4287 | Self::Glm51
4288 | Self::Glm52 => false,
4289 Self::Glm45v | Self::Glm46v | Self::Glm5vTurbo => true,
4290 }
4291 }
4292 #[allow(clippy::too_many_lines)]
4293 pub fn supports_audio(self) -> bool {
4294 match self {
4295 Self::Glm45
4296 | Self::Glm45Air
4297 | Self::Glm45Flash
4298 | Self::Glm45v
4299 | Self::Glm46
4300 | Self::Glm46v
4301 | Self::Glm47
4302 | Self::Glm47Flash
4303 | Self::Glm47Flashx
4304 | Self::Glm5
4305 | Self::Glm5Turbo
4306 | Self::Glm51
4307 | Self::Glm52
4308 | Self::Glm5vTurbo => false,
4309 }
4310 }
4311 const ALL: &[ZAiModel] = &[
4312 Self::Glm45,
4313 Self::Glm45Air,
4314 Self::Glm45Flash,
4315 Self::Glm45v,
4316 Self::Glm46,
4317 Self::Glm46v,
4318 Self::Glm47,
4319 Self::Glm47Flash,
4320 Self::Glm47Flashx,
4321 Self::Glm5,
4322 Self::Glm5Turbo,
4323 Self::Glm51,
4324 Self::Glm52,
4325 Self::Glm5vTurbo,
4326 ];
4327}
4328impl std::str::FromStr for ZAiModel {
4329 type Err = String;
4330 #[allow(clippy::too_many_lines)]
4331 fn from_str(s: &str) -> Result<Self, Self::Err> {
4332 match s {
4333 "glm-4.5" => Ok(Self::Glm45),
4334 "glm-4.5-air" => Ok(Self::Glm45Air),
4335 "glm-4.5-flash" => Ok(Self::Glm45Flash),
4336 "glm-4.5v" => Ok(Self::Glm45v),
4337 "glm-4.6" => Ok(Self::Glm46),
4338 "glm-4.6v" => Ok(Self::Glm46v),
4339 "glm-4.7" => Ok(Self::Glm47),
4340 "glm-4.7-flash" => Ok(Self::Glm47Flash),
4341 "glm-4.7-flashx" => Ok(Self::Glm47Flashx),
4342 "glm-5" => Ok(Self::Glm5),
4343 "glm-5-turbo" => Ok(Self::Glm5Turbo),
4344 "glm-5.1" => Ok(Self::Glm51),
4345 "glm-5.2" => Ok(Self::Glm52),
4346 "glm-5v-turbo" => Ok(Self::Glm5vTurbo),
4347 _ => Err(format!("Unknown zai model: '{s}'")),
4348 }
4349 }
4350}
4351impl BedrockFoundationModel {
4352 #[allow(clippy::too_many_lines)]
4353 fn model_id(self) -> &'static str {
4354 match self {
4355 Self::AmazonNova2LiteV10 => "amazon.nova-2-lite-v1:0",
4356 Self::AmazonNovaLiteV10 => "amazon.nova-lite-v1:0",
4357 Self::AmazonNovaMicroV10 => "amazon.nova-micro-v1:0",
4358 Self::AmazonNovaProV10 => "amazon.nova-pro-v1:0",
4359 Self::AnthropicClaudeFable5 => "anthropic.claude-fable-5",
4360 Self::AnthropicClaudeHaiku4520251001V10 => {
4361 "anthropic.claude-haiku-4-5-20251001-v1:0"
4362 }
4363 Self::AnthropicClaudeOpus4120250805V10 => {
4364 "anthropic.claude-opus-4-1-20250805-v1:0"
4365 }
4366 Self::AnthropicClaudeOpus4520251101V10 => {
4367 "anthropic.claude-opus-4-5-20251101-v1:0"
4368 }
4369 Self::AnthropicClaudeOpus46V1 => "anthropic.claude-opus-4-6-v1",
4370 Self::AnthropicClaudeOpus47 => "anthropic.claude-opus-4-7",
4371 Self::AnthropicClaudeOpus48 => "anthropic.claude-opus-4-8",
4372 Self::AnthropicClaudeSonnet4520250929V10 => {
4373 "anthropic.claude-sonnet-4-5-20250929-v1:0"
4374 }
4375 Self::AnthropicClaudeSonnet46 => "anthropic.claude-sonnet-4-6",
4376 Self::AnthropicClaudeSonnet5 => "anthropic.claude-sonnet-5",
4377 Self::AuAnthropicClaudeHaiku4520251001V10 => {
4378 "au.anthropic.claude-haiku-4-5-20251001-v1:0"
4379 }
4380 Self::AuAnthropicClaudeOpus46V1 => "au.anthropic.claude-opus-4-6-v1",
4381 Self::AuAnthropicClaudeOpus48 => "au.anthropic.claude-opus-4-8",
4382 Self::AuAnthropicClaudeSonnet4520250929V10 => {
4383 "au.anthropic.claude-sonnet-4-5-20250929-v1:0"
4384 }
4385 Self::AuAnthropicClaudeSonnet46 => "au.anthropic.claude-sonnet-4-6",
4386 Self::AuAnthropicClaudeSonnet5 => "au.anthropic.claude-sonnet-5",
4387 Self::DeepseekR1V10 => "deepseek.r1-v1:0",
4388 Self::DeepseekV3V10 => "deepseek.v3-v1:0",
4389 Self::DeepseekV32 => "deepseek.v3.2",
4390 Self::EuAnthropicClaudeFable5 => "eu.anthropic.claude-fable-5",
4391 Self::EuAnthropicClaudeHaiku4520251001V10 => {
4392 "eu.anthropic.claude-haiku-4-5-20251001-v1:0"
4393 }
4394 Self::EuAnthropicClaudeOpus4520251101V10 => {
4395 "eu.anthropic.claude-opus-4-5-20251101-v1:0"
4396 }
4397 Self::EuAnthropicClaudeOpus46V1 => "eu.anthropic.claude-opus-4-6-v1",
4398 Self::EuAnthropicClaudeOpus47 => "eu.anthropic.claude-opus-4-7",
4399 Self::EuAnthropicClaudeOpus48 => "eu.anthropic.claude-opus-4-8",
4400 Self::EuAnthropicClaudeSonnet4520250929V10 => {
4401 "eu.anthropic.claude-sonnet-4-5-20250929-v1:0"
4402 }
4403 Self::EuAnthropicClaudeSonnet46 => "eu.anthropic.claude-sonnet-4-6",
4404 Self::EuAnthropicClaudeSonnet5 => "eu.anthropic.claude-sonnet-5",
4405 Self::GlobalAnthropicClaudeFable5 => "global.anthropic.claude-fable-5",
4406 Self::GlobalAnthropicClaudeHaiku4520251001V10 => {
4407 "global.anthropic.claude-haiku-4-5-20251001-v1:0"
4408 }
4409 Self::GlobalAnthropicClaudeOpus4520251101V10 => {
4410 "global.anthropic.claude-opus-4-5-20251101-v1:0"
4411 }
4412 Self::GlobalAnthropicClaudeOpus46V1 => "global.anthropic.claude-opus-4-6-v1",
4413 Self::GlobalAnthropicClaudeOpus47 => "global.anthropic.claude-opus-4-7",
4414 Self::GlobalAnthropicClaudeOpus48 => "global.anthropic.claude-opus-4-8",
4415 Self::GlobalAnthropicClaudeSonnet4520250929V10 => {
4416 "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
4417 }
4418 Self::GlobalAnthropicClaudeSonnet46 => "global.anthropic.claude-sonnet-4-6",
4419 Self::GlobalAnthropicClaudeSonnet5 => "global.anthropic.claude-sonnet-5",
4420 Self::GoogleGemma327bIt => "google.gemma-3-27b-it",
4421 Self::GoogleGemma34bIt => "google.gemma-3-4b-it",
4422 Self::JpAnthropicClaudeHaiku4520251001V10 => {
4423 "jp.anthropic.claude-haiku-4-5-20251001-v1:0"
4424 }
4425 Self::JpAnthropicClaudeOpus47 => "jp.anthropic.claude-opus-4-7",
4426 Self::JpAnthropicClaudeOpus48 => "jp.anthropic.claude-opus-4-8",
4427 Self::JpAnthropicClaudeSonnet4520250929V10 => {
4428 "jp.anthropic.claude-sonnet-4-5-20250929-v1:0"
4429 }
4430 Self::JpAnthropicClaudeSonnet46 => "jp.anthropic.claude-sonnet-4-6",
4431 Self::JpAnthropicClaudeSonnet5 => "jp.anthropic.claude-sonnet-5",
4432 Self::MetaLlama3170bInstructV10 => "meta.llama3-1-70b-instruct-v1:0",
4433 Self::MetaLlama318bInstructV10 => "meta.llama3-1-8b-instruct-v1:0",
4434 Self::MetaLlama3370bInstructV10 => "meta.llama3-3-70b-instruct-v1:0",
4435 Self::MetaLlama4Maverick17bInstructV10 => {
4436 "meta.llama4-maverick-17b-instruct-v1:0"
4437 }
4438 Self::MetaLlama4Scout17bInstructV10 => "meta.llama4-scout-17b-instruct-v1:0",
4439 Self::MinimaxMinimaxM2 => "minimax.minimax-m2",
4440 Self::MinimaxMinimaxM21 => "minimax.minimax-m2.1",
4441 Self::MinimaxMinimaxM25 => "minimax.minimax-m2.5",
4442 Self::MistralDevstral2123b => "mistral.devstral-2-123b",
4443 Self::MistralMagistralSmall2509 => "mistral.magistral-small-2509",
4444 Self::MistralMinistral314bInstruct => "mistral.ministral-3-14b-instruct",
4445 Self::MistralMinistral33bInstruct => "mistral.ministral-3-3b-instruct",
4446 Self::MistralMinistral38bInstruct => "mistral.ministral-3-8b-instruct",
4447 Self::MistralMistralLarge3675bInstruct => {
4448 "mistral.mistral-large-3-675b-instruct"
4449 }
4450 Self::MistralPixtralLarge2502V10 => "mistral.pixtral-large-2502-v1:0",
4451 Self::MistralVoxtralMini3b2507 => "mistral.voxtral-mini-3b-2507",
4452 Self::MistralVoxtralSmall24b2507 => "mistral.voxtral-small-24b-2507",
4453 Self::MoonshotKimiK2Thinking => "moonshot.kimi-k2-thinking",
4454 Self::MoonshotaiKimiK25 => "moonshotai.kimi-k2.5",
4455 Self::NvidiaNemotronNano12bV2 => "nvidia.nemotron-nano-12b-v2",
4456 Self::NvidiaNemotronNano330b => "nvidia.nemotron-nano-3-30b",
4457 Self::NvidiaNemotronNano9bV2 => "nvidia.nemotron-nano-9b-v2",
4458 Self::NvidiaNemotronSuper3120b => "nvidia.nemotron-super-3-120b",
4459 Self::OpenaiGpt54 => "openai.gpt-5.4",
4460 Self::OpenaiGpt55 => "openai.gpt-5.5",
4461 Self::OpenaiGptOss120b => "openai.gpt-oss-120b",
4462 Self::OpenaiGptOss120b10 => "openai.gpt-oss-120b-1:0",
4463 Self::OpenaiGptOss20b => "openai.gpt-oss-20b",
4464 Self::OpenaiGptOss20b10 => "openai.gpt-oss-20b-1:0",
4465 Self::OpenaiGptOssSafeguard120b => "openai.gpt-oss-safeguard-120b",
4466 Self::OpenaiGptOssSafeguard20b => "openai.gpt-oss-safeguard-20b",
4467 Self::QwenQwen3235bA22b2507V10 => "qwen.qwen3-235b-a22b-2507-v1:0",
4468 Self::QwenQwen332bV10 => "qwen.qwen3-32b-v1:0",
4469 Self::QwenQwen3Coder30bA3bV10 => "qwen.qwen3-coder-30b-a3b-v1:0",
4470 Self::QwenQwen3Coder480bA35bV10 => "qwen.qwen3-coder-480b-a35b-v1:0",
4471 Self::QwenQwen3CoderNext => "qwen.qwen3-coder-next",
4472 Self::QwenQwen3Next80bA3b => "qwen.qwen3-next-80b-a3b",
4473 Self::QwenQwen3Vl235bA22b => "qwen.qwen3-vl-235b-a22b",
4474 Self::UsAnthropicClaudeFable5 => "us.anthropic.claude-fable-5",
4475 Self::UsAnthropicClaudeHaiku4520251001V10 => {
4476 "us.anthropic.claude-haiku-4-5-20251001-v1:0"
4477 }
4478 Self::UsAnthropicClaudeOpus4120250805V10 => {
4479 "us.anthropic.claude-opus-4-1-20250805-v1:0"
4480 }
4481 Self::UsAnthropicClaudeOpus4520251101V10 => {
4482 "us.anthropic.claude-opus-4-5-20251101-v1:0"
4483 }
4484 Self::UsAnthropicClaudeOpus46V1 => "us.anthropic.claude-opus-4-6-v1",
4485 Self::UsAnthropicClaudeOpus47 => "us.anthropic.claude-opus-4-7",
4486 Self::UsAnthropicClaudeOpus48 => "us.anthropic.claude-opus-4-8",
4487 Self::UsAnthropicClaudeSonnet4520250929V10 => {
4488 "us.anthropic.claude-sonnet-4-5-20250929-v1:0"
4489 }
4490 Self::UsAnthropicClaudeSonnet46 => "us.anthropic.claude-sonnet-4-6",
4491 Self::UsAnthropicClaudeSonnet5 => "us.anthropic.claude-sonnet-5",
4492 Self::UsDeepseekR1V10 => "us.deepseek.r1-v1:0",
4493 Self::UsMetaLlama4Maverick17bInstructV10 => {
4494 "us.meta.llama4-maverick-17b-instruct-v1:0"
4495 }
4496 Self::UsMetaLlama4Scout17bInstructV10 => {
4497 "us.meta.llama4-scout-17b-instruct-v1:0"
4498 }
4499 Self::WriterPalmyraX4V10 => "writer.palmyra-x4-v1:0",
4500 Self::WriterPalmyraX5V10 => "writer.palmyra-x5-v1:0",
4501 Self::XaiGrok43 => "xai.grok-4.3",
4502 Self::ZaiGlm47 => "zai.glm-4.7",
4503 Self::ZaiGlm47Flash => "zai.glm-4.7-flash",
4504 Self::ZaiGlm5 => "zai.glm-5",
4505 }
4506 }
4507 #[allow(clippy::too_many_lines)]
4508 fn display_name(self) -> &'static str {
4509 match self {
4510 Self::AuAnthropicClaudeOpus46V1 => "AU Anthropic Claude Opus 4.6",
4511 Self::AuAnthropicClaudeSonnet46 => "AU Anthropic Claude Sonnet 4.6",
4512 Self::AnthropicClaudeFable5 => "Claude Fable 5",
4513 Self::EuAnthropicClaudeFable5 => "Claude Fable 5 (EU)",
4514 Self::GlobalAnthropicClaudeFable5 => "Claude Fable 5 (Global)",
4515 Self::UsAnthropicClaudeFable5 => "Claude Fable 5 (US)",
4516 Self::AnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5",
4517 Self::AuAnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5 (AU)",
4518 Self::EuAnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5 (EU)",
4519 Self::GlobalAnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5 (Global)",
4520 Self::JpAnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5 (JP)",
4521 Self::UsAnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5 (US)",
4522 Self::AnthropicClaudeOpus4120250805V10 => "Claude Opus 4.1",
4523 Self::UsAnthropicClaudeOpus4120250805V10 => "Claude Opus 4.1 (US)",
4524 Self::AnthropicClaudeOpus4520251101V10 => "Claude Opus 4.5",
4525 Self::EuAnthropicClaudeOpus4520251101V10 => "Claude Opus 4.5 (EU)",
4526 Self::GlobalAnthropicClaudeOpus4520251101V10 => "Claude Opus 4.5 (Global)",
4527 Self::UsAnthropicClaudeOpus4520251101V10 => "Claude Opus 4.5 (US)",
4528 Self::AnthropicClaudeOpus46V1 => "Claude Opus 4.6",
4529 Self::EuAnthropicClaudeOpus46V1 => "Claude Opus 4.6 (EU)",
4530 Self::GlobalAnthropicClaudeOpus46V1 => "Claude Opus 4.6 (Global)",
4531 Self::UsAnthropicClaudeOpus46V1 => "Claude Opus 4.6 (US)",
4532 Self::AnthropicClaudeOpus47 => "Claude Opus 4.7",
4533 Self::EuAnthropicClaudeOpus47 => "Claude Opus 4.7 (EU)",
4534 Self::GlobalAnthropicClaudeOpus47 => "Claude Opus 4.7 (Global)",
4535 Self::JpAnthropicClaudeOpus47 => "Claude Opus 4.7 (JP)",
4536 Self::UsAnthropicClaudeOpus47 => "Claude Opus 4.7 (US)",
4537 Self::AnthropicClaudeOpus48 => "Claude Opus 4.8",
4538 Self::AuAnthropicClaudeOpus48 => "Claude Opus 4.8 (AU)",
4539 Self::EuAnthropicClaudeOpus48 => "Claude Opus 4.8 (EU)",
4540 Self::GlobalAnthropicClaudeOpus48 => "Claude Opus 4.8 (Global)",
4541 Self::JpAnthropicClaudeOpus48 => "Claude Opus 4.8 (JP)",
4542 Self::UsAnthropicClaudeOpus48 => "Claude Opus 4.8 (US)",
4543 Self::AnthropicClaudeSonnet4520250929V10 => "Claude Sonnet 4.5",
4544 Self::AuAnthropicClaudeSonnet4520250929V10 => "Claude Sonnet 4.5 (AU)",
4545 Self::EuAnthropicClaudeSonnet4520250929V10 => "Claude Sonnet 4.5 (EU)",
4546 Self::GlobalAnthropicClaudeSonnet4520250929V10 => {
4547 "Claude Sonnet 4.5 (Global)"
4548 }
4549 Self::JpAnthropicClaudeSonnet4520250929V10 => "Claude Sonnet 4.5 (JP)",
4550 Self::UsAnthropicClaudeSonnet4520250929V10 => "Claude Sonnet 4.5 (US)",
4551 Self::AnthropicClaudeSonnet46 => "Claude Sonnet 4.6",
4552 Self::EuAnthropicClaudeSonnet46 => "Claude Sonnet 4.6 (EU)",
4553 Self::GlobalAnthropicClaudeSonnet46 => "Claude Sonnet 4.6 (Global)",
4554 Self::JpAnthropicClaudeSonnet46 => "Claude Sonnet 4.6 (JP)",
4555 Self::UsAnthropicClaudeSonnet46 => "Claude Sonnet 4.6 (US)",
4556 Self::AnthropicClaudeSonnet5 => "Claude Sonnet 5",
4557 Self::AuAnthropicClaudeSonnet5 => "Claude Sonnet 5 (AU)",
4558 Self::EuAnthropicClaudeSonnet5 => "Claude Sonnet 5 (EU)",
4559 Self::GlobalAnthropicClaudeSonnet5 => "Claude Sonnet 5 (Global)",
4560 Self::JpAnthropicClaudeSonnet5 => "Claude Sonnet 5 (JP)",
4561 Self::UsAnthropicClaudeSonnet5 => "Claude Sonnet 5 (US)",
4562 Self::DeepseekR1V10 => "DeepSeek-R1",
4563 Self::UsDeepseekR1V10 => "DeepSeek-R1 (US)",
4564 Self::DeepseekV3V10 => "DeepSeek-V3.1",
4565 Self::DeepseekV32 => "DeepSeek-V3.2",
4566 Self::MistralDevstral2123b => "Devstral 2 123B",
4567 Self::ZaiGlm47 => "GLM-4.7",
4568 Self::ZaiGlm47Flash => "GLM-4.7-Flash",
4569 Self::ZaiGlm5 => "GLM-5",
4570 Self::OpenaiGptOssSafeguard120b => "GPT OSS Safeguard 120B",
4571 Self::OpenaiGptOssSafeguard20b => "GPT OSS Safeguard 20B",
4572 Self::OpenaiGpt54 => "GPT-5.4",
4573 Self::OpenaiGpt55 => "GPT-5.5",
4574 Self::GoogleGemma34bIt => "Gemma 3 4B IT",
4575 Self::GoogleGemma327bIt => "Google Gemma 3 27B Instruct",
4576 Self::XaiGrok43 => "Grok 4.3",
4577 Self::MoonshotKimiK2Thinking => "Kimi K2 Thinking",
4578 Self::MoonshotaiKimiK25 => "Kimi K2.5",
4579 Self::MetaLlama3170bInstructV10 => "Llama 3.1 70B Instruct",
4580 Self::MetaLlama318bInstructV10 => "Llama 3.1 8B Instruct",
4581 Self::MetaLlama3370bInstructV10 => "Llama 3.3 70B Instruct",
4582 Self::MetaLlama4Maverick17bInstructV10 => "Llama 4 Maverick 17B Instruct",
4583 Self::UsMetaLlama4Maverick17bInstructV10 => {
4584 "Llama 4 Maverick 17B Instruct (US)"
4585 }
4586 Self::MetaLlama4Scout17bInstructV10 => "Llama 4 Scout 17B Instruct",
4587 Self::UsMetaLlama4Scout17bInstructV10 => "Llama 4 Scout 17B Instruct (US)",
4588 Self::MistralMagistralSmall2509 => "Magistral Small 1.2",
4589 Self::MinimaxMinimaxM2 => "MiniMax M2",
4590 Self::MinimaxMinimaxM21 => "MiniMax M2.1",
4591 Self::MinimaxMinimaxM25 => "MiniMax M2.5",
4592 Self::MistralMinistral314bInstruct => "Ministral 14B 3.0",
4593 Self::MistralMinistral33bInstruct => "Ministral 3 3B",
4594 Self::MistralMinistral38bInstruct => "Ministral 3 8B",
4595 Self::MistralMistralLarge3675bInstruct => "Mistral Large 3",
4596 Self::NvidiaNemotronSuper3120b => "NVIDIA Nemotron 3 Super 120B A12B",
4597 Self::NvidiaNemotronNano12bV2 => "NVIDIA Nemotron Nano 12B v2 VL BF16",
4598 Self::NvidiaNemotronNano330b => "NVIDIA Nemotron Nano 3 30B",
4599 Self::NvidiaNemotronNano9bV2 => "NVIDIA Nemotron Nano 9B v2",
4600 Self::AmazonNova2LiteV10 => "Nova 2 Lite",
4601 Self::AmazonNovaLiteV10 => "Nova Lite",
4602 Self::AmazonNovaMicroV10 => "Nova Micro",
4603 Self::AmazonNovaProV10 => "Nova Pro",
4604 Self::WriterPalmyraX4V10 => "Palmyra X4",
4605 Self::WriterPalmyraX5V10 => "Palmyra X5",
4606 Self::MistralPixtralLarge2502V10 => "Pixtral Large (25.02)",
4607 Self::QwenQwen3Next80bA3b => "Qwen/Qwen3-Next-80B-A3B-Instruct",
4608 Self::QwenQwen3Vl235bA22b => "Qwen/Qwen3-VL-235B-A22B-Instruct",
4609 Self::QwenQwen3235bA22b2507V10 => "Qwen3 235B A22B 2507",
4610 Self::QwenQwen332bV10 => "Qwen3 32B (dense)",
4611 Self::QwenQwen3Coder30bA3bV10 => "Qwen3 Coder 30B A3B Instruct",
4612 Self::QwenQwen3Coder480bA35bV10 => "Qwen3 Coder 480B A35B Instruct",
4613 Self::QwenQwen3CoderNext => "Qwen3 Coder Next",
4614 Self::MistralVoxtralMini3b2507 => "Voxtral Mini 3B 2507",
4615 Self::MistralVoxtralSmall24b2507 => "Voxtral Small 24B 2507",
4616 Self::OpenaiGptOss120b | Self::OpenaiGptOss120b10 => "gpt-oss-120b",
4617 Self::OpenaiGptOss20b | Self::OpenaiGptOss20b10 => "gpt-oss-20b",
4618 }
4619 }
4620 #[allow(clippy::too_many_lines)]
4621 fn context_window(self) -> u32 {
4622 match self {
4623 Self::QwenQwen332bV10 => 16_384,
4624 Self::MistralVoxtralSmall24b2507 => 32_000,
4625 Self::WriterPalmyraX4V10 => 122_880,
4626 Self::AmazonNova2LiteV10
4627 | Self::AmazonNovaMicroV10
4628 | Self::DeepseekR1V10
4629 | Self::GoogleGemma34bIt
4630 | Self::MetaLlama3170bInstructV10
4631 | Self::MetaLlama318bInstructV10
4632 | Self::MetaLlama3370bInstructV10
4633 | Self::MistralMagistralSmall2509
4634 | Self::MistralMinistral314bInstruct
4635 | Self::MistralMinistral38bInstruct
4636 | Self::MistralPixtralLarge2502V10
4637 | Self::MistralVoxtralMini3b2507
4638 | Self::NvidiaNemotronNano12bV2
4639 | Self::NvidiaNemotronNano330b
4640 | Self::NvidiaNemotronNano9bV2
4641 | Self::OpenaiGptOss120b
4642 | Self::OpenaiGptOss120b10
4643 | Self::OpenaiGptOss20b
4644 | Self::OpenaiGptOss20b10
4645 | Self::OpenaiGptOssSafeguard120b
4646 | Self::OpenaiGptOssSafeguard20b
4647 | Self::UsDeepseekR1V10 => 128_000,
4648 Self::QwenQwen3Coder480bA35bV10 | Self::QwenQwen3CoderNext => 131_072,
4649 Self::DeepseekV3V10 | Self::DeepseekV32 => 163_840,
4650 Self::MinimaxMinimaxM25 => 196_608,
4651 Self::AnthropicClaudeHaiku4520251001V10
4652 | Self::AnthropicClaudeOpus4120250805V10
4653 | Self::AnthropicClaudeOpus4520251101V10
4654 | Self::AnthropicClaudeSonnet4520250929V10
4655 | Self::AuAnthropicClaudeHaiku4520251001V10
4656 | Self::AuAnthropicClaudeSonnet4520250929V10
4657 | Self::EuAnthropicClaudeHaiku4520251001V10
4658 | Self::EuAnthropicClaudeOpus4520251101V10
4659 | Self::EuAnthropicClaudeSonnet4520250929V10
4660 | Self::GlobalAnthropicClaudeHaiku4520251001V10
4661 | Self::GlobalAnthropicClaudeOpus4520251101V10
4662 | Self::GlobalAnthropicClaudeSonnet4520250929V10
4663 | Self::JpAnthropicClaudeHaiku4520251001V10
4664 | Self::JpAnthropicClaudeSonnet4520250929V10
4665 | Self::UsAnthropicClaudeHaiku4520251001V10
4666 | Self::UsAnthropicClaudeOpus4120250805V10
4667 | Self::UsAnthropicClaudeOpus4520251101V10
4668 | Self::UsAnthropicClaudeSonnet4520250929V10
4669 | Self::ZaiGlm47Flash => 200_000,
4670 Self::GoogleGemma327bIt | Self::ZaiGlm5 => 202_752,
4671 Self::MinimaxMinimaxM2 => 204_608,
4672 Self::MinimaxMinimaxM21 | Self::ZaiGlm47 => 204_800,
4673 Self::MistralDevstral2123b
4674 | Self::MistralMinistral33bInstruct
4675 | Self::MistralMistralLarge3675bInstruct => 256_000,
4676 Self::QwenQwen3Next80bA3b | Self::QwenQwen3Vl235bA22b => 262_000,
4677 Self::MoonshotKimiK2Thinking | Self::MoonshotaiKimiK25 => 262_143,
4678 Self::NvidiaNemotronSuper3120b
4679 | Self::QwenQwen3235bA22b2507V10
4680 | Self::QwenQwen3Coder30bA3bV10 => 262_144,
4681 Self::OpenaiGpt54 | Self::OpenaiGpt55 => 272_000,
4682 Self::AmazonNovaLiteV10 | Self::AmazonNovaProV10 => 300_000,
4683 Self::AnthropicClaudeFable5
4684 | Self::AnthropicClaudeOpus46V1
4685 | Self::AnthropicClaudeOpus47
4686 | Self::AnthropicClaudeOpus48
4687 | Self::AnthropicClaudeSonnet46
4688 | Self::AnthropicClaudeSonnet5
4689 | Self::AuAnthropicClaudeOpus46V1
4690 | Self::AuAnthropicClaudeOpus48
4691 | Self::AuAnthropicClaudeSonnet46
4692 | Self::AuAnthropicClaudeSonnet5
4693 | Self::EuAnthropicClaudeFable5
4694 | Self::EuAnthropicClaudeOpus46V1
4695 | Self::EuAnthropicClaudeOpus47
4696 | Self::EuAnthropicClaudeOpus48
4697 | Self::EuAnthropicClaudeSonnet46
4698 | Self::EuAnthropicClaudeSonnet5
4699 | Self::GlobalAnthropicClaudeFable5
4700 | Self::GlobalAnthropicClaudeOpus46V1
4701 | Self::GlobalAnthropicClaudeOpus47
4702 | Self::GlobalAnthropicClaudeOpus48
4703 | Self::GlobalAnthropicClaudeSonnet46
4704 | Self::GlobalAnthropicClaudeSonnet5
4705 | Self::JpAnthropicClaudeOpus47
4706 | Self::JpAnthropicClaudeOpus48
4707 | Self::JpAnthropicClaudeSonnet46
4708 | Self::JpAnthropicClaudeSonnet5
4709 | Self::MetaLlama4Maverick17bInstructV10
4710 | Self::UsAnthropicClaudeFable5
4711 | Self::UsAnthropicClaudeOpus46V1
4712 | Self::UsAnthropicClaudeOpus47
4713 | Self::UsAnthropicClaudeOpus48
4714 | Self::UsAnthropicClaudeSonnet46
4715 | Self::UsAnthropicClaudeSonnet5
4716 | Self::UsMetaLlama4Maverick17bInstructV10
4717 | Self::XaiGrok43 => 1_000_000,
4718 Self::WriterPalmyraX5V10 => 1_040_000,
4719 Self::MetaLlama4Scout17bInstructV10
4720 | Self::UsMetaLlama4Scout17bInstructV10 => 3_500_000,
4721 }
4722 }
4723 #[allow(clippy::too_many_lines)]
4724 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
4725 match self {
4726 Self::AmazonNovaLiteV10
4727 | Self::AmazonNovaMicroV10
4728 | Self::AmazonNovaProV10
4729 | Self::GoogleGemma327bIt
4730 | Self::GoogleGemma34bIt
4731 | Self::MetaLlama3170bInstructV10
4732 | Self::MetaLlama318bInstructV10
4733 | Self::MetaLlama3370bInstructV10
4734 | Self::MetaLlama4Maverick17bInstructV10
4735 | Self::MetaLlama4Scout17bInstructV10
4736 | Self::MistralDevstral2123b
4737 | Self::MistralMinistral314bInstruct
4738 | Self::MistralMinistral33bInstruct
4739 | Self::MistralMinistral38bInstruct
4740 | Self::MistralMistralLarge3675bInstruct
4741 | Self::MistralPixtralLarge2502V10
4742 | Self::MistralVoxtralMini3b2507
4743 | Self::MistralVoxtralSmall24b2507
4744 | Self::NvidiaNemotronNano12bV2
4745 | Self::NvidiaNemotronNano9bV2
4746 | Self::OpenaiGptOssSafeguard120b
4747 | Self::OpenaiGptOssSafeguard20b
4748 | Self::QwenQwen3235bA22b2507V10
4749 | Self::QwenQwen3Coder30bA3bV10
4750 | Self::QwenQwen3Coder480bA35bV10
4751 | Self::QwenQwen3Next80bA3b
4752 | Self::QwenQwen3Vl235bA22b
4753 | Self::UsMetaLlama4Maverick17bInstructV10
4754 | Self::UsMetaLlama4Scout17bInstructV10 => &[],
4755 Self::AmazonNova2LiteV10
4756 | Self::AnthropicClaudeHaiku4520251001V10
4757 | Self::AnthropicClaudeOpus4120250805V10
4758 | Self::AnthropicClaudeOpus4520251101V10
4759 | Self::AnthropicClaudeSonnet4520250929V10
4760 | Self::AuAnthropicClaudeHaiku4520251001V10
4761 | Self::AuAnthropicClaudeSonnet4520250929V10
4762 | Self::DeepseekR1V10
4763 | Self::DeepseekV3V10
4764 | Self::DeepseekV32
4765 | Self::EuAnthropicClaudeHaiku4520251001V10
4766 | Self::EuAnthropicClaudeOpus4520251101V10
4767 | Self::EuAnthropicClaudeSonnet4520250929V10
4768 | Self::GlobalAnthropicClaudeHaiku4520251001V10
4769 | Self::GlobalAnthropicClaudeOpus4520251101V10
4770 | Self::GlobalAnthropicClaudeSonnet4520250929V10
4771 | Self::JpAnthropicClaudeHaiku4520251001V10
4772 | Self::JpAnthropicClaudeSonnet4520250929V10
4773 | Self::MinimaxMinimaxM2
4774 | Self::MinimaxMinimaxM21
4775 | Self::MinimaxMinimaxM25
4776 | Self::MistralMagistralSmall2509
4777 | Self::MoonshotKimiK2Thinking
4778 | Self::MoonshotaiKimiK25
4779 | Self::NvidiaNemotronNano330b
4780 | Self::NvidiaNemotronSuper3120b
4781 | Self::OpenaiGptOss120b
4782 | Self::OpenaiGptOss120b10
4783 | Self::OpenaiGptOss20b
4784 | Self::OpenaiGptOss20b10
4785 | Self::QwenQwen332bV10
4786 | Self::QwenQwen3CoderNext
4787 | Self::UsAnthropicClaudeHaiku4520251001V10
4788 | Self::UsAnthropicClaudeOpus4120250805V10
4789 | Self::UsAnthropicClaudeOpus4520251101V10
4790 | Self::UsAnthropicClaudeSonnet4520250929V10
4791 | Self::UsDeepseekR1V10
4792 | Self::WriterPalmyraX4V10
4793 | Self::WriterPalmyraX5V10
4794 | Self::XaiGrok43
4795 | Self::ZaiGlm47
4796 | Self::ZaiGlm47Flash
4797 | Self::ZaiGlm5 => {
4798 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
4799 }
4800 Self::AnthropicClaudeOpus46V1
4801 | Self::AnthropicClaudeSonnet46
4802 | Self::AuAnthropicClaudeOpus46V1
4803 | Self::AuAnthropicClaudeSonnet46
4804 | Self::EuAnthropicClaudeOpus46V1
4805 | Self::EuAnthropicClaudeSonnet46
4806 | Self::GlobalAnthropicClaudeOpus46V1
4807 | Self::GlobalAnthropicClaudeSonnet46
4808 | Self::JpAnthropicClaudeSonnet46
4809 | Self::UsAnthropicClaudeOpus46V1
4810 | Self::UsAnthropicClaudeSonnet46 => {
4811 &[
4812 ReasoningEffort::Low,
4813 ReasoningEffort::Medium,
4814 ReasoningEffort::High,
4815 ReasoningEffort::Max,
4816 ]
4817 }
4818 Self::OpenaiGpt54 | Self::OpenaiGpt55 => {
4819 &[
4820 ReasoningEffort::Low,
4821 ReasoningEffort::Medium,
4822 ReasoningEffort::High,
4823 ReasoningEffort::Xhigh,
4824 ]
4825 }
4826 Self::AnthropicClaudeFable5
4827 | Self::AnthropicClaudeOpus47
4828 | Self::AnthropicClaudeOpus48
4829 | Self::AnthropicClaudeSonnet5
4830 | Self::AuAnthropicClaudeOpus48
4831 | Self::AuAnthropicClaudeSonnet5
4832 | Self::EuAnthropicClaudeFable5
4833 | Self::EuAnthropicClaudeOpus47
4834 | Self::EuAnthropicClaudeOpus48
4835 | Self::EuAnthropicClaudeSonnet5
4836 | Self::GlobalAnthropicClaudeFable5
4837 | Self::GlobalAnthropicClaudeOpus47
4838 | Self::GlobalAnthropicClaudeOpus48
4839 | Self::GlobalAnthropicClaudeSonnet5
4840 | Self::JpAnthropicClaudeOpus47
4841 | Self::JpAnthropicClaudeOpus48
4842 | Self::JpAnthropicClaudeSonnet5
4843 | Self::UsAnthropicClaudeFable5
4844 | Self::UsAnthropicClaudeOpus47
4845 | Self::UsAnthropicClaudeOpus48
4846 | Self::UsAnthropicClaudeSonnet5 => {
4847 &[
4848 ReasoningEffort::Low,
4849 ReasoningEffort::Medium,
4850 ReasoningEffort::High,
4851 ReasoningEffort::Xhigh,
4852 ReasoningEffort::Max,
4853 ]
4854 }
4855 }
4856 }
4857 pub fn supports_reasoning(self) -> bool {
4858 !self.reasoning_levels().is_empty()
4859 }
4860 #[allow(clippy::too_many_lines)]
4861 pub fn supports_prompt_caching(self) -> bool {
4862 match self {
4863 Self::AmazonNova2LiteV10
4864 | Self::DeepseekR1V10
4865 | Self::DeepseekV3V10
4866 | Self::DeepseekV32
4867 | Self::GoogleGemma327bIt
4868 | Self::GoogleGemma34bIt
4869 | Self::MetaLlama3170bInstructV10
4870 | Self::MetaLlama318bInstructV10
4871 | Self::MetaLlama3370bInstructV10
4872 | Self::MetaLlama4Maverick17bInstructV10
4873 | Self::MetaLlama4Scout17bInstructV10
4874 | Self::MinimaxMinimaxM2
4875 | Self::MinimaxMinimaxM21
4876 | Self::MinimaxMinimaxM25
4877 | Self::MistralDevstral2123b
4878 | Self::MistralMagistralSmall2509
4879 | Self::MistralMinistral314bInstruct
4880 | Self::MistralMinistral33bInstruct
4881 | Self::MistralMinistral38bInstruct
4882 | Self::MistralMistralLarge3675bInstruct
4883 | Self::MistralPixtralLarge2502V10
4884 | Self::MistralVoxtralMini3b2507
4885 | Self::MistralVoxtralSmall24b2507
4886 | Self::MoonshotKimiK2Thinking
4887 | Self::MoonshotaiKimiK25
4888 | Self::NvidiaNemotronNano12bV2
4889 | Self::NvidiaNemotronNano330b
4890 | Self::NvidiaNemotronNano9bV2
4891 | Self::NvidiaNemotronSuper3120b
4892 | Self::OpenaiGptOss120b
4893 | Self::OpenaiGptOss120b10
4894 | Self::OpenaiGptOss20b
4895 | Self::OpenaiGptOss20b10
4896 | Self::OpenaiGptOssSafeguard120b
4897 | Self::OpenaiGptOssSafeguard20b
4898 | Self::QwenQwen3235bA22b2507V10
4899 | Self::QwenQwen332bV10
4900 | Self::QwenQwen3Coder30bA3bV10
4901 | Self::QwenQwen3Coder480bA35bV10
4902 | Self::QwenQwen3CoderNext
4903 | Self::QwenQwen3Next80bA3b
4904 | Self::QwenQwen3Vl235bA22b
4905 | Self::UsDeepseekR1V10
4906 | Self::UsMetaLlama4Maverick17bInstructV10
4907 | Self::UsMetaLlama4Scout17bInstructV10
4908 | Self::WriterPalmyraX4V10
4909 | Self::WriterPalmyraX5V10
4910 | Self::ZaiGlm47
4911 | Self::ZaiGlm47Flash
4912 | Self::ZaiGlm5 => false,
4913 Self::AmazonNovaLiteV10
4914 | Self::AmazonNovaMicroV10
4915 | Self::AmazonNovaProV10
4916 | Self::AnthropicClaudeFable5
4917 | Self::AnthropicClaudeHaiku4520251001V10
4918 | Self::AnthropicClaudeOpus4120250805V10
4919 | Self::AnthropicClaudeOpus4520251101V10
4920 | Self::AnthropicClaudeOpus46V1
4921 | Self::AnthropicClaudeOpus47
4922 | Self::AnthropicClaudeOpus48
4923 | Self::AnthropicClaudeSonnet4520250929V10
4924 | Self::AnthropicClaudeSonnet46
4925 | Self::AnthropicClaudeSonnet5
4926 | Self::AuAnthropicClaudeHaiku4520251001V10
4927 | Self::AuAnthropicClaudeOpus46V1
4928 | Self::AuAnthropicClaudeOpus48
4929 | Self::AuAnthropicClaudeSonnet4520250929V10
4930 | Self::AuAnthropicClaudeSonnet46
4931 | Self::AuAnthropicClaudeSonnet5
4932 | Self::EuAnthropicClaudeFable5
4933 | Self::EuAnthropicClaudeHaiku4520251001V10
4934 | Self::EuAnthropicClaudeOpus4520251101V10
4935 | Self::EuAnthropicClaudeOpus46V1
4936 | Self::EuAnthropicClaudeOpus47
4937 | Self::EuAnthropicClaudeOpus48
4938 | Self::EuAnthropicClaudeSonnet4520250929V10
4939 | Self::EuAnthropicClaudeSonnet46
4940 | Self::EuAnthropicClaudeSonnet5
4941 | Self::GlobalAnthropicClaudeFable5
4942 | Self::GlobalAnthropicClaudeHaiku4520251001V10
4943 | Self::GlobalAnthropicClaudeOpus4520251101V10
4944 | Self::GlobalAnthropicClaudeOpus46V1
4945 | Self::GlobalAnthropicClaudeOpus47
4946 | Self::GlobalAnthropicClaudeOpus48
4947 | Self::GlobalAnthropicClaudeSonnet4520250929V10
4948 | Self::GlobalAnthropicClaudeSonnet46
4949 | Self::GlobalAnthropicClaudeSonnet5
4950 | Self::JpAnthropicClaudeHaiku4520251001V10
4951 | Self::JpAnthropicClaudeOpus47
4952 | Self::JpAnthropicClaudeOpus48
4953 | Self::JpAnthropicClaudeSonnet4520250929V10
4954 | Self::JpAnthropicClaudeSonnet46
4955 | Self::JpAnthropicClaudeSonnet5
4956 | Self::OpenaiGpt54
4957 | Self::OpenaiGpt55
4958 | Self::UsAnthropicClaudeFable5
4959 | Self::UsAnthropicClaudeHaiku4520251001V10
4960 | Self::UsAnthropicClaudeOpus4120250805V10
4961 | Self::UsAnthropicClaudeOpus4520251101V10
4962 | Self::UsAnthropicClaudeOpus46V1
4963 | Self::UsAnthropicClaudeOpus47
4964 | Self::UsAnthropicClaudeOpus48
4965 | Self::UsAnthropicClaudeSonnet4520250929V10
4966 | Self::UsAnthropicClaudeSonnet46
4967 | Self::UsAnthropicClaudeSonnet5
4968 | Self::XaiGrok43 => true,
4969 }
4970 }
4971 #[allow(clippy::too_many_lines)]
4972 pub fn supports_image(self) -> bool {
4973 match self {
4974 Self::AmazonNovaMicroV10
4975 | Self::DeepseekR1V10
4976 | Self::DeepseekV3V10
4977 | Self::DeepseekV32
4978 | Self::MetaLlama3170bInstructV10
4979 | Self::MetaLlama318bInstructV10
4980 | Self::MetaLlama3370bInstructV10
4981 | Self::MinimaxMinimaxM2
4982 | Self::MinimaxMinimaxM21
4983 | Self::MinimaxMinimaxM25
4984 | Self::MistralDevstral2123b
4985 | Self::MistralMinistral314bInstruct
4986 | Self::MistralMinistral38bInstruct
4987 | Self::MistralVoxtralMini3b2507
4988 | Self::MistralVoxtralSmall24b2507
4989 | Self::MoonshotKimiK2Thinking
4990 | Self::NvidiaNemotronNano330b
4991 | Self::NvidiaNemotronNano9bV2
4992 | Self::NvidiaNemotronSuper3120b
4993 | Self::OpenaiGptOss120b
4994 | Self::OpenaiGptOss120b10
4995 | Self::OpenaiGptOss20b
4996 | Self::OpenaiGptOss20b10
4997 | Self::OpenaiGptOssSafeguard120b
4998 | Self::OpenaiGptOssSafeguard20b
4999 | Self::QwenQwen3235bA22b2507V10
5000 | Self::QwenQwen332bV10
5001 | Self::QwenQwen3Coder30bA3bV10
5002 | Self::QwenQwen3Coder480bA35bV10
5003 | Self::QwenQwen3CoderNext
5004 | Self::QwenQwen3Next80bA3b
5005 | Self::UsDeepseekR1V10
5006 | Self::WriterPalmyraX4V10
5007 | Self::WriterPalmyraX5V10
5008 | Self::ZaiGlm47
5009 | Self::ZaiGlm47Flash
5010 | Self::ZaiGlm5 => false,
5011 Self::AmazonNova2LiteV10
5012 | Self::AmazonNovaLiteV10
5013 | Self::AmazonNovaProV10
5014 | Self::AnthropicClaudeFable5
5015 | Self::AnthropicClaudeHaiku4520251001V10
5016 | Self::AnthropicClaudeOpus4120250805V10
5017 | Self::AnthropicClaudeOpus4520251101V10
5018 | Self::AnthropicClaudeOpus46V1
5019 | Self::AnthropicClaudeOpus47
5020 | Self::AnthropicClaudeOpus48
5021 | Self::AnthropicClaudeSonnet4520250929V10
5022 | Self::AnthropicClaudeSonnet46
5023 | Self::AnthropicClaudeSonnet5
5024 | Self::AuAnthropicClaudeHaiku4520251001V10
5025 | Self::AuAnthropicClaudeOpus46V1
5026 | Self::AuAnthropicClaudeOpus48
5027 | Self::AuAnthropicClaudeSonnet4520250929V10
5028 | Self::AuAnthropicClaudeSonnet46
5029 | Self::AuAnthropicClaudeSonnet5
5030 | Self::EuAnthropicClaudeFable5
5031 | Self::EuAnthropicClaudeHaiku4520251001V10
5032 | Self::EuAnthropicClaudeOpus4520251101V10
5033 | Self::EuAnthropicClaudeOpus46V1
5034 | Self::EuAnthropicClaudeOpus47
5035 | Self::EuAnthropicClaudeOpus48
5036 | Self::EuAnthropicClaudeSonnet4520250929V10
5037 | Self::EuAnthropicClaudeSonnet46
5038 | Self::EuAnthropicClaudeSonnet5
5039 | Self::GlobalAnthropicClaudeFable5
5040 | Self::GlobalAnthropicClaudeHaiku4520251001V10
5041 | Self::GlobalAnthropicClaudeOpus4520251101V10
5042 | Self::GlobalAnthropicClaudeOpus46V1
5043 | Self::GlobalAnthropicClaudeOpus47
5044 | Self::GlobalAnthropicClaudeOpus48
5045 | Self::GlobalAnthropicClaudeSonnet4520250929V10
5046 | Self::GlobalAnthropicClaudeSonnet46
5047 | Self::GlobalAnthropicClaudeSonnet5
5048 | Self::GoogleGemma327bIt
5049 | Self::GoogleGemma34bIt
5050 | Self::JpAnthropicClaudeHaiku4520251001V10
5051 | Self::JpAnthropicClaudeOpus47
5052 | Self::JpAnthropicClaudeOpus48
5053 | Self::JpAnthropicClaudeSonnet4520250929V10
5054 | Self::JpAnthropicClaudeSonnet46
5055 | Self::JpAnthropicClaudeSonnet5
5056 | Self::MetaLlama4Maverick17bInstructV10
5057 | Self::MetaLlama4Scout17bInstructV10
5058 | Self::MistralMagistralSmall2509
5059 | Self::MistralMinistral33bInstruct
5060 | Self::MistralMistralLarge3675bInstruct
5061 | Self::MistralPixtralLarge2502V10
5062 | Self::MoonshotaiKimiK25
5063 | Self::NvidiaNemotronNano12bV2
5064 | Self::OpenaiGpt54
5065 | Self::OpenaiGpt55
5066 | Self::QwenQwen3Vl235bA22b
5067 | Self::UsAnthropicClaudeFable5
5068 | Self::UsAnthropicClaudeHaiku4520251001V10
5069 | Self::UsAnthropicClaudeOpus4120250805V10
5070 | Self::UsAnthropicClaudeOpus4520251101V10
5071 | Self::UsAnthropicClaudeOpus46V1
5072 | Self::UsAnthropicClaudeOpus47
5073 | Self::UsAnthropicClaudeOpus48
5074 | Self::UsAnthropicClaudeSonnet4520250929V10
5075 | Self::UsAnthropicClaudeSonnet46
5076 | Self::UsAnthropicClaudeSonnet5
5077 | Self::UsMetaLlama4Maverick17bInstructV10
5078 | Self::UsMetaLlama4Scout17bInstructV10
5079 | Self::XaiGrok43 => true,
5080 }
5081 }
5082 #[allow(clippy::too_many_lines)]
5083 pub fn supports_audio(self) -> bool {
5084 match self {
5085 Self::AmazonNova2LiteV10
5086 | Self::AmazonNovaLiteV10
5087 | Self::AmazonNovaMicroV10
5088 | Self::AmazonNovaProV10
5089 | Self::AnthropicClaudeFable5
5090 | Self::AnthropicClaudeHaiku4520251001V10
5091 | Self::AnthropicClaudeOpus4120250805V10
5092 | Self::AnthropicClaudeOpus4520251101V10
5093 | Self::AnthropicClaudeOpus46V1
5094 | Self::AnthropicClaudeOpus47
5095 | Self::AnthropicClaudeOpus48
5096 | Self::AnthropicClaudeSonnet4520250929V10
5097 | Self::AnthropicClaudeSonnet46
5098 | Self::AnthropicClaudeSonnet5
5099 | Self::AuAnthropicClaudeHaiku4520251001V10
5100 | Self::AuAnthropicClaudeOpus46V1
5101 | Self::AuAnthropicClaudeOpus48
5102 | Self::AuAnthropicClaudeSonnet4520250929V10
5103 | Self::AuAnthropicClaudeSonnet46
5104 | Self::AuAnthropicClaudeSonnet5
5105 | Self::DeepseekR1V10
5106 | Self::DeepseekV3V10
5107 | Self::DeepseekV32
5108 | Self::EuAnthropicClaudeFable5
5109 | Self::EuAnthropicClaudeHaiku4520251001V10
5110 | Self::EuAnthropicClaudeOpus4520251101V10
5111 | Self::EuAnthropicClaudeOpus46V1
5112 | Self::EuAnthropicClaudeOpus47
5113 | Self::EuAnthropicClaudeOpus48
5114 | Self::EuAnthropicClaudeSonnet4520250929V10
5115 | Self::EuAnthropicClaudeSonnet46
5116 | Self::EuAnthropicClaudeSonnet5
5117 | Self::GlobalAnthropicClaudeFable5
5118 | Self::GlobalAnthropicClaudeHaiku4520251001V10
5119 | Self::GlobalAnthropicClaudeOpus4520251101V10
5120 | Self::GlobalAnthropicClaudeOpus46V1
5121 | Self::GlobalAnthropicClaudeOpus47
5122 | Self::GlobalAnthropicClaudeOpus48
5123 | Self::GlobalAnthropicClaudeSonnet4520250929V10
5124 | Self::GlobalAnthropicClaudeSonnet46
5125 | Self::GlobalAnthropicClaudeSonnet5
5126 | Self::GoogleGemma327bIt
5127 | Self::GoogleGemma34bIt
5128 | Self::JpAnthropicClaudeHaiku4520251001V10
5129 | Self::JpAnthropicClaudeOpus47
5130 | Self::JpAnthropicClaudeOpus48
5131 | Self::JpAnthropicClaudeSonnet4520250929V10
5132 | Self::JpAnthropicClaudeSonnet46
5133 | Self::JpAnthropicClaudeSonnet5
5134 | Self::MetaLlama3170bInstructV10
5135 | Self::MetaLlama318bInstructV10
5136 | Self::MetaLlama3370bInstructV10
5137 | Self::MetaLlama4Maverick17bInstructV10
5138 | Self::MetaLlama4Scout17bInstructV10
5139 | Self::MinimaxMinimaxM2
5140 | Self::MinimaxMinimaxM21
5141 | Self::MinimaxMinimaxM25
5142 | Self::MistralDevstral2123b
5143 | Self::MistralMagistralSmall2509
5144 | Self::MistralMinistral314bInstruct
5145 | Self::MistralMinistral33bInstruct
5146 | Self::MistralMinistral38bInstruct
5147 | Self::MistralMistralLarge3675bInstruct
5148 | Self::MistralPixtralLarge2502V10
5149 | Self::MoonshotKimiK2Thinking
5150 | Self::MoonshotaiKimiK25
5151 | Self::NvidiaNemotronNano12bV2
5152 | Self::NvidiaNemotronNano330b
5153 | Self::NvidiaNemotronNano9bV2
5154 | Self::NvidiaNemotronSuper3120b
5155 | Self::OpenaiGpt54
5156 | Self::OpenaiGpt55
5157 | Self::OpenaiGptOss120b
5158 | Self::OpenaiGptOss120b10
5159 | Self::OpenaiGptOss20b
5160 | Self::OpenaiGptOss20b10
5161 | Self::OpenaiGptOssSafeguard120b
5162 | Self::OpenaiGptOssSafeguard20b
5163 | Self::QwenQwen3235bA22b2507V10
5164 | Self::QwenQwen332bV10
5165 | Self::QwenQwen3Coder30bA3bV10
5166 | Self::QwenQwen3Coder480bA35bV10
5167 | Self::QwenQwen3CoderNext
5168 | Self::QwenQwen3Next80bA3b
5169 | Self::QwenQwen3Vl235bA22b
5170 | Self::UsAnthropicClaudeFable5
5171 | Self::UsAnthropicClaudeHaiku4520251001V10
5172 | Self::UsAnthropicClaudeOpus4120250805V10
5173 | Self::UsAnthropicClaudeOpus4520251101V10
5174 | Self::UsAnthropicClaudeOpus46V1
5175 | Self::UsAnthropicClaudeOpus47
5176 | Self::UsAnthropicClaudeOpus48
5177 | Self::UsAnthropicClaudeSonnet4520250929V10
5178 | Self::UsAnthropicClaudeSonnet46
5179 | Self::UsAnthropicClaudeSonnet5
5180 | Self::UsDeepseekR1V10
5181 | Self::UsMetaLlama4Maverick17bInstructV10
5182 | Self::UsMetaLlama4Scout17bInstructV10
5183 | Self::WriterPalmyraX4V10
5184 | Self::WriterPalmyraX5V10
5185 | Self::XaiGrok43
5186 | Self::ZaiGlm47
5187 | Self::ZaiGlm47Flash
5188 | Self::ZaiGlm5 => false,
5189 Self::MistralVoxtralMini3b2507 | Self::MistralVoxtralSmall24b2507 => true,
5190 }
5191 }
5192 const ALL: &[BedrockFoundationModel] = &[
5193 Self::AmazonNova2LiteV10,
5194 Self::AmazonNovaLiteV10,
5195 Self::AmazonNovaMicroV10,
5196 Self::AmazonNovaProV10,
5197 Self::AnthropicClaudeFable5,
5198 Self::AnthropicClaudeHaiku4520251001V10,
5199 Self::AnthropicClaudeOpus4120250805V10,
5200 Self::AnthropicClaudeOpus4520251101V10,
5201 Self::AnthropicClaudeOpus46V1,
5202 Self::AnthropicClaudeOpus47,
5203 Self::AnthropicClaudeOpus48,
5204 Self::AnthropicClaudeSonnet4520250929V10,
5205 Self::AnthropicClaudeSonnet46,
5206 Self::AnthropicClaudeSonnet5,
5207 Self::AuAnthropicClaudeHaiku4520251001V10,
5208 Self::AuAnthropicClaudeOpus46V1,
5209 Self::AuAnthropicClaudeOpus48,
5210 Self::AuAnthropicClaudeSonnet4520250929V10,
5211 Self::AuAnthropicClaudeSonnet46,
5212 Self::AuAnthropicClaudeSonnet5,
5213 Self::DeepseekR1V10,
5214 Self::DeepseekV3V10,
5215 Self::DeepseekV32,
5216 Self::EuAnthropicClaudeFable5,
5217 Self::EuAnthropicClaudeHaiku4520251001V10,
5218 Self::EuAnthropicClaudeOpus4520251101V10,
5219 Self::EuAnthropicClaudeOpus46V1,
5220 Self::EuAnthropicClaudeOpus47,
5221 Self::EuAnthropicClaudeOpus48,
5222 Self::EuAnthropicClaudeSonnet4520250929V10,
5223 Self::EuAnthropicClaudeSonnet46,
5224 Self::EuAnthropicClaudeSonnet5,
5225 Self::GlobalAnthropicClaudeFable5,
5226 Self::GlobalAnthropicClaudeHaiku4520251001V10,
5227 Self::GlobalAnthropicClaudeOpus4520251101V10,
5228 Self::GlobalAnthropicClaudeOpus46V1,
5229 Self::GlobalAnthropicClaudeOpus47,
5230 Self::GlobalAnthropicClaudeOpus48,
5231 Self::GlobalAnthropicClaudeSonnet4520250929V10,
5232 Self::GlobalAnthropicClaudeSonnet46,
5233 Self::GlobalAnthropicClaudeSonnet5,
5234 Self::GoogleGemma327bIt,
5235 Self::GoogleGemma34bIt,
5236 Self::JpAnthropicClaudeHaiku4520251001V10,
5237 Self::JpAnthropicClaudeOpus47,
5238 Self::JpAnthropicClaudeOpus48,
5239 Self::JpAnthropicClaudeSonnet4520250929V10,
5240 Self::JpAnthropicClaudeSonnet46,
5241 Self::JpAnthropicClaudeSonnet5,
5242 Self::MetaLlama3170bInstructV10,
5243 Self::MetaLlama318bInstructV10,
5244 Self::MetaLlama3370bInstructV10,
5245 Self::MetaLlama4Maverick17bInstructV10,
5246 Self::MetaLlama4Scout17bInstructV10,
5247 Self::MinimaxMinimaxM2,
5248 Self::MinimaxMinimaxM21,
5249 Self::MinimaxMinimaxM25,
5250 Self::MistralDevstral2123b,
5251 Self::MistralMagistralSmall2509,
5252 Self::MistralMinistral314bInstruct,
5253 Self::MistralMinistral33bInstruct,
5254 Self::MistralMinistral38bInstruct,
5255 Self::MistralMistralLarge3675bInstruct,
5256 Self::MistralPixtralLarge2502V10,
5257 Self::MistralVoxtralMini3b2507,
5258 Self::MistralVoxtralSmall24b2507,
5259 Self::MoonshotKimiK2Thinking,
5260 Self::MoonshotaiKimiK25,
5261 Self::NvidiaNemotronNano12bV2,
5262 Self::NvidiaNemotronNano330b,
5263 Self::NvidiaNemotronNano9bV2,
5264 Self::NvidiaNemotronSuper3120b,
5265 Self::OpenaiGpt54,
5266 Self::OpenaiGpt55,
5267 Self::OpenaiGptOss120b,
5268 Self::OpenaiGptOss120b10,
5269 Self::OpenaiGptOss20b,
5270 Self::OpenaiGptOss20b10,
5271 Self::OpenaiGptOssSafeguard120b,
5272 Self::OpenaiGptOssSafeguard20b,
5273 Self::QwenQwen3235bA22b2507V10,
5274 Self::QwenQwen332bV10,
5275 Self::QwenQwen3Coder30bA3bV10,
5276 Self::QwenQwen3Coder480bA35bV10,
5277 Self::QwenQwen3CoderNext,
5278 Self::QwenQwen3Next80bA3b,
5279 Self::QwenQwen3Vl235bA22b,
5280 Self::UsAnthropicClaudeFable5,
5281 Self::UsAnthropicClaudeHaiku4520251001V10,
5282 Self::UsAnthropicClaudeOpus4120250805V10,
5283 Self::UsAnthropicClaudeOpus4520251101V10,
5284 Self::UsAnthropicClaudeOpus46V1,
5285 Self::UsAnthropicClaudeOpus47,
5286 Self::UsAnthropicClaudeOpus48,
5287 Self::UsAnthropicClaudeSonnet4520250929V10,
5288 Self::UsAnthropicClaudeSonnet46,
5289 Self::UsAnthropicClaudeSonnet5,
5290 Self::UsDeepseekR1V10,
5291 Self::UsMetaLlama4Maverick17bInstructV10,
5292 Self::UsMetaLlama4Scout17bInstructV10,
5293 Self::WriterPalmyraX4V10,
5294 Self::WriterPalmyraX5V10,
5295 Self::XaiGrok43,
5296 Self::ZaiGlm47,
5297 Self::ZaiGlm47Flash,
5298 Self::ZaiGlm5,
5299 ];
5300}
5301impl std::str::FromStr for BedrockFoundationModel {
5302 type Err = String;
5303 #[allow(clippy::too_many_lines)]
5304 fn from_str(s: &str) -> Result<Self, Self::Err> {
5305 match s {
5306 "amazon.nova-2-lite-v1:0" => Ok(Self::AmazonNova2LiteV10),
5307 "amazon.nova-lite-v1:0" => Ok(Self::AmazonNovaLiteV10),
5308 "amazon.nova-micro-v1:0" => Ok(Self::AmazonNovaMicroV10),
5309 "amazon.nova-pro-v1:0" => Ok(Self::AmazonNovaProV10),
5310 "anthropic.claude-fable-5" => Ok(Self::AnthropicClaudeFable5),
5311 "anthropic.claude-haiku-4-5-20251001-v1:0" => {
5312 Ok(Self::AnthropicClaudeHaiku4520251001V10)
5313 }
5314 "anthropic.claude-opus-4-1-20250805-v1:0" => {
5315 Ok(Self::AnthropicClaudeOpus4120250805V10)
5316 }
5317 "anthropic.claude-opus-4-5-20251101-v1:0" => {
5318 Ok(Self::AnthropicClaudeOpus4520251101V10)
5319 }
5320 "anthropic.claude-opus-4-6-v1" => Ok(Self::AnthropicClaudeOpus46V1),
5321 "anthropic.claude-opus-4-7" => Ok(Self::AnthropicClaudeOpus47),
5322 "anthropic.claude-opus-4-8" => Ok(Self::AnthropicClaudeOpus48),
5323 "anthropic.claude-sonnet-4-5-20250929-v1:0" => {
5324 Ok(Self::AnthropicClaudeSonnet4520250929V10)
5325 }
5326 "anthropic.claude-sonnet-4-6" => Ok(Self::AnthropicClaudeSonnet46),
5327 "anthropic.claude-sonnet-5" => Ok(Self::AnthropicClaudeSonnet5),
5328 "au.anthropic.claude-haiku-4-5-20251001-v1:0" => {
5329 Ok(Self::AuAnthropicClaudeHaiku4520251001V10)
5330 }
5331 "au.anthropic.claude-opus-4-6-v1" => Ok(Self::AuAnthropicClaudeOpus46V1),
5332 "au.anthropic.claude-opus-4-8" => Ok(Self::AuAnthropicClaudeOpus48),
5333 "au.anthropic.claude-sonnet-4-5-20250929-v1:0" => {
5334 Ok(Self::AuAnthropicClaudeSonnet4520250929V10)
5335 }
5336 "au.anthropic.claude-sonnet-4-6" => Ok(Self::AuAnthropicClaudeSonnet46),
5337 "au.anthropic.claude-sonnet-5" => Ok(Self::AuAnthropicClaudeSonnet5),
5338 "deepseek.r1-v1:0" => Ok(Self::DeepseekR1V10),
5339 "deepseek.v3-v1:0" => Ok(Self::DeepseekV3V10),
5340 "deepseek.v3.2" => Ok(Self::DeepseekV32),
5341 "eu.anthropic.claude-fable-5" => Ok(Self::EuAnthropicClaudeFable5),
5342 "eu.anthropic.claude-haiku-4-5-20251001-v1:0" => {
5343 Ok(Self::EuAnthropicClaudeHaiku4520251001V10)
5344 }
5345 "eu.anthropic.claude-opus-4-5-20251101-v1:0" => {
5346 Ok(Self::EuAnthropicClaudeOpus4520251101V10)
5347 }
5348 "eu.anthropic.claude-opus-4-6-v1" => Ok(Self::EuAnthropicClaudeOpus46V1),
5349 "eu.anthropic.claude-opus-4-7" => Ok(Self::EuAnthropicClaudeOpus47),
5350 "eu.anthropic.claude-opus-4-8" => Ok(Self::EuAnthropicClaudeOpus48),
5351 "eu.anthropic.claude-sonnet-4-5-20250929-v1:0" => {
5352 Ok(Self::EuAnthropicClaudeSonnet4520250929V10)
5353 }
5354 "eu.anthropic.claude-sonnet-4-6" => Ok(Self::EuAnthropicClaudeSonnet46),
5355 "eu.anthropic.claude-sonnet-5" => Ok(Self::EuAnthropicClaudeSonnet5),
5356 "global.anthropic.claude-fable-5" => Ok(Self::GlobalAnthropicClaudeFable5),
5357 "global.anthropic.claude-haiku-4-5-20251001-v1:0" => {
5358 Ok(Self::GlobalAnthropicClaudeHaiku4520251001V10)
5359 }
5360 "global.anthropic.claude-opus-4-5-20251101-v1:0" => {
5361 Ok(Self::GlobalAnthropicClaudeOpus4520251101V10)
5362 }
5363 "global.anthropic.claude-opus-4-6-v1" => {
5364 Ok(Self::GlobalAnthropicClaudeOpus46V1)
5365 }
5366 "global.anthropic.claude-opus-4-7" => Ok(Self::GlobalAnthropicClaudeOpus47),
5367 "global.anthropic.claude-opus-4-8" => Ok(Self::GlobalAnthropicClaudeOpus48),
5368 "global.anthropic.claude-sonnet-4-5-20250929-v1:0" => {
5369 Ok(Self::GlobalAnthropicClaudeSonnet4520250929V10)
5370 }
5371 "global.anthropic.claude-sonnet-4-6" => {
5372 Ok(Self::GlobalAnthropicClaudeSonnet46)
5373 }
5374 "global.anthropic.claude-sonnet-5" => Ok(Self::GlobalAnthropicClaudeSonnet5),
5375 "google.gemma-3-27b-it" => Ok(Self::GoogleGemma327bIt),
5376 "google.gemma-3-4b-it" => Ok(Self::GoogleGemma34bIt),
5377 "jp.anthropic.claude-haiku-4-5-20251001-v1:0" => {
5378 Ok(Self::JpAnthropicClaudeHaiku4520251001V10)
5379 }
5380 "jp.anthropic.claude-opus-4-7" => Ok(Self::JpAnthropicClaudeOpus47),
5381 "jp.anthropic.claude-opus-4-8" => Ok(Self::JpAnthropicClaudeOpus48),
5382 "jp.anthropic.claude-sonnet-4-5-20250929-v1:0" => {
5383 Ok(Self::JpAnthropicClaudeSonnet4520250929V10)
5384 }
5385 "jp.anthropic.claude-sonnet-4-6" => Ok(Self::JpAnthropicClaudeSonnet46),
5386 "jp.anthropic.claude-sonnet-5" => Ok(Self::JpAnthropicClaudeSonnet5),
5387 "meta.llama3-1-70b-instruct-v1:0" => Ok(Self::MetaLlama3170bInstructV10),
5388 "meta.llama3-1-8b-instruct-v1:0" => Ok(Self::MetaLlama318bInstructV10),
5389 "meta.llama3-3-70b-instruct-v1:0" => Ok(Self::MetaLlama3370bInstructV10),
5390 "meta.llama4-maverick-17b-instruct-v1:0" => {
5391 Ok(Self::MetaLlama4Maverick17bInstructV10)
5392 }
5393 "meta.llama4-scout-17b-instruct-v1:0" => {
5394 Ok(Self::MetaLlama4Scout17bInstructV10)
5395 }
5396 "minimax.minimax-m2" => Ok(Self::MinimaxMinimaxM2),
5397 "minimax.minimax-m2.1" => Ok(Self::MinimaxMinimaxM21),
5398 "minimax.minimax-m2.5" => Ok(Self::MinimaxMinimaxM25),
5399 "mistral.devstral-2-123b" => Ok(Self::MistralDevstral2123b),
5400 "mistral.magistral-small-2509" => Ok(Self::MistralMagistralSmall2509),
5401 "mistral.ministral-3-14b-instruct" => Ok(Self::MistralMinistral314bInstruct),
5402 "mistral.ministral-3-3b-instruct" => Ok(Self::MistralMinistral33bInstruct),
5403 "mistral.ministral-3-8b-instruct" => Ok(Self::MistralMinistral38bInstruct),
5404 "mistral.mistral-large-3-675b-instruct" => {
5405 Ok(Self::MistralMistralLarge3675bInstruct)
5406 }
5407 "mistral.pixtral-large-2502-v1:0" => Ok(Self::MistralPixtralLarge2502V10),
5408 "mistral.voxtral-mini-3b-2507" => Ok(Self::MistralVoxtralMini3b2507),
5409 "mistral.voxtral-small-24b-2507" => Ok(Self::MistralVoxtralSmall24b2507),
5410 "moonshot.kimi-k2-thinking" => Ok(Self::MoonshotKimiK2Thinking),
5411 "moonshotai.kimi-k2.5" => Ok(Self::MoonshotaiKimiK25),
5412 "nvidia.nemotron-nano-12b-v2" => Ok(Self::NvidiaNemotronNano12bV2),
5413 "nvidia.nemotron-nano-3-30b" => Ok(Self::NvidiaNemotronNano330b),
5414 "nvidia.nemotron-nano-9b-v2" => Ok(Self::NvidiaNemotronNano9bV2),
5415 "nvidia.nemotron-super-3-120b" => Ok(Self::NvidiaNemotronSuper3120b),
5416 "openai.gpt-5.4" => Ok(Self::OpenaiGpt54),
5417 "openai.gpt-5.5" => Ok(Self::OpenaiGpt55),
5418 "openai.gpt-oss-120b" => Ok(Self::OpenaiGptOss120b),
5419 "openai.gpt-oss-120b-1:0" => Ok(Self::OpenaiGptOss120b10),
5420 "openai.gpt-oss-20b" => Ok(Self::OpenaiGptOss20b),
5421 "openai.gpt-oss-20b-1:0" => Ok(Self::OpenaiGptOss20b10),
5422 "openai.gpt-oss-safeguard-120b" => Ok(Self::OpenaiGptOssSafeguard120b),
5423 "openai.gpt-oss-safeguard-20b" => Ok(Self::OpenaiGptOssSafeguard20b),
5424 "qwen.qwen3-235b-a22b-2507-v1:0" => Ok(Self::QwenQwen3235bA22b2507V10),
5425 "qwen.qwen3-32b-v1:0" => Ok(Self::QwenQwen332bV10),
5426 "qwen.qwen3-coder-30b-a3b-v1:0" => Ok(Self::QwenQwen3Coder30bA3bV10),
5427 "qwen.qwen3-coder-480b-a35b-v1:0" => Ok(Self::QwenQwen3Coder480bA35bV10),
5428 "qwen.qwen3-coder-next" => Ok(Self::QwenQwen3CoderNext),
5429 "qwen.qwen3-next-80b-a3b" => Ok(Self::QwenQwen3Next80bA3b),
5430 "qwen.qwen3-vl-235b-a22b" => Ok(Self::QwenQwen3Vl235bA22b),
5431 "us.anthropic.claude-fable-5" => Ok(Self::UsAnthropicClaudeFable5),
5432 "us.anthropic.claude-haiku-4-5-20251001-v1:0" => {
5433 Ok(Self::UsAnthropicClaudeHaiku4520251001V10)
5434 }
5435 "us.anthropic.claude-opus-4-1-20250805-v1:0" => {
5436 Ok(Self::UsAnthropicClaudeOpus4120250805V10)
5437 }
5438 "us.anthropic.claude-opus-4-5-20251101-v1:0" => {
5439 Ok(Self::UsAnthropicClaudeOpus4520251101V10)
5440 }
5441 "us.anthropic.claude-opus-4-6-v1" => Ok(Self::UsAnthropicClaudeOpus46V1),
5442 "us.anthropic.claude-opus-4-7" => Ok(Self::UsAnthropicClaudeOpus47),
5443 "us.anthropic.claude-opus-4-8" => Ok(Self::UsAnthropicClaudeOpus48),
5444 "us.anthropic.claude-sonnet-4-5-20250929-v1:0" => {
5445 Ok(Self::UsAnthropicClaudeSonnet4520250929V10)
5446 }
5447 "us.anthropic.claude-sonnet-4-6" => Ok(Self::UsAnthropicClaudeSonnet46),
5448 "us.anthropic.claude-sonnet-5" => Ok(Self::UsAnthropicClaudeSonnet5),
5449 "us.deepseek.r1-v1:0" => Ok(Self::UsDeepseekR1V10),
5450 "us.meta.llama4-maverick-17b-instruct-v1:0" => {
5451 Ok(Self::UsMetaLlama4Maverick17bInstructV10)
5452 }
5453 "us.meta.llama4-scout-17b-instruct-v1:0" => {
5454 Ok(Self::UsMetaLlama4Scout17bInstructV10)
5455 }
5456 "writer.palmyra-x4-v1:0" => Ok(Self::WriterPalmyraX4V10),
5457 "writer.palmyra-x5-v1:0" => Ok(Self::WriterPalmyraX5V10),
5458 "xai.grok-4.3" => Ok(Self::XaiGrok43),
5459 "zai.glm-4.7" => Ok(Self::ZaiGlm47),
5460 "zai.glm-4.7-flash" => Ok(Self::ZaiGlm47Flash),
5461 "zai.glm-5" => Ok(Self::ZaiGlm5),
5462 _ => Err(format!("Unknown bedrock model: '{s}'")),
5463 }
5464 }
5465}
5466#[derive(Debug, Clone, PartialEq, Eq, Hash)]
5468pub enum LlmModel {
5469 Anthropic(AnthropicModel),
5470 Codex(CodexModel),
5471 DeepSeek(DeepSeekModel),
5472 Gemini(GeminiModel),
5473 Moonshot(MoonshotModel),
5474 Openai(OpenaiModel),
5475 OpenRouter(OpenRouterModel),
5476 ZAi(ZAiModel),
5477 Bedrock(BedrockModel),
5478 Ollama(String),
5479 LlamaCpp(String),
5480}
5481impl From<AnthropicModel> for LlmModel {
5482 fn from(m: AnthropicModel) -> Self {
5483 LlmModel::Anthropic(m)
5484 }
5485}
5486impl From<CodexModel> for LlmModel {
5487 fn from(m: CodexModel) -> Self {
5488 LlmModel::Codex(m)
5489 }
5490}
5491impl From<DeepSeekModel> for LlmModel {
5492 fn from(m: DeepSeekModel) -> Self {
5493 LlmModel::DeepSeek(m)
5494 }
5495}
5496impl From<GeminiModel> for LlmModel {
5497 fn from(m: GeminiModel) -> Self {
5498 LlmModel::Gemini(m)
5499 }
5500}
5501impl From<MoonshotModel> for LlmModel {
5502 fn from(m: MoonshotModel) -> Self {
5503 LlmModel::Moonshot(m)
5504 }
5505}
5506impl From<OpenaiModel> for LlmModel {
5507 fn from(m: OpenaiModel) -> Self {
5508 LlmModel::Openai(m)
5509 }
5510}
5511impl From<OpenRouterModel> for LlmModel {
5512 fn from(m: OpenRouterModel) -> Self {
5513 LlmModel::OpenRouter(m)
5514 }
5515}
5516impl From<ZAiModel> for LlmModel {
5517 fn from(m: ZAiModel) -> Self {
5518 LlmModel::ZAi(m)
5519 }
5520}
5521impl From<BedrockModel> for LlmModel {
5522 fn from(m: BedrockModel) -> Self {
5523 LlmModel::Bedrock(m)
5524 }
5525}
5526impl LlmModel {
5527 pub fn model_id(&self) -> Cow<'static, str> {
5529 match self {
5530 Self::Anthropic(m) => Cow::Borrowed(m.model_id()),
5531 Self::Codex(m) => Cow::Borrowed(m.model_id()),
5532 Self::DeepSeek(m) => Cow::Borrowed(m.model_id()),
5533 Self::Gemini(m) => Cow::Borrowed(m.model_id()),
5534 Self::Moonshot(m) => Cow::Borrowed(m.model_id()),
5535 Self::Openai(m) => Cow::Borrowed(m.model_id()),
5536 Self::OpenRouter(m) => Cow::Borrowed(m.model_id()),
5537 Self::ZAi(m) => Cow::Borrowed(m.model_id()),
5538 Self::Bedrock(m) => m.model_id(),
5539 Self::Ollama(s) | Self::LlamaCpp(s) => Cow::Owned(s.clone()),
5540 }
5541 }
5542 pub fn display_name(&self) -> Cow<'static, str> {
5544 match self {
5545 Self::Anthropic(m) => Cow::Borrowed(m.display_name()),
5546 Self::Codex(m) => Cow::Borrowed(m.display_name()),
5547 Self::DeepSeek(m) => Cow::Borrowed(m.display_name()),
5548 Self::Gemini(m) => Cow::Borrowed(m.display_name()),
5549 Self::Moonshot(m) => Cow::Borrowed(m.display_name()),
5550 Self::Openai(m) => Cow::Borrowed(m.display_name()),
5551 Self::OpenRouter(m) => Cow::Borrowed(m.display_name()),
5552 Self::ZAi(m) => Cow::Borrowed(m.display_name()),
5553 Self::Bedrock(m) => m.display_name(),
5554 Self::Ollama(s) => Cow::Owned(format!("Ollama {s}")),
5555 Self::LlamaCpp(s) => Cow::Owned(format!("LlamaCpp {s}")),
5556 }
5557 }
5558 pub fn provider(&self) -> &'static str {
5560 match self {
5561 Self::Anthropic(_) => "anthropic",
5562 Self::Codex(_) => "codex",
5563 Self::DeepSeek(_) => "deepseek",
5564 Self::Gemini(_) => "gemini",
5565 Self::Moonshot(_) => "moonshot",
5566 Self::Openai(_) => "openai",
5567 Self::OpenRouter(_) => "openrouter",
5568 Self::ZAi(_) => "zai",
5569 Self::Bedrock(_) => "bedrock",
5570 Self::Ollama(_) => "ollama",
5571 Self::LlamaCpp(_) => "llamacpp",
5572 }
5573 }
5574 pub fn provider_enum(&self) -> Provider {
5576 match self {
5577 Self::Anthropic(_) => Provider::Anthropic,
5578 Self::Codex(_) => Provider::Codex,
5579 Self::DeepSeek(_) => Provider::DeepSeek,
5580 Self::Gemini(_) => Provider::Gemini,
5581 Self::Moonshot(_) => Provider::Moonshot,
5582 Self::Openai(_) => Provider::Openai,
5583 Self::OpenRouter(_) => Provider::OpenRouter,
5584 Self::ZAi(_) => Provider::ZAi,
5585 Self::Bedrock(_) => Provider::Bedrock,
5586 Self::Ollama(_) => Provider::Ollama,
5587 Self::LlamaCpp(_) => Provider::LlamaCpp,
5588 }
5589 }
5590 pub fn provider_display_name(&self) -> &'static str {
5592 match self {
5593 Self::Anthropic(_) => "Anthropic",
5594 Self::Codex(_) => "Codex",
5595 Self::DeepSeek(_) => "DeepSeek",
5596 Self::Gemini(_) => "Gemini",
5597 Self::Moonshot(_) => "Moonshot",
5598 Self::Openai(_) => "OpenAI",
5599 Self::OpenRouter(_) => "OpenRouter",
5600 Self::ZAi(_) => "ZAI",
5601 Self::Bedrock(_) => "AWS Bedrock",
5602 Self::Ollama(_) => "Ollama",
5603 Self::LlamaCpp(_) => "LlamaCpp",
5604 }
5605 }
5606 pub fn context_window(&self) -> Option<u32> {
5608 match self {
5609 Self::Anthropic(m) => Some(m.context_window()),
5610 Self::Codex(m) => Some(m.context_window()),
5611 Self::DeepSeek(m) => Some(m.context_window()),
5612 Self::Gemini(m) => Some(m.context_window()),
5613 Self::Moonshot(m) => Some(m.context_window()),
5614 Self::Openai(m) => Some(m.context_window()),
5615 Self::OpenRouter(m) => Some(m.context_window()),
5616 Self::ZAi(m) => Some(m.context_window()),
5617 Self::Bedrock(m) => m.context_window(),
5618 Self::Ollama(_) | Self::LlamaCpp(_) => None,
5619 }
5620 }
5621 pub fn required_env_var(&self) -> Option<&'static str> {
5623 match self {
5624 Self::Anthropic(_) => Some("ANTHROPIC_API_KEY"),
5625 Self::DeepSeek(_) => Some("DEEPSEEK_API_KEY"),
5626 Self::Gemini(_) => Some("GEMINI_API_KEY"),
5627 Self::Moonshot(_) => Some("MOONSHOT_API_KEY"),
5628 Self::Openai(_) => Some("OPENAI_API_KEY"),
5629 Self::OpenRouter(_) => Some("OPENROUTER_API_KEY"),
5630 Self::ZAi(_) => Some("ZAI_API_KEY"),
5631 Self::Codex(_) | Self::Bedrock(_) | Self::Ollama(_) | Self::LlamaCpp(_) => {
5632 None
5633 }
5634 }
5635 }
5636 pub const ALL_REQUIRED_ENV_VARS: &[&str] = &[
5638 "ANTHROPIC_API_KEY",
5639 "DEEPSEEK_API_KEY",
5640 "GEMINI_API_KEY",
5641 "MOONSHOT_API_KEY",
5642 "OPENAI_API_KEY",
5643 "OPENROUTER_API_KEY",
5644 "ZAI_API_KEY",
5645 ];
5646 pub fn oauth_provider_id(&self) -> Option<&'static str> {
5648 match self {
5649 Self::Codex(_) => Some("codex"),
5650 Self::Anthropic(_)
5651 | Self::DeepSeek(_)
5652 | Self::Gemini(_)
5653 | Self::Moonshot(_)
5654 | Self::Openai(_)
5655 | Self::OpenRouter(_)
5656 | Self::ZAi(_)
5657 | Self::Bedrock(_)
5658 | Self::Ollama(_)
5659 | Self::LlamaCpp(_) => None,
5660 }
5661 }
5662 pub fn reasoning_levels(&self) -> &'static [ReasoningEffort] {
5664 match self {
5665 Self::Anthropic(m) => m.reasoning_levels(),
5666 Self::Codex(m) => m.reasoning_levels(),
5667 Self::DeepSeek(m) => m.reasoning_levels(),
5668 Self::Gemini(m) => m.reasoning_levels(),
5669 Self::Moonshot(m) => m.reasoning_levels(),
5670 Self::Openai(m) => m.reasoning_levels(),
5671 Self::OpenRouter(m) => m.reasoning_levels(),
5672 Self::ZAi(m) => m.reasoning_levels(),
5673 Self::Bedrock(m) => m.reasoning_levels(),
5674 Self::Ollama(_) | Self::LlamaCpp(_) => &[],
5675 }
5676 }
5677 pub fn supports_reasoning(&self) -> bool {
5679 !self.reasoning_levels().is_empty()
5680 }
5681 pub fn supports_prompt_caching(&self) -> bool {
5683 match self {
5684 Self::Anthropic(m) => m.supports_prompt_caching(),
5685 Self::Codex(m) => m.supports_prompt_caching(),
5686 Self::DeepSeek(m) => m.supports_prompt_caching(),
5687 Self::Gemini(m) => m.supports_prompt_caching(),
5688 Self::Moonshot(m) => m.supports_prompt_caching(),
5689 Self::Openai(m) => m.supports_prompt_caching(),
5690 Self::OpenRouter(m) => m.supports_prompt_caching(),
5691 Self::ZAi(m) => m.supports_prompt_caching(),
5692 Self::Bedrock(m) => m.supports_prompt_caching(),
5693 Self::Ollama(_) | Self::LlamaCpp(_) => false,
5694 }
5695 }
5696 pub fn supports_image(&self) -> bool {
5698 match self {
5699 Self::Anthropic(m) => m.supports_image(),
5700 Self::Codex(m) => m.supports_image(),
5701 Self::DeepSeek(m) => m.supports_image(),
5702 Self::Gemini(m) => m.supports_image(),
5703 Self::Moonshot(m) => m.supports_image(),
5704 Self::Openai(m) => m.supports_image(),
5705 Self::OpenRouter(m) => m.supports_image(),
5706 Self::ZAi(m) => m.supports_image(),
5707 Self::Bedrock(m) => m.supports_image(),
5708 Self::Ollama(_) | Self::LlamaCpp(_) => false,
5709 }
5710 }
5711 pub fn supports_audio(&self) -> bool {
5713 match self {
5714 Self::Anthropic(m) => m.supports_audio(),
5715 Self::Codex(m) => m.supports_audio(),
5716 Self::DeepSeek(m) => m.supports_audio(),
5717 Self::Gemini(m) => m.supports_audio(),
5718 Self::Moonshot(m) => m.supports_audio(),
5719 Self::Openai(m) => m.supports_audio(),
5720 Self::OpenRouter(m) => m.supports_audio(),
5721 Self::ZAi(m) => m.supports_audio(),
5722 Self::Bedrock(m) => m.supports_audio(),
5723 Self::Ollama(_) | Self::LlamaCpp(_) => false,
5724 }
5725 }
5726 pub fn all() -> &'static [LlmModel] {
5728 static ALL: LazyLock<Vec<LlmModel>> = LazyLock::new(|| {
5729 let mut v = Vec::new();
5730 v.extend(AnthropicModel::ALL.iter().copied().map(LlmModel::Anthropic));
5731 v.extend(CodexModel::ALL.iter().copied().map(LlmModel::Codex));
5732 v.extend(DeepSeekModel::ALL.iter().copied().map(LlmModel::DeepSeek));
5733 v.extend(GeminiModel::ALL.iter().copied().map(LlmModel::Gemini));
5734 v.extend(MoonshotModel::ALL.iter().copied().map(LlmModel::Moonshot));
5735 v.extend(OpenaiModel::ALL.iter().copied().map(LlmModel::Openai));
5736 v.extend(OpenRouterModel::ALL.iter().copied().map(LlmModel::OpenRouter));
5737 v.extend(ZAiModel::ALL.iter().copied().map(LlmModel::ZAi));
5738 v.extend(
5739 BedrockFoundationModel::ALL
5740 .iter()
5741 .copied()
5742 .map(BedrockModel::Foundation)
5743 .map(LlmModel::Bedrock),
5744 );
5745 v
5746 });
5747 &ALL
5748 }
5749}
5750impl std::fmt::Display for LlmModel {
5751 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5752 write!(f, "{}:{}", self.provider(), self.model_id())
5753 }
5754}
5755impl std::str::FromStr for LlmModel {
5756 type Err = String;
5757 fn from_str(s: &str) -> Result<Self, Self::Err> {
5759 let (provider_str, model_str) = s.split_once(':').unwrap_or((s, ""));
5760 match provider_str {
5761 "anthropic" => model_str.parse::<AnthropicModel>().map(Self::Anthropic),
5762 "codex" => model_str.parse::<CodexModel>().map(Self::Codex),
5763 "deepseek" => model_str.parse::<DeepSeekModel>().map(Self::DeepSeek),
5764 "gemini" => model_str.parse::<GeminiModel>().map(Self::Gemini),
5765 "moonshot" => model_str.parse::<MoonshotModel>().map(Self::Moonshot),
5766 "openai" => model_str.parse::<OpenaiModel>().map(Self::Openai),
5767 "openrouter" => model_str.parse::<OpenRouterModel>().map(Self::OpenRouter),
5768 "zai" => model_str.parse::<ZAiModel>().map(Self::ZAi),
5769 "bedrock" => model_str.parse::<BedrockModel>().map(Self::Bedrock),
5770 "ollama" => Ok(Self::Ollama(model_str.to_string())),
5771 "llamacpp" => Ok(Self::LlamaCpp(model_str.to_string())),
5772 _ => Err(format!("Unknown provider: '{provider_str}'")),
5773 }
5774 }
5775}