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