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