@aliou/pi-neuralwatt 0.10.4 → 0.10.6

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.
@@ -1,441 +1,278 @@
1
1
  import type { ProviderModelConfig } from "@earendil-works/pi-coding-agent";
2
+ import {
3
+ buildNeuralwattFamily,
4
+ FLEX_COST_MULTIPLIER,
5
+ type NeuralwattModelFamily,
6
+ type NeuralwattVariantSpec,
7
+ type ThinkingLevelMap,
8
+ } from "./build";
2
9
 
3
- // Public models returned by https://api.neuralwatt.com/v1/models (unauthenticated view).
4
- // Pricing, capabilities, and limits are sourced from the API metadata fields.
5
- export const NEURALWATT_MODELS: ProviderModelConfig[] = [
6
- // Gemma 4 31B - NVIDIA NVFP4 checkpoint
7
- {
8
- id: "nvidia/Gemma-4-31B-IT-NVFP4",
9
- name: "Gemma 4 31B (NVFP4)",
10
- reasoning: false,
11
- input: ["text", "image"],
12
- cost: {
13
- input: 0.144,
14
- output: 0.42,
15
- cacheRead: 0.036,
16
- cacheWrite: 0,
17
- },
18
- contextWindow: 262128,
19
- maxTokens: 16384,
20
- compat: {
21
- supportsDeveloperRole: false,
22
- maxTokensField: "max_tokens",
23
- },
24
- },
25
- // Gemma 4 31B - Google, served from NVIDIA's NVFP4 checkpoint
26
- {
27
- id: "gemma-4-31b",
28
- name: "Gemma 4 31B",
29
- reasoning: false,
30
- input: ["text", "image"],
31
- cost: {
32
- input: 0.144,
33
- output: 0.42,
34
- cacheRead: 0.036,
35
- cacheWrite: 0,
36
- },
37
- contextWindow: 262128,
38
- maxTokens: 16384,
39
- compat: {
40
- supportsDeveloperRole: false,
41
- maxTokensField: "max_tokens",
42
- },
43
- },
44
- // GLM-5.2 - ZhipuAI
45
- // Native reasoning tiers: off (none), high, max. Exposes Pi's `max` level
46
- // (introduced in Pi 0.80.6) for GLM's top tier; `xhigh` is an unsupported
47
- // hole between `high` and `max`.
48
- {
49
- id: "glm-5.2",
50
- name: "GLM-5.2",
51
- reasoning: true,
52
- input: ["text"],
53
- cost: {
54
- input: 1.45,
55
- output: 4.5,
56
- cacheRead: 0.3625,
57
- cacheWrite: 0,
58
- },
59
- contextWindow: 1048560,
60
- maxTokens: 65536,
61
- thinkingLevelMap: {
62
- off: "none",
63
- minimal: null,
64
- low: null,
65
- medium: null,
66
- high: "high",
67
- xhigh: null,
68
- max: "max",
69
- },
70
- compat: {
71
- supportsDeveloperRole: false,
72
- maxTokensField: "max_tokens",
73
- requiresReasoningContentOnAssistantMessages: true,
74
- },
75
- },
76
- // GLM-5.2 Fast - ZhipuAI
77
- {
78
- id: "glm-5.2-fast",
79
- name: "GLM-5.2 Fast",
80
- reasoning: false,
81
- input: ["text"],
82
- cost: {
83
- input: 1.45,
84
- output: 4.5,
85
- cacheRead: 0.3625,
86
- cacheWrite: 0,
87
- },
88
- contextWindow: 1048560,
89
- maxTokens: 65536,
90
- compat: {
91
- supportsDeveloperRole: false,
92
- maxTokensField: "max_tokens",
93
- },
94
- },
95
- // GLM-5.2 Short - ZhipuAI (200K context, bounded reasoning budget)
96
- {
97
- id: "glm-5.2-short",
98
- name: "GLM-5.2 Short",
99
- reasoning: true,
100
- input: ["text"],
101
- cost: {
102
- input: 1.45,
103
- output: 4.5,
104
- cacheRead: 0.3625,
105
- cacheWrite: 0,
106
- },
107
- contextWindow: 199984,
108
- maxTokens: 32000,
109
- thinkingLevelMap: {
110
- off: "none",
111
- minimal: null,
112
- low: null,
113
- medium: null,
114
- high: "high",
115
- xhigh: null,
116
- max: "max",
117
- },
118
- compat: {
119
- supportsDeveloperRole: false,
120
- maxTokensField: "max_tokens",
121
- requiresReasoningContentOnAssistantMessages: true,
122
- },
123
- },
124
- // GLM-5.2 Short Fast - ZhipuAI (200K context, reasoning disabled)
125
- {
126
- id: "glm-5.2-short-fast",
127
- name: "GLM-5.2 Short Fast",
128
- reasoning: false,
129
- input: ["text"],
130
- cost: {
131
- input: 1.45,
132
- output: 4.5,
133
- cacheRead: 0.3625,
134
- cacheWrite: 0,
135
- },
136
- contextWindow: 199984,
137
- maxTokens: 32000,
138
- compat: {
139
- supportsDeveloperRole: false,
140
- maxTokensField: "max_tokens",
141
- },
142
- },
143
- // Kimi K2.6 - MoonshotAI
144
- {
145
- id: "kimi-k2.6",
146
- name: "Kimi K2.6",
147
- reasoning: true,
148
- input: ["text", "image"],
149
- cost: {
150
- input: 0.69,
151
- output: 3.22,
152
- cacheRead: 0.1725,
153
- cacheWrite: 0,
154
- },
155
- contextWindow: 262128,
156
- maxTokens: 65536,
157
- thinkingLevelMap: {
158
- minimal: null,
159
- low: null,
160
- medium: "medium",
161
- high: null,
162
- xhigh: null,
163
- },
164
- compat: {
165
- supportsDeveloperRole: false,
166
- maxTokensField: "max_tokens",
167
- requiresReasoningContentOnAssistantMessages: true,
168
- },
169
- },
170
- // Kimi K2.6 Fast - MoonshotAI
171
- {
172
- id: "kimi-k2.6-fast",
173
- name: "Kimi K2.6 Fast",
174
- reasoning: false,
175
- input: ["text", "image"],
176
- cost: {
177
- input: 0.69,
178
- output: 3.22,
179
- cacheRead: 0.1725,
180
- cacheWrite: 0,
181
- },
182
- contextWindow: 262128,
183
- maxTokens: 65536,
184
- compat: {
185
- supportsDeveloperRole: false,
186
- maxTokensField: "max_tokens",
187
- },
188
- },
189
- // Qwen3.5 397B - Qwen
190
- {
191
- id: "qwen3.5-397b",
192
- name: "Qwen3.5 397B",
193
- reasoning: true,
194
- input: ["text"],
195
- cost: {
196
- input: 0.69,
197
- output: 4.14,
198
- cacheRead: 0.1725,
199
- cacheWrite: 0,
200
- },
201
- contextWindow: 262128,
202
- maxTokens: 65536,
203
- thinkingLevelMap: {
204
- minimal: null,
205
- low: null,
206
- medium: "medium",
207
- high: null,
208
- xhigh: null,
209
- },
210
- compat: {
211
- supportsDeveloperRole: false,
212
- maxTokensField: "max_tokens",
213
- requiresReasoningContentOnAssistantMessages: true,
214
- },
215
- },
216
- // Qwen3.5 397B Fast - Qwen
217
- {
218
- id: "qwen3.5-397b-fast",
219
- name: "Qwen3.5 397B Fast",
220
- reasoning: false,
221
- input: ["text"],
222
- cost: {
223
- input: 0.69,
224
- output: 4.14,
225
- cacheRead: 0.1725,
226
- cacheWrite: 0,
227
- },
228
- contextWindow: 262128,
229
- maxTokens: 65536,
230
- compat: {
231
- supportsDeveloperRole: false,
232
- maxTokensField: "max_tokens",
233
- },
234
- },
235
- // Qwen3.6 35B - Qwen
236
- {
237
- id: "qwen3.6-35b",
238
- name: "Qwen3.6 35B",
239
- reasoning: true,
240
- input: ["text", "image"],
241
- cost: {
242
- input: 0.29,
243
- output: 1.15,
244
- cacheRead: 0.0725,
245
- cacheWrite: 0,
246
- },
247
- contextWindow: 131056,
248
- maxTokens: 65536,
249
- thinkingLevelMap: {
250
- minimal: null,
251
- low: null,
252
- medium: "medium",
253
- high: null,
254
- xhigh: null,
255
- },
256
- compat: {
257
- supportsDeveloperRole: false,
258
- maxTokensField: "max_tokens",
259
- requiresReasoningContentOnAssistantMessages: true,
260
- },
261
- },
262
- // Kimi K2.7 Code - MoonshotAI
263
- {
264
- id: "kimi-k2.7-code",
265
- name: "Kimi K2.7 Code",
266
- reasoning: true,
267
- input: ["text", "image"],
268
- cost: {
269
- input: 0.95,
270
- output: 4.0,
271
- cacheRead: 0.2375,
272
- cacheWrite: 0,
273
- },
274
- contextWindow: 262128,
275
- maxTokens: 65536,
276
- thinkingLevelMap: {
277
- off: null,
278
- minimal: null,
279
- low: null,
280
- medium: "medium",
281
- high: null,
282
- xhigh: null,
283
- },
284
- compat: {
285
- supportsDeveloperRole: false,
286
- maxTokensField: "max_tokens",
287
- requiresReasoningContentOnAssistantMessages: true,
288
- },
289
- },
290
- // GLM-5.2 Short Fast Flex - ZhipuAI (flex variant, reasoning disabled)
291
- {
292
- id: "glm-5.2-short-fast-flex",
293
- name: "GLM-5.2 (short, fast, flex)",
294
- reasoning: false,
295
- input: ["text"],
296
- cost: {
297
- input: 1.45,
298
- output: 4.5,
299
- cacheRead: 0.3625,
300
- cacheWrite: 0,
301
- },
302
- contextWindow: 199984,
303
- maxTokens: 65536,
304
- compat: {
305
- supportsDeveloperRole: false,
306
- maxTokensField: "max_tokens",
307
- },
308
- },
309
- // GLM-5.2 Short Flex - ZhipuAI (flex variant)
310
- {
311
- id: "glm-5.2-short-flex",
312
- name: "GLM-5.2 (short, flex)",
313
- reasoning: true,
314
- input: ["text"],
315
- cost: {
316
- input: 1.45,
317
- output: 4.5,
318
- cacheRead: 0.3625,
319
- cacheWrite: 0,
320
- },
321
- contextWindow: 199984,
322
- maxTokens: 65536,
323
- thinkingLevelMap: {
324
- off: "none",
325
- minimal: null,
326
- low: null,
327
- medium: null,
328
- high: "high",
329
- xhigh: null,
330
- max: "max",
331
- },
332
- compat: {
333
- supportsDeveloperRole: false,
334
- maxTokensField: "max_tokens",
335
- requiresReasoningContentOnAssistantMessages: true,
336
- },
337
- },
338
- // Kimi K2.6 Flex - MoonshotAI (flex variant)
339
- {
340
- id: "kimi-k2.6-flex",
341
- name: "Kimi K2.6 (flex)",
342
- reasoning: true,
343
- input: ["text", "image"],
344
- cost: {
345
- input: 0.69,
346
- output: 3.22,
347
- cacheRead: 0.1725,
348
- cacheWrite: 0,
349
- },
350
- contextWindow: 262128,
351
- maxTokens: 65536,
352
- thinkingLevelMap: {
353
- minimal: null,
354
- low: null,
355
- medium: "medium",
356
- high: null,
357
- xhigh: null,
358
- },
359
- compat: {
360
- supportsDeveloperRole: false,
361
- maxTokensField: "max_tokens",
362
- requiresReasoningContentOnAssistantMessages: true,
363
- },
364
- },
365
- // Kimi K2.7 Code Flex - MoonshotAI (flex variant)
366
- {
367
- id: "kimi-k2.7-code-flex",
368
- name: "Kimi K2.7 Code (flex)",
369
- reasoning: true,
370
- input: ["text", "image"],
371
- cost: {
372
- input: 0.95,
373
- output: 4.0,
374
- cacheRead: 0.2375,
375
- cacheWrite: 0,
376
- },
377
- contextWindow: 262128,
378
- maxTokens: 65536,
379
- thinkingLevelMap: {
380
- off: null,
381
- minimal: null,
382
- low: null,
383
- medium: "medium",
384
- high: null,
385
- xhigh: null,
386
- },
387
- compat: {
388
- supportsDeveloperRole: false,
389
- maxTokensField: "max_tokens",
390
- requiresReasoningContentOnAssistantMessages: true,
391
- },
392
- },
393
- // GLM-5.2 Flex - ZhipuAI (flex variant)
394
- {
395
- id: "glm-5.2-flex",
396
- name: "GLM-5.2 (flex)",
397
- reasoning: true,
398
- input: ["text"],
399
- cost: {
400
- input: 1.45,
401
- output: 4.5,
402
- cacheRead: 0.3625,
403
- cacheWrite: 0,
404
- },
405
- contextWindow: 1048560,
406
- maxTokens: 65536,
407
- thinkingLevelMap: {
408
- off: "none",
409
- minimal: null,
410
- low: null,
411
- medium: null,
412
- high: "high",
413
- xhigh: null,
414
- max: "max",
415
- },
416
- compat: {
417
- supportsDeveloperRole: false,
418
- maxTokensField: "max_tokens",
419
- requiresReasoningContentOnAssistantMessages: true,
420
- },
421
- },
422
- // Qwen3.6 35B Fast - Qwen
423
- {
424
- id: "qwen3.6-35b-fast",
425
- name: "Qwen3.6 35B Fast",
426
- reasoning: false,
427
- input: ["text", "image"],
428
- cost: {
429
- input: 0.29,
430
- output: 1.15,
431
- cacheRead: 0.0725,
432
- cacheWrite: 0,
433
- },
434
- contextWindow: 131056,
435
- maxTokens: 65536,
436
- compat: {
437
- supportsDeveloperRole: false,
438
- maxTokensField: "max_tokens",
439
- },
10
+ // Public models returned by https://api.neuralwatt.com/v1/models.
11
+ // Pricing, capabilities, and limits are sourced from the API metadata fields;
12
+ // `maxTokens` is `metadata.limits.max_output_tokens ?? max_model_len`.
13
+ //
14
+ // Models are declared per family so every variant (`-fast`, `-flex`, `-short`)
15
+ // inherits the family's pricing, modalities, and thinking levels. See
16
+ // `models.test.ts` for the drift check against the live catalog.
17
+
18
+ // GLM natively supports `high` and `max` reasoning efforts. `xhigh` is an
19
+ // unsupported hole between them. Pi added the `max` level in 0.80.6.
20
+ const GLM_THINKING: ThinkingLevelMap = {
21
+ off: "none",
22
+ minimal: null,
23
+ low: null,
24
+ medium: null,
25
+ high: "high",
26
+ xhigh: null,
27
+ max: "max",
28
+ };
29
+
30
+ // Binary thinking control: expose a single known-good Pi level.
31
+ const BINARY_THINKING: ThinkingLevelMap = {
32
+ minimal: null,
33
+ low: null,
34
+ medium: "medium",
35
+ high: null,
36
+ xhigh: null,
37
+ };
38
+
39
+ const DEEPSEEK_V4_FLASH: NeuralwattModelFamily = {
40
+ cost: { input: 0.104, output: 0.207, cacheRead: 0.026 },
41
+ vision: false,
42
+ thinkingLevelMap: {
43
+ off: "none",
44
+ minimal: "low",
45
+ low: "low",
46
+ medium: "medium",
47
+ high: "high",
48
+ xhigh: null,
49
+ max: "max",
440
50
  },
51
+ };
52
+
53
+ // Google, served from NVIDIA's NVFP4 checkpoint.
54
+ const GEMMA_4: NeuralwattModelFamily = {
55
+ cost: { input: 0.144, output: 0.42, cacheRead: 0.036 },
56
+ vision: true,
57
+ };
58
+
59
+ // ZhipuAI.
60
+ const GLM_5_2: NeuralwattModelFamily = {
61
+ cost: { input: 1.45, output: 4.5, cacheRead: 0.3625 },
62
+ vision: false,
63
+ thinkingLevelMap: GLM_THINKING,
64
+ };
65
+
66
+ // MoonshotAI.
67
+ const KIMI_K2_6: NeuralwattModelFamily = {
68
+ cost: { input: 0.69, output: 3.22, cacheRead: 0.1725 },
69
+ vision: true,
70
+ thinkingLevelMap: BINARY_THINKING,
71
+ };
72
+
73
+ // MoonshotAI.
74
+ const KIMI_K2_7_CODE: NeuralwattModelFamily = {
75
+ cost: { input: 0.95, output: 4.0, cacheRead: 0.2375 },
76
+ vision: true,
77
+ thinkingLevelMap: { off: null, ...BINARY_THINKING },
78
+ };
79
+
80
+ // Qwen.
81
+ const QWEN_3_5_397B: NeuralwattModelFamily = {
82
+ cost: { input: 0.69, output: 4.14, cacheRead: 0.1725 },
83
+ vision: false,
84
+ thinkingLevelMap: BINARY_THINKING,
85
+ };
86
+
87
+ // Qwen.
88
+ const QWEN_3_6_35B: NeuralwattModelFamily = {
89
+ cost: { input: 0.29, output: 1.15, cacheRead: 0.0725 },
90
+ vision: true,
91
+ thinkingLevelMap: BINARY_THINKING,
92
+ };
93
+
94
+ const FAMILIES: [NeuralwattModelFamily, NeuralwattVariantSpec[]][] = [
95
+ [
96
+ DEEPSEEK_V4_FLASH,
97
+ [
98
+ {
99
+ id: "deepseek-v4-flash",
100
+ name: "DeepSeek V4 Flash",
101
+ contextWindow: 1048560,
102
+ maxOutputTokens: 65536,
103
+ reasoning: true,
104
+ },
105
+ ],
106
+ ],
107
+ [
108
+ GEMMA_4,
109
+ [
110
+ {
111
+ id: "gemma-4-31b",
112
+ name: "Gemma 4 31B",
113
+ contextWindow: 262128,
114
+ maxOutputTokens: 16384,
115
+ reasoning: false,
116
+ },
117
+ ],
118
+ ],
119
+ [
120
+ GLM_5_2,
121
+ [
122
+ {
123
+ id: "glm-5.2",
124
+ name: "GLM-5.2",
125
+ contextWindow: 1048560,
126
+ maxOutputTokens: null,
127
+ reasoning: true,
128
+ },
129
+ {
130
+ id: "glm-5.2-fast",
131
+ name: "GLM-5.2 Fast",
132
+ contextWindow: 1048560,
133
+ maxOutputTokens: null,
134
+ reasoning: false,
135
+ },
136
+ {
137
+ id: "glm-5.2-flex",
138
+ name: "GLM-5.2 (flex)",
139
+ contextWindow: 1048560,
140
+ maxOutputTokens: null,
141
+ reasoning: true,
142
+ costMultiplier: FLEX_COST_MULTIPLIER,
143
+ },
144
+ {
145
+ id: "glm-5.2-short",
146
+ name: "GLM-5.2 Short",
147
+ contextWindow: 199984,
148
+ maxOutputTokens: 32000,
149
+ reasoning: true,
150
+ },
151
+ {
152
+ id: "glm-5.2-short-fast",
153
+ name: "GLM-5.2 Short Fast",
154
+ contextWindow: 199984,
155
+ maxOutputTokens: 32000,
156
+ reasoning: false,
157
+ },
158
+ {
159
+ id: "glm-5.2-short-flex",
160
+ name: "GLM-5.2 (short, flex)",
161
+ contextWindow: 199984,
162
+ maxOutputTokens: 32000,
163
+ reasoning: true,
164
+ costMultiplier: FLEX_COST_MULTIPLIER,
165
+ },
166
+ {
167
+ id: "glm-5.2-short-fast-flex",
168
+ name: "GLM-5.2 (short, fast, flex)",
169
+ contextWindow: 199984,
170
+ maxOutputTokens: 32000,
171
+ reasoning: false,
172
+ costMultiplier: FLEX_COST_MULTIPLIER,
173
+ },
174
+ ],
175
+ ],
176
+ [
177
+ KIMI_K2_6,
178
+ [
179
+ {
180
+ id: "kimi-k2.6",
181
+ name: "Kimi K2.6",
182
+ contextWindow: 262128,
183
+ maxOutputTokens: null,
184
+ reasoning: true,
185
+ },
186
+ {
187
+ id: "kimi-k2.6-fast",
188
+ name: "Kimi K2.6 Fast",
189
+ contextWindow: 262128,
190
+ maxOutputTokens: null,
191
+ reasoning: false,
192
+ },
193
+ {
194
+ id: "kimi-k2.6-flex",
195
+ name: "Kimi K2.6 (flex)",
196
+ contextWindow: 262128,
197
+ maxOutputTokens: null,
198
+ reasoning: true,
199
+ costMultiplier: FLEX_COST_MULTIPLIER,
200
+ },
201
+ ],
202
+ ],
203
+ [
204
+ KIMI_K2_7_CODE,
205
+ [
206
+ {
207
+ id: "kimi-k2.7-code",
208
+ name: "Kimi K2.7 Code",
209
+ contextWindow: 262128,
210
+ maxOutputTokens: null,
211
+ reasoning: true,
212
+ },
213
+ {
214
+ id: "kimi-k2.7-code-fast",
215
+ name: "Kimi K2.7 Code Fast",
216
+ contextWindow: 262128,
217
+ maxOutputTokens: null,
218
+ reasoning: false,
219
+ },
220
+ {
221
+ id: "kimi-k2.7-code-flex",
222
+ name: "Kimi K2.7 Code (flex)",
223
+ contextWindow: 262128,
224
+ maxOutputTokens: null,
225
+ reasoning: true,
226
+ costMultiplier: FLEX_COST_MULTIPLIER,
227
+ },
228
+ ],
229
+ ],
230
+ [
231
+ QWEN_3_5_397B,
232
+ [
233
+ {
234
+ id: "qwen3.5-397b",
235
+ name: "Qwen3.5 397B",
236
+ contextWindow: 262128,
237
+ maxOutputTokens: null,
238
+ reasoning: true,
239
+ },
240
+ {
241
+ id: "qwen3.5-397b-fast",
242
+ name: "Qwen3.5 397B Fast",
243
+ contextWindow: 262128,
244
+ maxOutputTokens: null,
245
+ reasoning: false,
246
+ },
247
+ ],
248
+ ],
249
+ [
250
+ QWEN_3_6_35B,
251
+ [
252
+ {
253
+ id: "qwen3.6-35b",
254
+ name: "Qwen3.6 35B",
255
+ contextWindow: 131056,
256
+ maxOutputTokens: null,
257
+ reasoning: true,
258
+ },
259
+ {
260
+ id: "qwen3.6-35b-fast",
261
+ name: "Qwen3.6 35B Fast",
262
+ contextWindow: 131056,
263
+ maxOutputTokens: null,
264
+ reasoning: false,
265
+ },
266
+ ],
267
+ ],
441
268
  ];
269
+
270
+ // `-flex` variants are the Flex tier: same model, context window, output cap,
271
+ // and prompt cache as the standard variant, admitted on spare capacity.
272
+ // /v1/models does not advertise them (not even to an authenticated key), so they
273
+ // stay hardcoded here and the drift check in models.test.ts skips them.
274
+ // https://portal.neuralwatt.com/docs/guides/flex-tier
275
+
276
+ export const NEURALWATT_MODELS: ProviderModelConfig[] = FAMILIES.flatMap(
277
+ ([family, variants]) => buildNeuralwattFamily(family, variants),
278
+ );