Created
June 13, 2025 02:25
-
-
Save wangjohn/d366857bb80cf97cf7667dd571da122c to your computer and use it in GitHub Desktop.
LLM fallback article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type ModelCategory string | |
| const ( | |
| Fast ModelCategory = "fast" | |
| Smart ModelCategory = "smart" | |
| Reasoning ModelCategory = "reasoning" | |
| ) | |
| func GetModelForCategory(category ModelCategory, platform ModelPlatform) ModelType { | |
| switch platform { | |
| case ModelPlatformOpenAI: | |
| switch category { | |
| case Fast: return ModelTypeGPT4_1_Mini | |
| case Smart: return ModelTypeGPT4_1 | |
| case Reasoning: return ModelTypeO_3 | |
| } | |
| case ModelPlatformAnthropic: | |
| switch category { | |
| case Fast: return ModelTypeClaude3_5_Haiku | |
| case Smart: return ModelTypeClaude4_Sonnet | |
| case Reasoning: return ModelTypeClaude4_Opus | |
| } | |
| // ... additional platforms | |
| } | |
| return ModelTypeGPT_4_1 // sensible default | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment