modelparams 0.0.1__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.

Potentially problematic release.


This version of modelparams might be problematic. Click here for more details.

@@ -0,0 +1,270 @@
1
+ # AUTO-GENERATED by packages/modelparams-python/scripts/codegen.ts.
2
+ # Do not edit by hand; the YAML catalog under /models is the source of truth.
3
+
4
+ from typing import Any
5
+
6
+ from modelparams.types import alibaba
7
+ from modelparams.types import anthropic
8
+ from modelparams.types import cerebras
9
+ from modelparams.types import cohere
10
+ from modelparams.types import deepseek
11
+ from modelparams.types import google
12
+ from modelparams.types import groq
13
+ from modelparams.types import meta
14
+ from modelparams.types import minimax
15
+ from modelparams.types import mistral
16
+ from modelparams.types import moonshot
17
+ from modelparams.types import nvidia
18
+ from modelparams.types import openai
19
+ from modelparams.types import perplexity
20
+ from modelparams.types import thinking_machines
21
+ from modelparams.types import xai
22
+ from modelparams.types import xiaomi
23
+ from modelparams.types import z_ai
24
+
25
+ from .model_ids import ModelId
26
+
27
+ PARAM_TYPES: dict[ModelId, Any] = {
28
+ "alibaba/qwen-flash": alibaba.Qwen_FlashParams,
29
+ "alibaba/qwen-plus": alibaba.Qwen_PlusParams,
30
+ "alibaba/qwen3-coder-flash": alibaba.Qwen3_Coder_FlashParams,
31
+ "alibaba/qwen3-coder-plus": alibaba.Qwen3_Coder_PlusParams,
32
+ "alibaba/qwen3-max": alibaba.Qwen3_MaxParams,
33
+ "alibaba/qwen3.5": alibaba.Qwen3_5Params,
34
+ "alibaba/qwen3.5-flash": alibaba.Qwen3_5_FlashParams,
35
+ "alibaba/qwen3.6-flash": alibaba.Qwen3_6_FlashParams,
36
+ "alibaba/qwen3.7-max": alibaba.Qwen3_7_MaxParams,
37
+ "alibaba/qwen3.7-plus": alibaba.Qwen3_7_PlusParams,
38
+ "alibaba/qwen3.8-max": alibaba.Qwen3_8_MaxParams,
39
+ "alibaba/qwq-plus": alibaba.Qwq_PlusParams,
40
+ "anthropic/claude-3-5-haiku-20241022": anthropic.Claude_3_5_Haiku_20241022Params,
41
+ "anthropic/claude-3-5-haiku-latest": anthropic.Claude_3_5_Haiku_LatestParams,
42
+ "anthropic/claude-3-5-sonnet-20241022": anthropic.Claude_3_5_Sonnet_20241022Params,
43
+ "anthropic/claude-3-5-sonnet-latest": anthropic.Claude_3_5_Sonnet_LatestParams,
44
+ "anthropic/claude-3-7-sonnet-20250219": anthropic.Claude_3_7_Sonnet_20250219Params,
45
+ "anthropic/claude-3-7-sonnet-latest": anthropic.Claude_3_7_Sonnet_LatestParams,
46
+ "anthropic/claude-3-opus-20240229": anthropic.Claude_3_Opus_20240229Params,
47
+ "anthropic/claude-3-opus-latest": anthropic.Claude_3_Opus_LatestParams,
48
+ "anthropic/claude-fable-5": anthropic.Claude_Fable_5Params,
49
+ "anthropic/claude-fable-5-subscription": anthropic.Claude_Fable_5_SubscriptionParams,
50
+ "anthropic/claude-haiku-4": anthropic.Claude_Haiku_4Params,
51
+ "anthropic/claude-haiku-4-5": anthropic.Claude_Haiku_4_5Params,
52
+ "anthropic/claude-haiku-4-5-20251001": anthropic.Claude_Haiku_4_5_20251001Params,
53
+ "anthropic/claude-haiku-4-5-20251001-subscription": anthropic.Claude_Haiku_4_5_20251001_SubscriptionParams,
54
+ "anthropic/claude-haiku-4-5-subscription": anthropic.Claude_Haiku_4_5_SubscriptionParams,
55
+ "anthropic/claude-haiku-4-subscription": anthropic.Claude_Haiku_4_SubscriptionParams,
56
+ "anthropic/claude-opus-4-1-20250805": anthropic.Claude_Opus_4_1_20250805Params,
57
+ "anthropic/claude-opus-4-1-20250805-subscription": anthropic.Claude_Opus_4_1_20250805_SubscriptionParams,
58
+ "anthropic/claude-opus-4-20250514": anthropic.Claude_Opus_4_20250514Params,
59
+ "anthropic/claude-opus-4-20250514-subscription": anthropic.Claude_Opus_4_20250514_SubscriptionParams,
60
+ "anthropic/claude-opus-4-5-20251101": anthropic.Claude_Opus_4_5_20251101Params,
61
+ "anthropic/claude-opus-4-5-20251101-subscription": anthropic.Claude_Opus_4_5_20251101_SubscriptionParams,
62
+ "anthropic/claude-opus-4-6": anthropic.Claude_Opus_4_6Params,
63
+ "anthropic/claude-opus-4-6-subscription": anthropic.Claude_Opus_4_6_SubscriptionParams,
64
+ "anthropic/claude-opus-4-7": anthropic.Claude_Opus_4_7Params,
65
+ "anthropic/claude-opus-4-7-subscription": anthropic.Claude_Opus_4_7_SubscriptionParams,
66
+ "anthropic/claude-opus-4-8": anthropic.Claude_Opus_4_8Params,
67
+ "anthropic/claude-opus-4-8-subscription": anthropic.Claude_Opus_4_8_SubscriptionParams,
68
+ "anthropic/claude-opus-4-subscription": anthropic.Claude_Opus_4_SubscriptionParams,
69
+ "anthropic/claude-opus-5": anthropic.Claude_Opus_5Params,
70
+ "anthropic/claude-opus-5-subscription": anthropic.Claude_Opus_5_SubscriptionParams,
71
+ "anthropic/claude-sonnet-4-20250514": anthropic.Claude_Sonnet_4_20250514Params,
72
+ "anthropic/claude-sonnet-4-20250514-subscription": anthropic.Claude_Sonnet_4_20250514_SubscriptionParams,
73
+ "anthropic/claude-sonnet-4-5": anthropic.Claude_Sonnet_4_5Params,
74
+ "anthropic/claude-sonnet-4-5-20250929": anthropic.Claude_Sonnet_4_5_20250929Params,
75
+ "anthropic/claude-sonnet-4-5-20250929-subscription": anthropic.Claude_Sonnet_4_5_20250929_SubscriptionParams,
76
+ "anthropic/claude-sonnet-4-5-subscription": anthropic.Claude_Sonnet_4_5_SubscriptionParams,
77
+ "anthropic/claude-sonnet-4-6": anthropic.Claude_Sonnet_4_6Params,
78
+ "anthropic/claude-sonnet-4-6-subscription": anthropic.Claude_Sonnet_4_6_SubscriptionParams,
79
+ "anthropic/claude-sonnet-4-subscription": anthropic.Claude_Sonnet_4_SubscriptionParams,
80
+ "anthropic/claude-sonnet-5": anthropic.Claude_Sonnet_5Params,
81
+ "cerebras/zai-glm-4.7": cerebras.Zai_Glm_4_7Params,
82
+ "cohere/command-a-03-2025": cohere.Command_A_03_2025Params,
83
+ "cohere/command-a-plus-05-2026": cohere.Command_A_Plus_05_2026Params,
84
+ "cohere/command-a-reasoning-08-2025": cohere.Command_A_Reasoning_08_2025Params,
85
+ "cohere/command-a-translate-08-2025": cohere.Command_A_Translate_08_2025Params,
86
+ "cohere/command-a-vision-07-2025": cohere.Command_A_Vision_07_2025Params,
87
+ "cohere/command-r-08-2024": cohere.Command_R_08_2024Params,
88
+ "cohere/command-r-plus-08-2024": cohere.Command_R_Plus_08_2024Params,
89
+ "cohere/command-r7b-12-2024": cohere.Command_R7b_12_2024Params,
90
+ "deepseek/deepseek-chat": deepseek.Deepseek_ChatParams,
91
+ "deepseek/deepseek-reasoner": deepseek.Deepseek_ReasonerParams,
92
+ "deepseek/deepseek-v4-flash": deepseek.Deepseek_V4_FlashParams,
93
+ "deepseek/deepseek-v4-pro": deepseek.Deepseek_V4_ProParams,
94
+ "google/gemini-2.5-flash": google.Gemini_2_5_FlashParams,
95
+ "google/gemini-2.5-flash-lite": google.Gemini_2_5_Flash_LiteParams,
96
+ "google/gemini-2.5-flash-lite-subscription": google.Gemini_2_5_Flash_Lite_SubscriptionParams,
97
+ "google/gemini-2.5-flash-subscription": google.Gemini_2_5_Flash_SubscriptionParams,
98
+ "google/gemini-2.5-pro": google.Gemini_2_5_ProParams,
99
+ "google/gemini-2.5-pro-subscription": google.Gemini_2_5_Pro_SubscriptionParams,
100
+ "google/gemini-3-flash-preview-subscription": google.Gemini_3_Flash_Preview_SubscriptionParams,
101
+ "google/gemini-3.1-flash-lite": google.Gemini_3_1_Flash_LiteParams,
102
+ "google/gemini-3.1-flash-lite-preview-subscription": google.Gemini_3_1_Flash_Lite_Preview_SubscriptionParams,
103
+ "google/gemini-3.1-flash-lite-subscription": google.Gemini_3_1_Flash_Lite_SubscriptionParams,
104
+ "google/gemini-3.1-pro-preview-subscription": google.Gemini_3_1_Pro_Preview_SubscriptionParams,
105
+ "google/gemini-3.5-flash": google.Gemini_3_5_FlashParams,
106
+ "google/gemini-flash-latest": google.Gemini_Flash_LatestParams,
107
+ "google/gemma-3-12b-it": google.Gemma_3_12b_ItParams,
108
+ "google/gemma-3-1b-it": google.Gemma_3_1b_ItParams,
109
+ "google/gemma-3-27b-it": google.Gemma_3_27b_ItParams,
110
+ "google/gemma-3-4b-it": google.Gemma_3_4b_ItParams,
111
+ "google/gemma-3n-E2B-it": google.Gemma_3n_E2b_ItParams,
112
+ "google/gemma-3n-E4B-it": google.Gemma_3n_E4b_ItParams,
113
+ "google/gemma-4-12B-it": google.Gemma_4_12b_ItParams,
114
+ "google/gemma-4-26b-a4b-it": google.Gemma_4_26b_A4b_ItParams,
115
+ "google/gemma-4-31b-it": google.Gemma_4_31b_ItParams,
116
+ "google/gemma-4-E2B-it": google.Gemma_4_E2b_ItParams,
117
+ "google/gemma-4-E4B-it": google.Gemma_4_E4b_ItParams,
118
+ "groq/qwen3-32b": groq.Qwen3_32bParams,
119
+ "meta/Llama-3.3-70B-Instruct": meta.Llama_3_3_70b_InstructParams,
120
+ "meta/Llama-3.3-8B-Instruct": meta.Llama_3_3_8b_InstructParams,
121
+ "meta/Llama-4-Maverick-17B-128E-Instruct-FP8": meta.Llama_4_Maverick_17b_128e_Instruct_Fp8Params,
122
+ "meta/Llama-4-Scout-17B-16E-Instruct-FP8": meta.Llama_4_Scout_17b_16e_Instruct_Fp8Params,
123
+ "minimax/minimax-m2": minimax.Minimax_M2Params,
124
+ "minimax/MiniMax-M2-subscription": minimax.Minimax_M2_SubscriptionParams,
125
+ "minimax/minimax-m2.1": minimax.Minimax_M2_1Params,
126
+ "minimax/minimax-m2.1-highspeed": minimax.Minimax_M2_1_HighspeedParams,
127
+ "minimax/MiniMax-M2.1-highspeed-subscription": minimax.Minimax_M2_1_Highspeed_SubscriptionParams,
128
+ "minimax/MiniMax-M2.1-subscription": minimax.Minimax_M2_1_SubscriptionParams,
129
+ "minimax/minimax-m2.5": minimax.Minimax_M2_5Params,
130
+ "minimax/minimax-m2.5-highspeed": minimax.Minimax_M2_5_HighspeedParams,
131
+ "minimax/MiniMax-M2.5-highspeed-subscription": minimax.Minimax_M2_5_Highspeed_SubscriptionParams,
132
+ "minimax/MiniMax-M2.5-subscription": minimax.Minimax_M2_5_SubscriptionParams,
133
+ "minimax/minimax-m2.7": minimax.Minimax_M2_7Params,
134
+ "minimax/minimax-m2.7-highspeed": minimax.Minimax_M2_7_HighspeedParams,
135
+ "minimax/MiniMax-M2.7-highspeed-subscription": minimax.Minimax_M2_7_Highspeed_SubscriptionParams,
136
+ "minimax/MiniMax-M2.7-subscription": minimax.Minimax_M2_7_SubscriptionParams,
137
+ "minimax/minimax-m3": minimax.Minimax_M3Params,
138
+ "minimax/MiniMax-M3-subscription": minimax.Minimax_M3_SubscriptionParams,
139
+ "mistral/codestral-latest": mistral.Codestral_LatestParams,
140
+ "mistral/devstral-2512": mistral.Devstral_2512Params,
141
+ "mistral/devstral-latest": mistral.Devstral_LatestParams,
142
+ "mistral/magistral-medium-latest": mistral.Magistral_Medium_LatestParams,
143
+ "mistral/magistral-small-latest": mistral.Magistral_Small_LatestParams,
144
+ "mistral/ministral-14b-latest": mistral.Ministral_14b_LatestParams,
145
+ "mistral/ministral-3b-latest": mistral.Ministral_3b_LatestParams,
146
+ "mistral/ministral-8b-latest": mistral.Ministral_8b_LatestParams,
147
+ "mistral/mistral-large-latest": mistral.Mistral_Large_LatestParams,
148
+ "mistral/mistral-medium-3.5": mistral.Mistral_Medium_3_5Params,
149
+ "mistral/mistral-medium-latest": mistral.Mistral_Medium_LatestParams,
150
+ "mistral/mistral-small-latest": mistral.Mistral_Small_LatestParams,
151
+ "mistral/open-mistral-nemo": mistral.Open_Mistral_NemoParams,
152
+ "moonshot/kimi-k2.5": moonshot.Kimi_K2_5Params,
153
+ "moonshot/kimi-k2.6": moonshot.Kimi_K2_6Params,
154
+ "moonshot/kimi-k2.6-subscription": moonshot.Kimi_K2_6_SubscriptionParams,
155
+ "moonshot/kimi-k2.7-code": moonshot.Kimi_K2_7_CodeParams,
156
+ "moonshot/kimi-k2.7-code-highspeed": moonshot.Kimi_K2_7_Code_HighspeedParams,
157
+ "moonshot/kimi-k2.7-code-highspeed-subscription": moonshot.Kimi_K2_7_Code_Highspeed_SubscriptionParams,
158
+ "moonshot/kimi-k2.7-code-subscription": moonshot.Kimi_K2_7_Code_SubscriptionParams,
159
+ "moonshot/kimi-k3": moonshot.Kimi_K3Params,
160
+ "moonshot/moonshot-v1-128k": moonshot.Moonshot_V1_128kParams,
161
+ "moonshot/moonshot-v1-32k": moonshot.Moonshot_V1_32kParams,
162
+ "moonshot/moonshot-v1-8k": moonshot.Moonshot_V1_8kParams,
163
+ "nvidia/gliner-pii": nvidia.Gliner_PiiParams,
164
+ "nvidia/llama-3.1-nemoguard-8b-topic-control": nvidia.Llama_3_1_Nemoguard_8b_Topic_ControlParams,
165
+ "nvidia/llama-3.1-nemotron-nano-8b-v1": nvidia.Llama_3_1_Nemotron_Nano_8b_V1Params,
166
+ "nvidia/llama-3.1-nemotron-safety-guard-8b-v3": nvidia.Llama_3_1_Nemotron_Safety_Guard_8b_V3Params,
167
+ "nvidia/llama-3.1-nemotron-ultra-253b-v1": nvidia.Llama_3_1_Nemotron_Ultra_253b_V1Params,
168
+ "nvidia/llama-3.3-nemotron-super-49b-v1": nvidia.Llama_3_3_Nemotron_Super_49b_V1Params,
169
+ "nvidia/llama-3.3-nemotron-super-49b-v1.5": nvidia.Llama_3_3_Nemotron_Super_49b_V1_5Params,
170
+ "nvidia/nemoguard-jailbreak-detect": nvidia.Nemoguard_Jailbreak_DetectParams,
171
+ "nvidia/nemotron-3-nano-30b-a3b": nvidia.Nemotron_3_Nano_30b_A3bParams,
172
+ "nvidia/nemotron-3-super-120b-a12b": nvidia.Nemotron_3_Super_120b_A12bParams,
173
+ "nvidia/nemotron-3-ultra-550b-a55b": nvidia.Nemotron_3_Ultra_550b_A55bParams,
174
+ "nvidia/nemotron-3-ultra-subscription": nvidia.Nemotron_3_Ultra_SubscriptionParams,
175
+ "nvidia/nemotron-content-safety-reasoning-4b": nvidia.Nemotron_Content_Safety_Reasoning_4bParams,
176
+ "nvidia/nemotron-mini-4b-instruct": nvidia.Nemotron_Mini_4b_InstructParams,
177
+ "nvidia/riva-translate-4b-instruct-v1.1": nvidia.Riva_Translate_4b_Instruct_V1_1Params,
178
+ "nvidia/usdcode-llama-3.1-70b-instruct": nvidia.Usdcode_Llama_3_1_70b_InstructParams,
179
+ "openai/chatgpt-4o-latest": openai.Chatgpt_4o_LatestParams,
180
+ "openai/gpt-3.5-turbo": openai.Gpt_3_5_TurboParams,
181
+ "openai/gpt-4-turbo": openai.Gpt_4_TurboParams,
182
+ "openai/gpt-4-turbo-2024-04-09": openai.Gpt_4_Turbo_2024_04_09Params,
183
+ "openai/gpt-4.1": openai.Gpt_4_1Params,
184
+ "openai/gpt-4.1-mini": openai.Gpt_4_1_MiniParams,
185
+ "openai/gpt-4.1-nano": openai.Gpt_4_1_NanoParams,
186
+ "openai/gpt-4o": openai.Gpt_4oParams,
187
+ "openai/gpt-4o-2024-11-20": openai.Gpt_4o_2024_11_20Params,
188
+ "openai/gpt-4o-mini": openai.Gpt_4o_MiniParams,
189
+ "openai/gpt-5": openai.Gpt_5Params,
190
+ "openai/gpt-5-chat-latest": openai.Gpt_5_Chat_LatestParams,
191
+ "openai/gpt-5-mini": openai.Gpt_5_MiniParams,
192
+ "openai/gpt-5-nano": openai.Gpt_5_NanoParams,
193
+ "openai/gpt-5.1": openai.Gpt_5_1Params,
194
+ "openai/gpt-5.1-codex-max-subscription": openai.Gpt_5_1_Codex_Max_SubscriptionParams,
195
+ "openai/gpt-5.1-codex-subscription": openai.Gpt_5_1_Codex_SubscriptionParams,
196
+ "openai/gpt-5.2": openai.Gpt_5_2Params,
197
+ "openai/gpt-5.2-codex-subscription": openai.Gpt_5_2_Codex_SubscriptionParams,
198
+ "openai/gpt-5.2-subscription": openai.Gpt_5_2_SubscriptionParams,
199
+ "openai/gpt-5.3-codex": openai.Gpt_5_3_CodexParams,
200
+ "openai/gpt-5.3-codex-spark-subscription": openai.Gpt_5_3_Codex_Spark_SubscriptionParams,
201
+ "openai/gpt-5.3-codex-subscription": openai.Gpt_5_3_Codex_SubscriptionParams,
202
+ "openai/gpt-5.4": openai.Gpt_5_4Params,
203
+ "openai/gpt-5.4-mini": openai.Gpt_5_4_MiniParams,
204
+ "openai/gpt-5.4-mini-subscription": openai.Gpt_5_4_Mini_SubscriptionParams,
205
+ "openai/gpt-5.4-nano": openai.Gpt_5_4_NanoParams,
206
+ "openai/gpt-5.4-pro": openai.Gpt_5_4_ProParams,
207
+ "openai/gpt-5.4-pro-subscription": openai.Gpt_5_4_Pro_SubscriptionParams,
208
+ "openai/gpt-5.4-subscription": openai.Gpt_5_4_SubscriptionParams,
209
+ "openai/gpt-5.5": openai.Gpt_5_5Params,
210
+ "openai/gpt-5.5-pro": openai.Gpt_5_5_ProParams,
211
+ "openai/gpt-5.5-pro-subscription": openai.Gpt_5_5_Pro_SubscriptionParams,
212
+ "openai/gpt-5.5-subscription": openai.Gpt_5_5_SubscriptionParams,
213
+ "openai/gpt-5.6-luna": openai.Gpt_5_6_LunaParams,
214
+ "openai/gpt-5.6-luna-subscription": openai.Gpt_5_6_Luna_SubscriptionParams,
215
+ "openai/gpt-5.6-sol": openai.Gpt_5_6_SolParams,
216
+ "openai/gpt-5.6-sol-subscription": openai.Gpt_5_6_Sol_SubscriptionParams,
217
+ "openai/gpt-5.6-terra": openai.Gpt_5_6_TerraParams,
218
+ "openai/gpt-5.6-terra-subscription": openai.Gpt_5_6_Terra_SubscriptionParams,
219
+ "openai/gpt-oss-120b": openai.Gpt_Oss_120bParams,
220
+ "openai/gpt-oss-20b": openai.Gpt_Oss_20bParams,
221
+ "openai/gpt-oss-safeguard-120b": openai.Gpt_Oss_Safeguard_120bParams,
222
+ "openai/gpt-oss-safeguard-20b": openai.Gpt_Oss_Safeguard_20bParams,
223
+ "openai/o1": openai.O1Params,
224
+ "openai/o1-mini": openai.O1_MiniParams,
225
+ "openai/o1-preview": openai.O1_PreviewParams,
226
+ "openai/o3": openai.O3Params,
227
+ "openai/o3-mini": openai.O3_MiniParams,
228
+ "openai/o3-pro": openai.O3_ProParams,
229
+ "openai/o4-mini": openai.O4_MiniParams,
230
+ "perplexity/sonar": perplexity.SonarParams,
231
+ "perplexity/sonar-deep-research": perplexity.Sonar_Deep_ResearchParams,
232
+ "perplexity/sonar-pro": perplexity.Sonar_ProParams,
233
+ "perplexity/sonar-reasoning-pro": perplexity.Sonar_Reasoning_ProParams,
234
+ "thinking-machines/Inkling": thinking_machines.InklingParams,
235
+ "xai/grok-4.20-0309-non-reasoning": xai.Grok_4_20_0309_Non_ReasoningParams,
236
+ "xai/grok-4.20-0309-non-reasoning-subscription": xai.Grok_4_20_0309_Non_Reasoning_SubscriptionParams,
237
+ "xai/grok-4.20-0309-reasoning": xai.Grok_4_20_0309_ReasoningParams,
238
+ "xai/grok-4.20-0309-reasoning-subscription": xai.Grok_4_20_0309_Reasoning_SubscriptionParams,
239
+ "xai/grok-4.20-multi-agent-0309": xai.Grok_4_20_Multi_Agent_0309Params,
240
+ "xai/grok-4.3": xai.Grok_4_3Params,
241
+ "xai/grok-4.3-subscription": xai.Grok_4_3_SubscriptionParams,
242
+ "xai/grok-4.5": xai.Grok_4_5Params,
243
+ "xai/grok-4.5-subscription": xai.Grok_4_5_SubscriptionParams,
244
+ "xai/grok-build-0.1": xai.Grok_Build_0_1Params,
245
+ "xai/grok-build-0.1-subscription": xai.Grok_Build_0_1_SubscriptionParams,
246
+ "xiaomi/mimo-v2.5": xiaomi.Mimo_V2_5Params,
247
+ "xiaomi/mimo-v2.5-pro": xiaomi.Mimo_V2_5_ProParams,
248
+ "xiaomi/mimo-v2.5-subscription": xiaomi.Mimo_V2_5_SubscriptionParams,
249
+ "z-ai/glm-4.5": z_ai.Glm_4_5Params,
250
+ "z-ai/glm-4.5-air": z_ai.Glm_4_5_AirParams,
251
+ "z-ai/glm-4.5-air-subscription": z_ai.Glm_4_5_Air_SubscriptionParams,
252
+ "z-ai/glm-4.5-airx": z_ai.Glm_4_5_AirxParams,
253
+ "z-ai/glm-4.5-flash": z_ai.Glm_4_5_FlashParams,
254
+ "z-ai/glm-4.5-subscription": z_ai.Glm_4_5_SubscriptionParams,
255
+ "z-ai/glm-4.5-x": z_ai.Glm_4_5_XParams,
256
+ "z-ai/glm-4.6": z_ai.Glm_4_6Params,
257
+ "z-ai/glm-4.6-subscription": z_ai.Glm_4_6_SubscriptionParams,
258
+ "z-ai/glm-4.7": z_ai.Glm_4_7Params,
259
+ "z-ai/glm-4.7-flash": z_ai.Glm_4_7_FlashParams,
260
+ "z-ai/glm-4.7-flashx": z_ai.Glm_4_7_FlashxParams,
261
+ "z-ai/glm-4.7-subscription": z_ai.Glm_4_7_SubscriptionParams,
262
+ "z-ai/glm-5": z_ai.Glm_5Params,
263
+ "z-ai/glm-5-subscription": z_ai.Glm_5_SubscriptionParams,
264
+ "z-ai/glm-5-turbo": z_ai.Glm_5_TurboParams,
265
+ "z-ai/glm-5-turbo-subscription": z_ai.Glm_5_Turbo_SubscriptionParams,
266
+ "z-ai/glm-5.1": z_ai.Glm_5_1Params,
267
+ "z-ai/glm-5.1-subscription": z_ai.Glm_5_1_SubscriptionParams,
268
+ "z-ai/glm-5.2": z_ai.Glm_5_2Params,
269
+ "z-ai/glm-5.2-subscription": z_ai.Glm_5_2_SubscriptionParams,
270
+ }
modelparams/catalog.py ADDED
@@ -0,0 +1,59 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from importlib.resources import files
5
+ from types import MappingProxyType
6
+ from typing import cast
7
+
8
+ from pydantic import TypeAdapter
9
+
10
+ from ._generated.model_ids import MODEL_IDS, ModelId, Provider
11
+ from .models import CatalogEntry, JsonPrimitive, Parameter
12
+
13
+ _catalog_bytes = files("modelparams._generated").joinpath("catalog.json").read_bytes()
14
+ CATALOG = TypeAdapter(tuple[CatalogEntry, ...]).validate_json(_catalog_bytes)
15
+
16
+
17
+ def _entry_id(entry: CatalogEntry) -> str:
18
+ suffix = "" if entry.auth_type == "api_key" else "-subscription"
19
+ return f"{entry.provider}/{entry.model}{suffix}"
20
+
21
+
22
+ BY_ID: Mapping[ModelId, CatalogEntry] = MappingProxyType(
23
+ cast(dict[ModelId, CatalogEntry], {_entry_id(entry): entry for entry in CATALOG})
24
+ )
25
+ DEFAULTS: Mapping[ModelId, Mapping[str, JsonPrimitive]] = MappingProxyType(
26
+ {
27
+ model_id: MappingProxyType(
28
+ {
29
+ parameter.path: parameter.default
30
+ for parameter in entry.params
31
+ if "default" in parameter.model_fields_set
32
+ }
33
+ )
34
+ for model_id, entry in BY_ID.items()
35
+ }
36
+ )
37
+
38
+
39
+ def get_model(model_id: ModelId) -> CatalogEntry:
40
+ return BY_ID[model_id]
41
+
42
+
43
+ def get_defaults(model_id: ModelId) -> Mapping[str, JsonPrimitive]:
44
+ return DEFAULTS[model_id]
45
+
46
+
47
+ def list_models(provider: Provider | None = None) -> tuple[ModelId, ...]:
48
+ if provider is None:
49
+ return MODEL_IDS
50
+ prefix = f"{provider}/"
51
+ return tuple(model_id for model_id in MODEL_IDS if model_id.startswith(prefix))
52
+
53
+
54
+ def get_param(model_id: ModelId, path: str) -> Parameter | None:
55
+ return next((parameter for parameter in BY_ID[model_id].params if parameter.path == path), None)
56
+
57
+
58
+ def list_all_models() -> tuple[CatalogEntry, ...]:
59
+ return CATALOG
modelparams/models.py ADDED
@@ -0,0 +1,62 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Literal, TypeAlias
4
+
5
+ from pydantic import BaseModel, ConfigDict, Field
6
+
7
+ JsonPrimitive: TypeAlias = str | int | float | bool | None
8
+ JsonNumber: TypeAlias = int | float
9
+ AuthType: TypeAlias = Literal["api_key", "subscription"]
10
+ ParamType: TypeAlias = Literal["boolean", "enum", "integer", "number", "string"]
11
+ ParamGroup: TypeAlias = Literal[
12
+ "generation_length",
13
+ "sampling",
14
+ "reasoning",
15
+ "tooling",
16
+ "output_format",
17
+ "observability",
18
+ "provider_metadata",
19
+ ]
20
+
21
+
22
+ class FrozenModel(BaseModel):
23
+ model_config = ConfigDict(frozen=True, extra="forbid", populate_by_name=True)
24
+
25
+
26
+ class ParamRange(FrozenModel):
27
+ min: JsonNumber | None = None
28
+ max: JsonNumber | None = None
29
+ step: JsonNumber | None = None
30
+
31
+
32
+ class ApplicabilityCondition(FrozenModel):
33
+ not_: JsonPrimitive | tuple[JsonPrimitive, ...] = Field(alias="not")
34
+
35
+
36
+ ApplicabilityValue: TypeAlias = JsonPrimitive | tuple[JsonPrimitive, ...] | ApplicabilityCondition
37
+ ApplicabilityRule: TypeAlias = dict[str, ApplicabilityValue]
38
+ ApplicabilityRuleSet: TypeAlias = ApplicabilityRule | tuple[ApplicabilityRule, ...]
39
+
40
+
41
+ class Applicability(FrozenModel):
42
+ only: ApplicabilityRuleSet | None = None
43
+ except_: ApplicabilityRuleSet | None = Field(default=None, alias="except")
44
+
45
+
46
+ class Parameter(FrozenModel):
47
+ path: str
48
+ label: str
49
+ description: str
50
+ group: ParamGroup
51
+ type: ParamType
52
+ default: JsonPrimitive = None
53
+ range: ParamRange | None = None
54
+ values: tuple[JsonPrimitive, ...] | None = None
55
+ applicability: Applicability | None = None
56
+
57
+
58
+ class CatalogEntry(FrozenModel):
59
+ provider: str
60
+ auth_type: AuthType = Field(alias="authType")
61
+ model: str
62
+ params: tuple[Parameter, ...]
modelparams/py.typed ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,4 @@
1
+ # AUTO-GENERATED by packages/modelparams-python/scripts/codegen.ts.
2
+ # Do not edit by hand; the YAML catalog under /models is the source of truth.
3
+
4
+ __all__ = ["alibaba", "anthropic", "cerebras", "cohere", "deepseek", "google", "groq", "meta", "minimax", "mistral", "moonshot", "nvidia", "openai", "perplexity", "thinking_machines", "xai", "xiaomi", "z_ai"]
@@ -0,0 +1,183 @@
1
+ # AUTO-GENERATED by packages/modelparams-python/scripts/codegen.ts.
2
+ # Do not edit by hand; the YAML catalog under /models is the source of truth.
3
+
4
+ # ruff: noqa: F401
5
+
6
+ from typing import Annotated, Literal
7
+
8
+ from pydantic import ConfigDict, Field
9
+ from typing_extensions import TypedDict
10
+
11
+ _PARAMS_CONFIG = ConfigDict(strict=True, extra="forbid")
12
+
13
+ Qwen_FlashParams = TypedDict(
14
+ "Qwen_FlashParams",
15
+ {
16
+ "max_tokens": Annotated[int, Field(ge=1)],
17
+ "temperature": Annotated[float, Field(ge=0, le=2)],
18
+ "top_p": Annotated[float, Field(ge=0, le=1)],
19
+ "extra_body.top_k": Annotated[int, Field(ge=1)],
20
+ "extra_body.chat_template_kwargs.enable_thinking": bool,
21
+ },
22
+ total=False,
23
+ )
24
+ setattr(Qwen_FlashParams, "__pydantic_config__", _PARAMS_CONFIG)
25
+
26
+ Qwen_PlusParams = TypedDict(
27
+ "Qwen_PlusParams",
28
+ {
29
+ "max_tokens": Annotated[int, Field(ge=1)],
30
+ "temperature": Annotated[float, Field(ge=0, le=2)],
31
+ "top_p": Annotated[float, Field(ge=0, le=1)],
32
+ "extra_body.top_k": Annotated[int, Field(ge=1)],
33
+ "extra_body.chat_template_kwargs.enable_thinking": bool,
34
+ },
35
+ total=False,
36
+ )
37
+ setattr(Qwen_PlusParams, "__pydantic_config__", _PARAMS_CONFIG)
38
+
39
+ Qwen3_Coder_FlashParams = TypedDict(
40
+ "Qwen3_Coder_FlashParams",
41
+ {
42
+ "max_tokens": Annotated[int, Field(ge=1)],
43
+ "temperature": Annotated[float, Field(ge=0, le=2)],
44
+ "top_p": Annotated[float, Field(ge=0, le=1)],
45
+ "extra_body.top_k": Annotated[int, Field(ge=1)],
46
+ },
47
+ total=False,
48
+ )
49
+ setattr(Qwen3_Coder_FlashParams, "__pydantic_config__", _PARAMS_CONFIG)
50
+
51
+ Qwen3_Coder_PlusParams = TypedDict(
52
+ "Qwen3_Coder_PlusParams",
53
+ {
54
+ "max_tokens": Annotated[int, Field(ge=1)],
55
+ "temperature": Annotated[float, Field(ge=0, le=2)],
56
+ "top_p": Annotated[float, Field(ge=0, le=1)],
57
+ "extra_body.top_k": Annotated[int, Field(ge=1)],
58
+ },
59
+ total=False,
60
+ )
61
+ setattr(Qwen3_Coder_PlusParams, "__pydantic_config__", _PARAMS_CONFIG)
62
+
63
+ Qwen3_MaxParams = TypedDict(
64
+ "Qwen3_MaxParams",
65
+ {
66
+ "max_tokens": Annotated[int, Field(ge=1)],
67
+ "temperature": Annotated[float, Field(ge=0, le=2)],
68
+ "top_p": Annotated[float, Field(ge=0, le=1)],
69
+ "extra_body.top_k": Annotated[int, Field(ge=1)],
70
+ "extra_body.chat_template_kwargs.enable_thinking": bool,
71
+ },
72
+ total=False,
73
+ )
74
+ setattr(Qwen3_MaxParams, "__pydantic_config__", _PARAMS_CONFIG)
75
+
76
+ Qwen3_5Params = TypedDict(
77
+ "Qwen3_5Params",
78
+ {
79
+ "max_tokens": Annotated[int, Field(ge=1)],
80
+ "temperature": Annotated[float, Field(ge=0, le=2)],
81
+ "top_p": Annotated[float, Field(ge=0, le=1)],
82
+ "extra_body.top_k": Annotated[int, Field(ge=1)],
83
+ "extra_body.chat_template_kwargs.enable_thinking": bool,
84
+ },
85
+ total=False,
86
+ )
87
+ setattr(Qwen3_5Params, "__pydantic_config__", _PARAMS_CONFIG)
88
+
89
+ Qwen3_5_FlashParams = TypedDict(
90
+ "Qwen3_5_FlashParams",
91
+ {
92
+ "max_tokens": Annotated[int, Field(ge=1)],
93
+ "temperature": Annotated[float, Field(ge=0, le=2)],
94
+ "top_p": Annotated[float, Field(ge=0, le=1)],
95
+ "extra_body.top_k": Annotated[int, Field(ge=1)],
96
+ "extra_body.chat_template_kwargs.enable_thinking": bool,
97
+ },
98
+ total=False,
99
+ )
100
+ setattr(Qwen3_5_FlashParams, "__pydantic_config__", _PARAMS_CONFIG)
101
+
102
+ Qwen3_6_FlashParams = TypedDict(
103
+ "Qwen3_6_FlashParams",
104
+ {
105
+ "max_completion_tokens": Annotated[int, Field(ge=1)],
106
+ "temperature": Annotated[float, Field(ge=0, le=2)],
107
+ "top_p": Annotated[float, Field(ge=0, le=1)],
108
+ "extra_body.top_k": Annotated[int, Field(ge=0)],
109
+ "extra_body.enable_thinking": bool,
110
+ "extra_body.thinking_budget": Annotated[int, Field(ge=1)],
111
+ },
112
+ total=False,
113
+ )
114
+ setattr(Qwen3_6_FlashParams, "__pydantic_config__", _PARAMS_CONFIG)
115
+
116
+ Qwen3_7_MaxParams = TypedDict(
117
+ "Qwen3_7_MaxParams",
118
+ {
119
+ "max_completion_tokens": Annotated[int, Field(ge=1)],
120
+ "temperature": Annotated[float, Field(ge=0, le=2)],
121
+ "top_p": Annotated[float, Field(ge=0, le=1)],
122
+ "extra_body.top_k": Annotated[int, Field(ge=0)],
123
+ "extra_body.enable_thinking": bool,
124
+ "extra_body.thinking_budget": Annotated[int, Field(ge=1)],
125
+ },
126
+ total=False,
127
+ )
128
+ setattr(Qwen3_7_MaxParams, "__pydantic_config__", _PARAMS_CONFIG)
129
+
130
+ Qwen3_7_PlusParams = TypedDict(
131
+ "Qwen3_7_PlusParams",
132
+ {
133
+ "max_completion_tokens": Annotated[int, Field(ge=1)],
134
+ "temperature": Annotated[float, Field(ge=0, le=2)],
135
+ "top_p": Annotated[float, Field(ge=0, le=1)],
136
+ "extra_body.top_k": Annotated[int, Field(ge=0)],
137
+ "extra_body.enable_thinking": bool,
138
+ "extra_body.thinking_budget": Annotated[int, Field(ge=1)],
139
+ },
140
+ total=False,
141
+ )
142
+ setattr(Qwen3_7_PlusParams, "__pydantic_config__", _PARAMS_CONFIG)
143
+
144
+ Qwen3_8_MaxParams = TypedDict(
145
+ "Qwen3_8_MaxParams",
146
+ {
147
+ "max_completion_tokens": Annotated[int, Field(ge=1)],
148
+ "temperature": Annotated[float, Field(ge=0, le=2)],
149
+ "top_p": Annotated[float, Field(ge=0, le=1)],
150
+ "extra_body.top_k": Annotated[int, Field(ge=0)],
151
+ "extra_body.enable_thinking": bool,
152
+ "extra_body.thinking_budget": Annotated[int, Field(ge=1)],
153
+ },
154
+ total=False,
155
+ )
156
+ setattr(Qwen3_8_MaxParams, "__pydantic_config__", _PARAMS_CONFIG)
157
+
158
+ Qwq_PlusParams = TypedDict(
159
+ "Qwq_PlusParams",
160
+ {
161
+ "max_tokens": Annotated[int, Field(ge=1)],
162
+ "temperature": Annotated[float, Field(ge=0, le=2)],
163
+ "top_p": Annotated[float, Field(ge=0, le=1)],
164
+ "extra_body.top_k": Annotated[int, Field(ge=1)],
165
+ },
166
+ total=False,
167
+ )
168
+ setattr(Qwq_PlusParams, "__pydantic_config__", _PARAMS_CONFIG)
169
+
170
+ __all__ = [
171
+ "Qwen_FlashParams",
172
+ "Qwen_PlusParams",
173
+ "Qwen3_Coder_FlashParams",
174
+ "Qwen3_Coder_PlusParams",
175
+ "Qwen3_MaxParams",
176
+ "Qwen3_5Params",
177
+ "Qwen3_5_FlashParams",
178
+ "Qwen3_6_FlashParams",
179
+ "Qwen3_7_MaxParams",
180
+ "Qwen3_7_PlusParams",
181
+ "Qwen3_8_MaxParams",
182
+ "Qwq_PlusParams",
183
+ ]