superqode 0.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. superqode/__init__.py +33 -0
  2. superqode/acp/__init__.py +23 -0
  3. superqode/acp/client.py +913 -0
  4. superqode/acp/permission_screen.py +457 -0
  5. superqode/acp/types.py +480 -0
  6. superqode/acp_discovery.py +856 -0
  7. superqode/agent/__init__.py +22 -0
  8. superqode/agent/edit_strategies.py +334 -0
  9. superqode/agent/loop.py +892 -0
  10. superqode/agent/qe_report_templates.py +39 -0
  11. superqode/agent/system_prompts.py +353 -0
  12. superqode/agent_output.py +721 -0
  13. superqode/agent_stream.py +953 -0
  14. superqode/agents/__init__.py +59 -0
  15. superqode/agents/acp_registry.py +305 -0
  16. superqode/agents/client.py +249 -0
  17. superqode/agents/data/augmentcode.com.toml +51 -0
  18. superqode/agents/data/cagent.dev.toml +51 -0
  19. superqode/agents/data/claude.com.toml +60 -0
  20. superqode/agents/data/codeassistant.dev.toml +51 -0
  21. superqode/agents/data/codex.openai.com.toml +57 -0
  22. superqode/agents/data/fastagent.ai.toml +66 -0
  23. superqode/agents/data/geminicli.com.toml +77 -0
  24. superqode/agents/data/goose.block.xyz.toml +54 -0
  25. superqode/agents/data/junie.jetbrains.com.toml +56 -0
  26. superqode/agents/data/kimi.moonshot.cn.toml +57 -0
  27. superqode/agents/data/llmlingagent.dev.toml +51 -0
  28. superqode/agents/data/molt.bot.toml +49 -0
  29. superqode/agents/data/opencode.ai.toml +60 -0
  30. superqode/agents/data/stakpak.dev.toml +51 -0
  31. superqode/agents/data/vtcode.dev.toml +51 -0
  32. superqode/agents/discovery.py +266 -0
  33. superqode/agents/messaging.py +160 -0
  34. superqode/agents/persona.py +166 -0
  35. superqode/agents/registry.py +421 -0
  36. superqode/agents/schema.py +72 -0
  37. superqode/agents/unified.py +367 -0
  38. superqode/app/__init__.py +111 -0
  39. superqode/app/constants.py +314 -0
  40. superqode/app/css.py +366 -0
  41. superqode/app/models.py +118 -0
  42. superqode/app/suggester.py +125 -0
  43. superqode/app/widgets.py +1591 -0
  44. superqode/app_enhanced.py +399 -0
  45. superqode/app_main.py +17187 -0
  46. superqode/approval.py +312 -0
  47. superqode/atomic.py +296 -0
  48. superqode/commands/__init__.py +1 -0
  49. superqode/commands/acp.py +965 -0
  50. superqode/commands/agents.py +180 -0
  51. superqode/commands/auth.py +278 -0
  52. superqode/commands/config.py +374 -0
  53. superqode/commands/init.py +826 -0
  54. superqode/commands/providers.py +819 -0
  55. superqode/commands/qe.py +1145 -0
  56. superqode/commands/roles.py +380 -0
  57. superqode/commands/serve.py +172 -0
  58. superqode/commands/suggestions.py +127 -0
  59. superqode/commands/superqe.py +460 -0
  60. superqode/config/__init__.py +51 -0
  61. superqode/config/loader.py +812 -0
  62. superqode/config/schema.py +498 -0
  63. superqode/core/__init__.py +111 -0
  64. superqode/core/roles.py +281 -0
  65. superqode/danger.py +386 -0
  66. superqode/data/superqode-template.yaml +1522 -0
  67. superqode/design_system.py +1080 -0
  68. superqode/dialogs/__init__.py +6 -0
  69. superqode/dialogs/base.py +39 -0
  70. superqode/dialogs/model.py +130 -0
  71. superqode/dialogs/provider.py +870 -0
  72. superqode/diff_view.py +919 -0
  73. superqode/enterprise.py +21 -0
  74. superqode/evaluation/__init__.py +25 -0
  75. superqode/evaluation/adapters.py +93 -0
  76. superqode/evaluation/behaviors.py +89 -0
  77. superqode/evaluation/engine.py +209 -0
  78. superqode/evaluation/scenarios.py +96 -0
  79. superqode/execution/__init__.py +36 -0
  80. superqode/execution/linter.py +538 -0
  81. superqode/execution/modes.py +347 -0
  82. superqode/execution/resolver.py +283 -0
  83. superqode/execution/runner.py +642 -0
  84. superqode/file_explorer.py +811 -0
  85. superqode/file_viewer.py +471 -0
  86. superqode/flash.py +183 -0
  87. superqode/guidance/__init__.py +58 -0
  88. superqode/guidance/config.py +203 -0
  89. superqode/guidance/prompts.py +71 -0
  90. superqode/harness/__init__.py +54 -0
  91. superqode/harness/accelerator.py +291 -0
  92. superqode/harness/config.py +319 -0
  93. superqode/harness/validator.py +147 -0
  94. superqode/history.py +279 -0
  95. superqode/integrations/superopt_runner.py +124 -0
  96. superqode/logging/__init__.py +49 -0
  97. superqode/logging/adapters.py +219 -0
  98. superqode/logging/formatter.py +923 -0
  99. superqode/logging/integration.py +341 -0
  100. superqode/logging/sinks.py +170 -0
  101. superqode/logging/unified_log.py +417 -0
  102. superqode/lsp/__init__.py +26 -0
  103. superqode/lsp/client.py +544 -0
  104. superqode/main.py +1069 -0
  105. superqode/mcp/__init__.py +89 -0
  106. superqode/mcp/auth_storage.py +380 -0
  107. superqode/mcp/client.py +1236 -0
  108. superqode/mcp/config.py +319 -0
  109. superqode/mcp/integration.py +337 -0
  110. superqode/mcp/oauth.py +436 -0
  111. superqode/mcp/oauth_callback.py +385 -0
  112. superqode/mcp/types.py +290 -0
  113. superqode/memory/__init__.py +31 -0
  114. superqode/memory/feedback.py +342 -0
  115. superqode/memory/store.py +522 -0
  116. superqode/notifications.py +369 -0
  117. superqode/optimization/__init__.py +5 -0
  118. superqode/optimization/config.py +33 -0
  119. superqode/permissions/__init__.py +25 -0
  120. superqode/permissions/rules.py +488 -0
  121. superqode/plan.py +323 -0
  122. superqode/providers/__init__.py +33 -0
  123. superqode/providers/gateway/__init__.py +165 -0
  124. superqode/providers/gateway/base.py +228 -0
  125. superqode/providers/gateway/litellm_gateway.py +1170 -0
  126. superqode/providers/gateway/openresponses_gateway.py +436 -0
  127. superqode/providers/health.py +297 -0
  128. superqode/providers/huggingface/__init__.py +74 -0
  129. superqode/providers/huggingface/downloader.py +472 -0
  130. superqode/providers/huggingface/endpoints.py +442 -0
  131. superqode/providers/huggingface/hub.py +531 -0
  132. superqode/providers/huggingface/inference.py +394 -0
  133. superqode/providers/huggingface/transformers_runner.py +516 -0
  134. superqode/providers/local/__init__.py +100 -0
  135. superqode/providers/local/base.py +438 -0
  136. superqode/providers/local/discovery.py +418 -0
  137. superqode/providers/local/lmstudio.py +256 -0
  138. superqode/providers/local/mlx.py +457 -0
  139. superqode/providers/local/ollama.py +486 -0
  140. superqode/providers/local/sglang.py +268 -0
  141. superqode/providers/local/tgi.py +260 -0
  142. superqode/providers/local/tool_support.py +477 -0
  143. superqode/providers/local/vllm.py +258 -0
  144. superqode/providers/manager.py +1338 -0
  145. superqode/providers/models.py +1016 -0
  146. superqode/providers/models_dev.py +578 -0
  147. superqode/providers/openresponses/__init__.py +87 -0
  148. superqode/providers/openresponses/converters/__init__.py +17 -0
  149. superqode/providers/openresponses/converters/messages.py +343 -0
  150. superqode/providers/openresponses/converters/tools.py +268 -0
  151. superqode/providers/openresponses/schema/__init__.py +56 -0
  152. superqode/providers/openresponses/schema/models.py +585 -0
  153. superqode/providers/openresponses/streaming/__init__.py +5 -0
  154. superqode/providers/openresponses/streaming/parser.py +338 -0
  155. superqode/providers/openresponses/tools/__init__.py +21 -0
  156. superqode/providers/openresponses/tools/apply_patch.py +352 -0
  157. superqode/providers/openresponses/tools/code_interpreter.py +290 -0
  158. superqode/providers/openresponses/tools/file_search.py +333 -0
  159. superqode/providers/openresponses/tools/mcp_adapter.py +252 -0
  160. superqode/providers/registry.py +716 -0
  161. superqode/providers/usage.py +332 -0
  162. superqode/pure_mode.py +384 -0
  163. superqode/qr/__init__.py +23 -0
  164. superqode/qr/dashboard.py +781 -0
  165. superqode/qr/generator.py +1018 -0
  166. superqode/qr/templates.py +135 -0
  167. superqode/safety/__init__.py +41 -0
  168. superqode/safety/sandbox.py +413 -0
  169. superqode/safety/warnings.py +256 -0
  170. superqode/server/__init__.py +33 -0
  171. superqode/server/lsp_server.py +775 -0
  172. superqode/server/web.py +250 -0
  173. superqode/session/__init__.py +25 -0
  174. superqode/session/persistence.py +580 -0
  175. superqode/session/sharing.py +477 -0
  176. superqode/session.py +475 -0
  177. superqode/sidebar.py +2991 -0
  178. superqode/stream_view.py +648 -0
  179. superqode/styles/__init__.py +3 -0
  180. superqode/superqe/__init__.py +184 -0
  181. superqode/superqe/acp_runner.py +1064 -0
  182. superqode/superqe/constitution/__init__.py +62 -0
  183. superqode/superqe/constitution/evaluator.py +308 -0
  184. superqode/superqe/constitution/loader.py +432 -0
  185. superqode/superqe/constitution/schema.py +250 -0
  186. superqode/superqe/events.py +591 -0
  187. superqode/superqe/frameworks/__init__.py +65 -0
  188. superqode/superqe/frameworks/base.py +234 -0
  189. superqode/superqe/frameworks/e2e.py +263 -0
  190. superqode/superqe/frameworks/executor.py +237 -0
  191. superqode/superqe/frameworks/javascript.py +409 -0
  192. superqode/superqe/frameworks/python.py +373 -0
  193. superqode/superqe/frameworks/registry.py +92 -0
  194. superqode/superqe/mcp_tools/__init__.py +47 -0
  195. superqode/superqe/mcp_tools/core_tools.py +418 -0
  196. superqode/superqe/mcp_tools/registry.py +230 -0
  197. superqode/superqe/mcp_tools/testing_tools.py +167 -0
  198. superqode/superqe/noise.py +89 -0
  199. superqode/superqe/orchestrator.py +778 -0
  200. superqode/superqe/roles.py +609 -0
  201. superqode/superqe/session.py +713 -0
  202. superqode/superqe/skills/__init__.py +57 -0
  203. superqode/superqe/skills/base.py +106 -0
  204. superqode/superqe/skills/core_skills.py +899 -0
  205. superqode/superqe/skills/registry.py +90 -0
  206. superqode/superqe/verifier.py +101 -0
  207. superqode/superqe_cli.py +76 -0
  208. superqode/tool_call.py +358 -0
  209. superqode/tools/__init__.py +93 -0
  210. superqode/tools/agent_tools.py +496 -0
  211. superqode/tools/base.py +324 -0
  212. superqode/tools/batch_tool.py +133 -0
  213. superqode/tools/diagnostics.py +311 -0
  214. superqode/tools/edit_tools.py +653 -0
  215. superqode/tools/enhanced_base.py +515 -0
  216. superqode/tools/file_tools.py +269 -0
  217. superqode/tools/file_tracking.py +45 -0
  218. superqode/tools/lsp_tools.py +610 -0
  219. superqode/tools/network_tools.py +350 -0
  220. superqode/tools/permissions.py +400 -0
  221. superqode/tools/question_tool.py +324 -0
  222. superqode/tools/search_tools.py +598 -0
  223. superqode/tools/shell_tools.py +259 -0
  224. superqode/tools/todo_tools.py +121 -0
  225. superqode/tools/validation.py +80 -0
  226. superqode/tools/web_tools.py +639 -0
  227. superqode/tui.py +1152 -0
  228. superqode/tui_integration.py +875 -0
  229. superqode/tui_widgets/__init__.py +27 -0
  230. superqode/tui_widgets/widgets/__init__.py +18 -0
  231. superqode/tui_widgets/widgets/progress.py +185 -0
  232. superqode/tui_widgets/widgets/tool_display.py +188 -0
  233. superqode/undo_manager.py +574 -0
  234. superqode/utils/__init__.py +5 -0
  235. superqode/utils/error_handling.py +323 -0
  236. superqode/utils/fuzzy.py +257 -0
  237. superqode/widgets/__init__.py +477 -0
  238. superqode/widgets/agent_collab.py +390 -0
  239. superqode/widgets/agent_store.py +936 -0
  240. superqode/widgets/agent_switcher.py +395 -0
  241. superqode/widgets/animation_manager.py +284 -0
  242. superqode/widgets/code_context.py +356 -0
  243. superqode/widgets/command_palette.py +412 -0
  244. superqode/widgets/connection_status.py +537 -0
  245. superqode/widgets/conversation_history.py +470 -0
  246. superqode/widgets/diff_indicator.py +155 -0
  247. superqode/widgets/enhanced_status_bar.py +385 -0
  248. superqode/widgets/enhanced_toast.py +476 -0
  249. superqode/widgets/file_browser.py +809 -0
  250. superqode/widgets/file_reference.py +585 -0
  251. superqode/widgets/issue_timeline.py +340 -0
  252. superqode/widgets/leader_key.py +264 -0
  253. superqode/widgets/mode_switcher.py +445 -0
  254. superqode/widgets/model_picker.py +234 -0
  255. superqode/widgets/permission_preview.py +1205 -0
  256. superqode/widgets/prompt.py +358 -0
  257. superqode/widgets/provider_connect.py +725 -0
  258. superqode/widgets/pty_shell.py +587 -0
  259. superqode/widgets/qe_dashboard.py +321 -0
  260. superqode/widgets/resizable_sidebar.py +377 -0
  261. superqode/widgets/response_changes.py +218 -0
  262. superqode/widgets/response_display.py +528 -0
  263. superqode/widgets/rich_tool_display.py +613 -0
  264. superqode/widgets/sidebar_panels.py +1180 -0
  265. superqode/widgets/slash_complete.py +356 -0
  266. superqode/widgets/split_view.py +612 -0
  267. superqode/widgets/status_bar.py +273 -0
  268. superqode/widgets/superqode_display.py +786 -0
  269. superqode/widgets/thinking_display.py +815 -0
  270. superqode/widgets/throbber.py +87 -0
  271. superqode/widgets/toast.py +206 -0
  272. superqode/widgets/unified_output.py +1073 -0
  273. superqode/workspace/__init__.py +75 -0
  274. superqode/workspace/artifacts.py +472 -0
  275. superqode/workspace/coordinator.py +353 -0
  276. superqode/workspace/diff_tracker.py +429 -0
  277. superqode/workspace/git_guard.py +373 -0
  278. superqode/workspace/git_snapshot.py +526 -0
  279. superqode/workspace/manager.py +750 -0
  280. superqode/workspace/snapshot.py +357 -0
  281. superqode/workspace/watcher.py +535 -0
  282. superqode/workspace/worktree.py +440 -0
  283. superqode-0.1.5.dist-info/METADATA +204 -0
  284. superqode-0.1.5.dist-info/RECORD +288 -0
  285. superqode-0.1.5.dist-info/WHEEL +5 -0
  286. superqode-0.1.5.dist-info/entry_points.txt +3 -0
  287. superqode-0.1.5.dist-info/licenses/LICENSE +648 -0
  288. superqode-0.1.5.dist-info/top_level.txt +1 -0
@@ -0,0 +1,716 @@
1
+ """
2
+ Provider Registry for SuperQode BYOK (Bring Your Own Key) mode.
3
+
4
+ This module defines all supported LLM providers with their configuration,
5
+ environment variables, and metadata. Providers are organized into tiers
6
+ and categories for easy discovery.
7
+
8
+ SECURITY PRINCIPLE: SuperQode NEVER stores API keys.
9
+ All keys are read from user's environment variables at runtime.
10
+ """
11
+
12
+ from dataclasses import dataclass, field
13
+ from enum import Enum
14
+ from typing import Dict, List, Optional
15
+
16
+
17
+ class ProviderTier(Enum):
18
+ """Provider support tier."""
19
+
20
+ TIER1 = 1 # First-class: Tested, documented, recommended
21
+ TIER2 = 2 # Supported: Works via LiteLLM, basic docs
22
+ FREE = 3 # Free tier providers (deprecated - use free_models instead)
23
+ LOCAL = 4 # Local / self-hosted: needs URL only
24
+
25
+
26
+ class ProviderCategory(Enum):
27
+ """Provider category for organization."""
28
+
29
+ US_LABS = "US Labs"
30
+ CHINA_LABS = "China Labs"
31
+ OTHER_LABS = "Other Labs"
32
+ MODEL_HOSTS = "Model Hosts"
33
+ LOCAL = "Local / Self-Hosted"
34
+
35
+
36
+ @dataclass
37
+ class ProviderDef:
38
+ """Definition of an LLM provider."""
39
+
40
+ id: str
41
+ name: str
42
+ tier: ProviderTier
43
+ category: ProviderCategory
44
+ env_vars: List[str]
45
+ litellm_prefix: str
46
+ docs_url: str
47
+ example_models: List[str] = field(default_factory=list)
48
+ optional_env: List[str] = field(default_factory=list)
49
+ base_url_env: Optional[str] = None
50
+ default_base_url: Optional[str] = None
51
+ notes: Optional[str] = None
52
+ free_models: List[str] = field(default_factory=list)
53
+ # Optional hint for how this provider is deployed (for LOCAL providers that also have cloud)
54
+ # Values: "local", "cloud", or None
55
+ deployment_mode: Optional[str] = None
56
+
57
+
58
+ # =============================================================================
59
+ # PROVIDER REGISTRY
60
+ # =============================================================================
61
+
62
+ PROVIDERS: Dict[str, ProviderDef] = {
63
+ # =========================================================================
64
+ # 🇺🇸 US LABS - Tier 1
65
+ # =========================================================================
66
+ "anthropic": ProviderDef(
67
+ id="anthropic",
68
+ name="Anthropic",
69
+ tier=ProviderTier.TIER1,
70
+ category=ProviderCategory.US_LABS,
71
+ env_vars=["ANTHROPIC_API_KEY"],
72
+ litellm_prefix="anthropic/",
73
+ docs_url="https://console.anthropic.com/",
74
+ example_models=[
75
+ "claude-opus-4-5-20251101",
76
+ "claude-sonnet-4-5-20250929",
77
+ "claude-haiku-4-5-20251001",
78
+ "claude-sonnet-4-20250514",
79
+ "claude-opus-4-20250514",
80
+ "claude-haiku-4-20250514",
81
+ ],
82
+ notes="Best for coding tasks. Supports extended thinking.",
83
+ ),
84
+ "openai": ProviderDef(
85
+ id="openai",
86
+ name="OpenAI",
87
+ tier=ProviderTier.TIER1,
88
+ category=ProviderCategory.US_LABS,
89
+ env_vars=["OPENAI_API_KEY"],
90
+ litellm_prefix="",
91
+ base_url_env="OPENAI_API_BASE",
92
+ docs_url="https://platform.openai.com/",
93
+ example_models=[
94
+ "gpt-5.2",
95
+ "gpt-5.2-pro",
96
+ "gpt-5.2-codex",
97
+ "gpt-5.1",
98
+ "gpt-5.1-codex",
99
+ "gpt-5.1-codex-mini",
100
+ "gpt-4o-2024-11-20",
101
+ "gpt-4o",
102
+ "gpt-4o-mini",
103
+ "o1",
104
+ "o1-mini",
105
+ ],
106
+ notes="Most popular. GPT-5.x for latest models, o1 for reasoning tasks.",
107
+ ),
108
+ "google": ProviderDef(
109
+ id="google",
110
+ name="Google AI (Gemini)",
111
+ tier=ProviderTier.TIER1,
112
+ category=ProviderCategory.US_LABS,
113
+ env_vars=["GOOGLE_API_KEY", "GEMINI_API_KEY"],
114
+ litellm_prefix="gemini/",
115
+ docs_url="https://aistudio.google.com/",
116
+ example_models=[
117
+ "gemini-3-pro-preview",
118
+ "gemini-3-flash-preview",
119
+ "gemini-2.5-pro",
120
+ "gemini-2.5-flash",
121
+ "gemini-2.0-flash",
122
+ "gemini-flash-latest",
123
+ ],
124
+ notes="2M token context. Gemini 3 is the latest. Great for large codebases.",
125
+ ),
126
+ "xai": ProviderDef(
127
+ id="xai",
128
+ name="xAI (Grok)",
129
+ tier=ProviderTier.TIER1,
130
+ category=ProviderCategory.US_LABS,
131
+ env_vars=["XAI_API_KEY"],
132
+ litellm_prefix="xai/",
133
+ docs_url="https://console.x.ai/",
134
+ example_models=[
135
+ "grok-3",
136
+ "grok-3-mini",
137
+ "grok-2",
138
+ "grok-beta",
139
+ ],
140
+ notes="Good for coding. Fast inference.",
141
+ ),
142
+ "mistral": ProviderDef(
143
+ id="mistral",
144
+ name="Mistral AI",
145
+ tier=ProviderTier.TIER1,
146
+ category=ProviderCategory.OTHER_LABS,
147
+ env_vars=["MISTRAL_API_KEY"],
148
+ litellm_prefix="mistral/",
149
+ docs_url="https://console.mistral.ai/",
150
+ example_models=[
151
+ "mistral-large-2411",
152
+ "mistral-medium-2505",
153
+ "mistral-nemo",
154
+ "codestral-latest",
155
+ "mistral-small-latest",
156
+ ],
157
+ notes="Codestral is excellent for code generation.",
158
+ ),
159
+ "deepseek": ProviderDef(
160
+ id="deepseek",
161
+ name="DeepSeek",
162
+ tier=ProviderTier.TIER1,
163
+ category=ProviderCategory.CHINA_LABS,
164
+ env_vars=["DEEPSEEK_API_KEY"],
165
+ litellm_prefix="deepseek/",
166
+ docs_url="https://platform.deepseek.com/",
167
+ example_models=[
168
+ "deepseek-ai/DeepSeek-V3.2",
169
+ "deepseek-ai/DeepSeek-R1",
170
+ "deepseek-chat",
171
+ "deepseek-coder",
172
+ "deepseek-reasoner",
173
+ ],
174
+ notes="Extremely cost-effective. V3.2 is latest, R1 for reasoning.",
175
+ ),
176
+ # =========================================================================
177
+ # 🇨🇳 CHINA LABS - Tier 1
178
+ # =========================================================================
179
+ "zhipu": ProviderDef(
180
+ id="zhipu",
181
+ name="Z.AI / Zhipu AI (GLM)",
182
+ tier=ProviderTier.TIER1,
183
+ category=ProviderCategory.CHINA_LABS,
184
+ env_vars=["ZHIPU_API_KEY", "GLM_API_KEY"],
185
+ litellm_prefix="zhipuai/",
186
+ docs_url="https://open.bigmodel.cn/",
187
+ example_models=[
188
+ "glm-4-plus",
189
+ "glm-4",
190
+ "glm-4-air",
191
+ "glm-4-flash",
192
+ "codegeex-4",
193
+ ],
194
+ notes="GLM-4 series. CodeGeeX for coding.",
195
+ ),
196
+ "alibaba": ProviderDef(
197
+ id="alibaba",
198
+ name="Alibaba (Qwen/DashScope)",
199
+ tier=ProviderTier.TIER1,
200
+ category=ProviderCategory.CHINA_LABS,
201
+ env_vars=["DASHSCOPE_API_KEY", "QWEN_API_KEY"],
202
+ litellm_prefix="dashscope/",
203
+ docs_url="https://dashscope.aliyun.com/",
204
+ example_models=[
205
+ "qwen-max",
206
+ "qwen-plus",
207
+ "qwen-turbo",
208
+ "qwen2.5-coder-32b-instruct",
209
+ "qwen2.5-72b-instruct",
210
+ ],
211
+ notes="Qwen 2.5 Coder is excellent. Long context support.",
212
+ ),
213
+ "minimax": ProviderDef(
214
+ id="minimax",
215
+ name="MiniMax",
216
+ tier=ProviderTier.TIER1,
217
+ category=ProviderCategory.CHINA_LABS,
218
+ env_vars=["MINIMAX_API_KEY"],
219
+ optional_env=["MINIMAX_GROUP_ID"],
220
+ litellm_prefix="minimax/",
221
+ docs_url="https://api.minimax.chat/",
222
+ example_models=[
223
+ "abab6.5s-chat",
224
+ "abab6.5-chat",
225
+ "abab5.5-chat",
226
+ ],
227
+ notes="Good multilingual support.",
228
+ ),
229
+ "moonshot": ProviderDef(
230
+ id="moonshot",
231
+ name="Moonshot AI (Kimi)",
232
+ tier=ProviderTier.TIER1,
233
+ category=ProviderCategory.CHINA_LABS,
234
+ env_vars=["MOONSHOT_API_KEY", "KIMI_API_KEY"],
235
+ litellm_prefix="moonshot/",
236
+ docs_url="https://platform.moonshot.cn/",
237
+ example_models=[
238
+ "moonshot-v1-128k",
239
+ "moonshot-v1-32k",
240
+ "moonshot-v1-8k",
241
+ "kimi-k2",
242
+ ],
243
+ notes="Kimi K2 is their latest. 128K context.",
244
+ ),
245
+ "siliconflow": ProviderDef(
246
+ id="siliconflow",
247
+ name="Silicon Flow",
248
+ tier=ProviderTier.TIER1,
249
+ category=ProviderCategory.MODEL_HOSTS,
250
+ env_vars=["SILICONFLOW_API_KEY", "SILICON_API_KEY"],
251
+ litellm_prefix="siliconflow/",
252
+ docs_url="https://siliconflow.cn/",
253
+ example_models=[
254
+ "deepseek-ai/DeepSeek-V3",
255
+ "Qwen/Qwen2.5-72B-Instruct",
256
+ "meta-llama/Llama-3.3-70B-Instruct",
257
+ ],
258
+ notes="Chinese model aggregator. Good pricing.",
259
+ ),
260
+ "baidu": ProviderDef(
261
+ id="baidu",
262
+ name="Baidu (ERNIE)",
263
+ tier=ProviderTier.TIER2,
264
+ category=ProviderCategory.CHINA_LABS,
265
+ env_vars=["QIANFAN_API_KEY"],
266
+ optional_env=["QIANFAN_SECRET_KEY"],
267
+ litellm_prefix="qianfan/",
268
+ docs_url="https://cloud.baidu.com/product/wenxinworkshop",
269
+ example_models=[
270
+ "ernie-4.0-8k",
271
+ "ernie-3.5-8k",
272
+ "ernie-speed-8k",
273
+ ],
274
+ notes="ERNIE series from Baidu.",
275
+ ),
276
+ "doubao": ProviderDef(
277
+ id="doubao",
278
+ name="ByteDance (Doubao)",
279
+ tier=ProviderTier.TIER2,
280
+ category=ProviderCategory.CHINA_LABS,
281
+ env_vars=["DOUBAO_API_KEY", "VOLCENGINE_API_KEY"],
282
+ litellm_prefix="volcengine/",
283
+ docs_url="https://www.volcengine.com/product/doubao",
284
+ example_models=[
285
+ "doubao-pro-32k",
286
+ "doubao-lite-32k",
287
+ ],
288
+ notes="ByteDance's LLM offering.",
289
+ ),
290
+ # =========================================================================
291
+ # 🌐 MODEL HOSTS / AGGREGATORS - Tier 1
292
+ # =========================================================================
293
+ "openrouter": ProviderDef(
294
+ id="openrouter",
295
+ name="OpenRouter",
296
+ tier=ProviderTier.TIER1,
297
+ category=ProviderCategory.MODEL_HOSTS,
298
+ env_vars=["OPENROUTER_API_KEY"],
299
+ litellm_prefix="openrouter/",
300
+ docs_url="https://openrouter.ai/",
301
+ example_models=[
302
+ "anthropic/claude-sonnet-4",
303
+ "openai/gpt-4o",
304
+ "google/gemini-2.0-flash",
305
+ "meta-llama/llama-3.3-70b-instruct",
306
+ ],
307
+ notes="Access 200+ models. Single API key. Auto-fallback.",
308
+ ),
309
+ "together": ProviderDef(
310
+ id="together",
311
+ name="Together AI",
312
+ tier=ProviderTier.TIER1,
313
+ category=ProviderCategory.MODEL_HOSTS,
314
+ env_vars=["TOGETHER_API_KEY", "TOGETHERAI_API_KEY"],
315
+ litellm_prefix="together_ai/",
316
+ docs_url="https://api.together.xyz/",
317
+ example_models=[
318
+ "meta-llama/Llama-3.3-70B-Instruct-Turbo",
319
+ "Qwen/Qwen2.5-Coder-32B-Instruct",
320
+ "deepseek-ai/DeepSeek-R1",
321
+ "mistralai/Mixtral-8x22B-Instruct-v0.1",
322
+ ],
323
+ notes="Fast inference. Good for open-source models.",
324
+ ),
325
+ "groq": ProviderDef(
326
+ id="groq",
327
+ name="Groq",
328
+ tier=ProviderTier.TIER1,
329
+ category=ProviderCategory.MODEL_HOSTS,
330
+ env_vars=["GROQ_API_KEY"],
331
+ litellm_prefix="groq/",
332
+ docs_url="https://console.groq.com/",
333
+ example_models=[
334
+ "llama-3.3-70b-versatile",
335
+ "llama-3.1-8b-instant",
336
+ "mixtral-8x7b-32768",
337
+ "gemma2-9b-it",
338
+ ],
339
+ free_models=[
340
+ "llama-3.1-8b-instant",
341
+ "mixtral-8x7b-32768",
342
+ "gemma2-9b-it",
343
+ ],
344
+ notes="Fastest inference. LPU hardware. Free tier available.",
345
+ ),
346
+ "fireworks": ProviderDef(
347
+ id="fireworks",
348
+ name="Fireworks AI",
349
+ tier=ProviderTier.TIER1,
350
+ category=ProviderCategory.MODEL_HOSTS,
351
+ env_vars=["FIREWORKS_API_KEY"],
352
+ litellm_prefix="fireworks_ai/",
353
+ docs_url="https://fireworks.ai/",
354
+ example_models=[
355
+ "accounts/fireworks/models/llama-v3p3-70b-instruct",
356
+ "accounts/fireworks/models/qwen2p5-coder-32b-instruct",
357
+ "accounts/fireworks/models/deepseek-r1",
358
+ ],
359
+ notes="Fast inference. Good function calling support.",
360
+ ),
361
+ "huggingface": ProviderDef(
362
+ id="huggingface",
363
+ name="Hugging Face",
364
+ tier=ProviderTier.TIER1,
365
+ category=ProviderCategory.MODEL_HOSTS,
366
+ env_vars=["HUGGINGFACE_API_KEY", "HF_TOKEN"],
367
+ litellm_prefix="huggingface/",
368
+ docs_url="https://huggingface.co/inference-api",
369
+ example_models=[
370
+ "meta-llama/Llama-3.3-70B-Instruct",
371
+ "Qwen/Qwen2.5-72B-Instruct",
372
+ "mistralai/Mistral-7B-Instruct-v0.3",
373
+ ],
374
+ notes="Inference API. Access to most open models.",
375
+ ),
376
+ "cerebras": ProviderDef(
377
+ id="cerebras",
378
+ name="Cerebras",
379
+ tier=ProviderTier.TIER2,
380
+ category=ProviderCategory.MODEL_HOSTS,
381
+ env_vars=["CEREBRAS_API_KEY"],
382
+ litellm_prefix="cerebras/",
383
+ docs_url="https://cloud.cerebras.ai/",
384
+ example_models=[
385
+ "llama3.1-8b",
386
+ "llama3.1-70b",
387
+ ],
388
+ notes="Wafer-scale inference. Very fast.",
389
+ ),
390
+ "perplexity": ProviderDef(
391
+ id="perplexity",
392
+ name="Perplexity",
393
+ tier=ProviderTier.TIER2,
394
+ category=ProviderCategory.MODEL_HOSTS,
395
+ env_vars=["PERPLEXITY_API_KEY"],
396
+ litellm_prefix="perplexity/",
397
+ docs_url="https://docs.perplexity.ai/",
398
+ example_models=[
399
+ "sonar-pro",
400
+ "sonar",
401
+ "sonar-reasoning",
402
+ ],
403
+ notes="Built-in web search. Good for research tasks.",
404
+ ),
405
+ "cohere": ProviderDef(
406
+ id="cohere",
407
+ name="Cohere",
408
+ tier=ProviderTier.TIER2,
409
+ category=ProviderCategory.MODEL_HOSTS,
410
+ env_vars=["COHERE_API_KEY"],
411
+ litellm_prefix="cohere/",
412
+ docs_url="https://dashboard.cohere.com/",
413
+ example_models=[
414
+ "command-r-plus",
415
+ "command-r",
416
+ "command",
417
+ ],
418
+ notes="Good for RAG and enterprise use cases.",
419
+ ),
420
+ # =========================================================================
421
+ # 🆓 FREE TIER PROVIDERS (by pricing) - Tier 1
422
+ # =========================================================================
423
+ "opencode": ProviderDef(
424
+ id="opencode",
425
+ name="OpenCode Zen",
426
+ tier=ProviderTier.TIER1,
427
+ category=ProviderCategory.MODEL_HOSTS,
428
+ env_vars=["OPENCODE_API_KEY"],
429
+ litellm_prefix="openai/",
430
+ base_url_env="OPENCODE_BASE_URL",
431
+ default_base_url="https://api.opencode.ai/v1",
432
+ docs_url="https://opencode.ai/docs/providers/opencode-zen",
433
+ example_models=[
434
+ "glm-4.7-free",
435
+ "grok-code",
436
+ "gpt-5-nano",
437
+ "minimax-m2.1-free",
438
+ "big-pickle",
439
+ ],
440
+ free_models=[
441
+ "glm-4.7-free",
442
+ "grok-code",
443
+ "gpt-5-nano",
444
+ "minimax-m2.1-free",
445
+ "big-pickle",
446
+ ],
447
+ notes="Free models from OpenCode. Some require API key for paid tiers.",
448
+ ),
449
+ "github-copilot": ProviderDef(
450
+ id="github-copilot",
451
+ name="GitHub Copilot",
452
+ tier=ProviderTier.TIER1,
453
+ category=ProviderCategory.MODEL_HOSTS,
454
+ env_vars=["GITHUB_TOKEN"],
455
+ litellm_prefix="github/",
456
+ docs_url="https://github.com/features/copilot",
457
+ example_models=[
458
+ "gpt-4o",
459
+ "claude-3.5-sonnet",
460
+ "o1-mini",
461
+ "o1-preview",
462
+ ],
463
+ notes="Requires GitHub Pro/Enterprise subscription. OAuth flow required.",
464
+ ),
465
+ # =========================================================================
466
+ # ☁️ CLOUD PLATFORMS / MODEL HOSTS - Tier 2
467
+ # =========================================================================
468
+ "amazon-bedrock": ProviderDef(
469
+ id="amazon-bedrock",
470
+ name="Amazon Bedrock",
471
+ tier=ProviderTier.TIER2,
472
+ category=ProviderCategory.US_LABS,
473
+ env_vars=["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"],
474
+ optional_env=["AWS_REGION", "AWS_PROFILE", "AWS_BEARER_TOKEN_BEDROCK"],
475
+ litellm_prefix="bedrock/",
476
+ docs_url="https://aws.amazon.com/bedrock/",
477
+ example_models=[
478
+ "anthropic.claude-3-5-sonnet-20241022-v2:0",
479
+ "anthropic.claude-3-haiku-20240307-v1:0",
480
+ "amazon.nova-pro-v1:0",
481
+ "meta.llama3-1-70b-instruct-v1:0",
482
+ ],
483
+ notes="AWS managed. Supports Claude, Llama, Nova.",
484
+ ),
485
+ "azure": ProviderDef(
486
+ id="azure",
487
+ name="Azure OpenAI",
488
+ tier=ProviderTier.TIER2,
489
+ category=ProviderCategory.MODEL_HOSTS,
490
+ env_vars=["AZURE_API_KEY", "AZURE_API_BASE"],
491
+ optional_env=["AZURE_API_VERSION", "AZURE_DEPLOYMENT_NAME"],
492
+ litellm_prefix="azure/",
493
+ docs_url="https://azure.microsoft.com/products/ai-services/openai-service",
494
+ example_models=[
495
+ "gpt-4o",
496
+ "gpt-4-turbo",
497
+ "gpt-35-turbo",
498
+ ],
499
+ notes="Enterprise Azure. Use deployment names as model IDs.",
500
+ ),
501
+ "vertex": ProviderDef(
502
+ id="vertex",
503
+ name="Google Vertex AI",
504
+ tier=ProviderTier.TIER2,
505
+ category=ProviderCategory.MODEL_HOSTS,
506
+ env_vars=["GOOGLE_APPLICATION_CREDENTIALS"],
507
+ optional_env=["VERTEX_PROJECT", "VERTEX_LOCATION"],
508
+ litellm_prefix="vertex_ai/",
509
+ docs_url="https://cloud.google.com/vertex-ai",
510
+ example_models=[
511
+ "gemini-1.5-pro",
512
+ "gemini-1.5-flash",
513
+ "claude-3-5-sonnet@20241022",
514
+ ],
515
+ notes="GCP managed. Supports Gemini and Claude.",
516
+ ),
517
+ "cloudflare": ProviderDef(
518
+ id="cloudflare",
519
+ name="Cloudflare AI Gateway",
520
+ tier=ProviderTier.TIER2,
521
+ category=ProviderCategory.MODEL_HOSTS,
522
+ env_vars=["CLOUDFLARE_API_TOKEN"],
523
+ optional_env=["CLOUDFLARE_ACCOUNT_ID", "CLOUDFLARE_GATEWAY_ID"],
524
+ litellm_prefix="cloudflare/",
525
+ docs_url="https://developers.cloudflare.com/ai-gateway/",
526
+ example_models=[
527
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
528
+ "@cf/qwen/qwen2.5-coder-32b-instruct",
529
+ ],
530
+ notes="Edge inference. Unified billing across providers.",
531
+ ),
532
+ # =========================================================================
533
+ # 🏠 LOCAL/SELF-HOSTED - Local Tier
534
+ # =========================================================================
535
+ "ollama": ProviderDef(
536
+ id="ollama",
537
+ name="Ollama",
538
+ tier=ProviderTier.LOCAL,
539
+ category=ProviderCategory.LOCAL,
540
+ env_vars=[],
541
+ base_url_env="OLLAMA_HOST",
542
+ default_base_url="http://localhost:11434",
543
+ litellm_prefix="ollama/",
544
+ docs_url="https://ollama.ai/",
545
+ example_models=[
546
+ "llama3.2:3b",
547
+ "llama3.2:1b",
548
+ "qwen2.5-coder:7b",
549
+ "qwen2.5-coder:32b",
550
+ "codellama:7b",
551
+ "deepseek-coder-v2:16b",
552
+ "mistral:7b",
553
+ ],
554
+ notes="Local models. Run: ollama pull <model>",
555
+ deployment_mode="local",
556
+ ),
557
+ "ollama-cloud": ProviderDef(
558
+ id="ollama-cloud",
559
+ name="Ollama Cloud",
560
+ tier=ProviderTier.LOCAL,
561
+ category=ProviderCategory.LOCAL,
562
+ env_vars=["OLLAMA_API_KEY"],
563
+ litellm_prefix="ollama/",
564
+ base_url_env="OLLAMA_HOST",
565
+ default_base_url="https://api.ollama.com",
566
+ docs_url="https://ollama.com/",
567
+ example_models=[
568
+ "llama3.2:3b",
569
+ "qwen2.5-coder:7b",
570
+ ],
571
+ notes="Ollama's hosted cloud service.",
572
+ deployment_mode="cloud",
573
+ ),
574
+ "lmstudio": ProviderDef(
575
+ id="lmstudio",
576
+ name="LM Studio",
577
+ tier=ProviderTier.LOCAL,
578
+ category=ProviderCategory.LOCAL,
579
+ env_vars=[],
580
+ base_url_env="LMSTUDIO_HOST",
581
+ default_base_url="http://localhost:1234/v1", # LM Studio serves at /v1
582
+ litellm_prefix="openai/",
583
+ docs_url="https://lmstudio.ai/",
584
+ example_models=[
585
+ "local-model",
586
+ ],
587
+ notes="GUI for local models. OpenAI-compatible API. Default: http://localhost:1234/v1",
588
+ ),
589
+ "mlx": ProviderDef(
590
+ id="mlx",
591
+ name="MLX (Apple Silicon)",
592
+ tier=ProviderTier.LOCAL,
593
+ category=ProviderCategory.LOCAL,
594
+ env_vars=[],
595
+ base_url_env="MLX_HOST",
596
+ default_base_url="http://localhost:8080/v1",
597
+ litellm_prefix="openai/",
598
+ docs_url="https://github.com/ml-explore/mlx-lm",
599
+ example_models=[
600
+ "mlx-community/Qwen2.5-Coder-32B-Instruct-4bit",
601
+ "mlx-community/Mistral-7B-Instruct-v0.1",
602
+ "mlx-community/Llama-2-7b-chat-hf",
603
+ "SuperagenticAI/gpt-oss-20b-8bit-mlx",
604
+ "mlx-community/Phi-2",
605
+ "mlx-community/OpenHermes-2.5-Mistral-7B",
606
+ ],
607
+ notes="Apple Silicon optimized. Run: mlx_lm.server --model <model-id>",
608
+ ),
609
+ "vllm": ProviderDef(
610
+ id="vllm",
611
+ name="vLLM",
612
+ tier=ProviderTier.LOCAL,
613
+ category=ProviderCategory.LOCAL,
614
+ env_vars=[],
615
+ base_url_env="VLLM_HOST",
616
+ default_base_url="http://localhost:8000/v1",
617
+ litellm_prefix="openai/",
618
+ docs_url="https://docs.vllm.ai/",
619
+ example_models=[
620
+ "meta-llama/Llama-3.3-70B-Instruct",
621
+ ],
622
+ notes="High-throughput serving. PagedAttention.",
623
+ ),
624
+ "sglang": ProviderDef(
625
+ id="sglang",
626
+ name="SGLang",
627
+ tier=ProviderTier.LOCAL,
628
+ category=ProviderCategory.LOCAL,
629
+ env_vars=[],
630
+ base_url_env="SGLANG_HOST",
631
+ default_base_url="http://localhost:30000/v1",
632
+ litellm_prefix="openai/",
633
+ docs_url="https://github.com/sgl-project/sglang",
634
+ example_models=[
635
+ "meta-llama/Llama-3.3-70B-Instruct",
636
+ ],
637
+ notes="Fast structured generation. RadixAttention.",
638
+ ),
639
+ "tgi": ProviderDef(
640
+ id="tgi",
641
+ name="TGI (Text Generation Inference)",
642
+ tier=ProviderTier.LOCAL,
643
+ category=ProviderCategory.LOCAL,
644
+ env_vars=[],
645
+ base_url_env="TGI_HOST",
646
+ default_base_url="http://localhost:8080",
647
+ litellm_prefix="huggingface/",
648
+ docs_url="https://huggingface.co/docs/text-generation-inference",
649
+ example_models=[
650
+ "meta-llama/Llama-3.3-70B-Instruct",
651
+ ],
652
+ notes="HuggingFace's inference server. Production-ready.",
653
+ ),
654
+ "llamacpp": ProviderDef(
655
+ id="llamacpp",
656
+ name="llama.cpp Server",
657
+ tier=ProviderTier.LOCAL,
658
+ category=ProviderCategory.LOCAL,
659
+ env_vars=[],
660
+ base_url_env="LLAMACPP_HOST",
661
+ default_base_url="http://localhost:8080/v1",
662
+ litellm_prefix="openai/",
663
+ docs_url="https://github.com/ggerganov/llama.cpp",
664
+ example_models=[
665
+ "local-model",
666
+ ],
667
+ notes="CPU/GPU inference. GGUF format models.",
668
+ ),
669
+ "openai-compatible": ProviderDef(
670
+ id="openai-compatible",
671
+ name="OpenAI-Compatible (Custom)",
672
+ tier=ProviderTier.LOCAL,
673
+ category=ProviderCategory.LOCAL,
674
+ env_vars=["OPENAI_COMPATIBLE_API_KEY"],
675
+ base_url_env="OPENAI_COMPATIBLE_BASE_URL",
676
+ litellm_prefix="openai/",
677
+ docs_url="",
678
+ example_models=[],
679
+ notes="Any OpenAI-compatible API endpoint.",
680
+ ),
681
+ }
682
+
683
+
684
+ # =============================================================================
685
+ # HELPER FUNCTIONS
686
+ # =============================================================================
687
+
688
+
689
+ def get_provider(provider_id: str) -> Optional[ProviderDef]:
690
+ """Get a provider definition by ID."""
691
+ return PROVIDERS.get(provider_id)
692
+
693
+
694
+ def get_providers_by_category(category: ProviderCategory) -> Dict[str, ProviderDef]:
695
+ """Get all providers in a category."""
696
+ return {k: v for k, v in PROVIDERS.items() if v.category == category}
697
+
698
+
699
+ def get_providers_by_tier(tier: ProviderTier) -> Dict[str, ProviderDef]:
700
+ """Get all providers in a tier."""
701
+ return {k: v for k, v in PROVIDERS.items() if v.tier == tier}
702
+
703
+
704
+ def get_all_provider_ids() -> List[str]:
705
+ """Get all provider IDs."""
706
+ return list(PROVIDERS.keys())
707
+
708
+
709
+ def get_free_providers() -> Dict[str, ProviderDef]:
710
+ """Get providers with free tiers or free models."""
711
+ return {k: v for k, v in PROVIDERS.items() if v.free_models}
712
+
713
+
714
+ def get_local_providers() -> Dict[str, ProviderDef]:
715
+ """Get local/self-hosted providers."""
716
+ return {k: v for k, v in PROVIDERS.items() if v.category == ProviderCategory.LOCAL}