@aliou/pi-neuralwatt 0.7.3 → 0.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliou/pi-neuralwatt",
3
- "version": "0.7.3",
3
+ "version": "0.7.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "private": false,
@@ -46,6 +46,11 @@ function registerNeuralwattProvider(
46
46
  const { includeLegacyModelIds, includeHiddenModels } =
47
47
  configLoader.getConfig();
48
48
 
49
+ const publicModels = getNeuralwattModels({ includeLegacyModelIds });
50
+ const resolvedHiddenModels = includeHiddenModels
51
+ ? dedupeHiddenModels(hiddenModels, publicModels)
52
+ : [];
53
+
49
54
  const config: Parameters<ExtensionAPI["registerProvider"]>[1] = {
50
55
  baseUrl: "https://api.neuralwatt.com/v1",
51
56
  apiKey: "$NEURALWATT_API_KEY",
@@ -55,10 +60,7 @@ function registerNeuralwattProvider(
55
60
  Referer: "https://pi.dev",
56
61
  "X-Title": "npm:@aliou/pi-neuralwatt",
57
62
  },
58
- models: [
59
- ...getNeuralwattModels({ includeLegacyModelIds }),
60
- ...(includeHiddenModels ? hiddenModels : []),
61
- ],
63
+ models: [...publicModels, ...resolvedHiddenModels],
62
64
  };
63
65
 
64
66
  const provider = getApiProvider("openai-completions");
@@ -73,6 +75,23 @@ function registerNeuralwattProvider(
73
75
  pi.registerProvider("neuralwatt", config);
74
76
  }
75
77
 
78
+ /**
79
+ * Drop any hidden model whose ID collides with a public or legacy model.
80
+ *
81
+ * Models can graduate from hidden (authenticated /v1/models only) to public
82
+ * (unauthenticated list). When that happens, a stale on-disk cache may still
83
+ * list the now-public ID, which would register it twice and make Pi treat the
84
+ * scoped model as ambiguous ("No models match pattern"). Dedupe against the
85
+ * public list so a stale cache can never shadow a public model.
86
+ */
87
+ function dedupeHiddenModels(
88
+ hiddenModels: ProviderModelConfig[],
89
+ publicModels: ProviderModelConfig[],
90
+ ): ProviderModelConfig[] {
91
+ const publicIds = new Set(publicModels.map((m) => m.id));
92
+ return hiddenModels.filter((m) => !publicIds.has(m.id));
93
+ }
94
+
76
95
  export default async function (pi: ExtensionAPI) {
77
96
  await configLoader.load();
78
97
 
@@ -254,14 +273,14 @@ export default async function (pi: ExtensionAPI) {
254
273
  ctx.modelRegistry.authStorage,
255
274
  hiddenModelsAbort.signal,
256
275
  );
257
- // Persist for the next startup so scoped models resolve without warnings
258
- // on Pi's subsequent launches.
259
- if (fetched.length > 0) {
260
- hiddenModels = fetched;
261
- await writeHiddenModelsCache(hiddenModels);
262
- if (!hiddenModelsAbort.signal.aborted) {
263
- registerNeuralwattProvider(pi, handleSseQuota, hiddenModels);
264
- }
276
+ // Persist for the next startup so scoped models resolve without
277
+ // warnings on Pi's subsequent launches. Always write the cache (even
278
+ // when empty) and re-register, so graduated or removed hidden models
279
+ // are purged from both the cache and the provider's model list.
280
+ hiddenModels = fetched;
281
+ await writeHiddenModelsCache(hiddenModels);
282
+ if (!hiddenModelsAbort.signal.aborted) {
283
+ registerNeuralwattProvider(pi, handleSseQuota, hiddenModels);
265
284
  }
266
285
  }
267
286
 
@@ -7,6 +7,8 @@ export const LEGACY_MODEL_ALIAS_MAP = {
7
7
  "glm-5.1": "glm-5.2",
8
8
  "glm-5.1-fast": "glm-5.2-fast",
9
9
  "zai-org/GLM-5.1-FP8": "glm-5.2",
10
+ "moonshotai/Kimi-K2.5": "kimi-k2.6",
11
+ "kimi-k2.5-fast": "kimi-k2.6-fast",
10
12
  "moonshotai/Kimi-K2.6": "kimi-k2.6",
11
13
  "Qwen/Qwen3.5-397B-A17B-FP8": "qwen3.5-397b",
12
14
  "Qwen/Qwen3.6-35B-A3B": "qwen3.6-35b",
@@ -18,6 +18,7 @@ export const NEURALWATT_MODELS: ProviderModelConfig[] = [
18
18
  contextWindow: 1048560,
19
19
  maxTokens: 65536,
20
20
  thinkingLevelMap: {
21
+ off: "none",
21
22
  minimal: null,
22
23
  low: null,
23
24
  medium: null,
@@ -64,6 +65,7 @@ export const NEURALWATT_MODELS: ProviderModelConfig[] = [
64
65
  contextWindow: 199984,
65
66
  maxTokens: 65536,
66
67
  thinkingLevelMap: {
68
+ off: "none",
67
69
  minimal: null,
68
70
  low: null,
69
71
  medium: null,
@@ -95,52 +97,6 @@ export const NEURALWATT_MODELS: ProviderModelConfig[] = [
95
97
  maxTokensField: "max_tokens",
96
98
  },
97
99
  },
98
- // Kimi K2.5 - MoonshotAI
99
- {
100
- id: "moonshotai/Kimi-K2.5",
101
- name: "Kimi K2.5",
102
- reasoning: true,
103
- input: ["text", "image"],
104
- cost: {
105
- input: 0.52,
106
- output: 2.59,
107
- cacheRead: 0.13,
108
- cacheWrite: 0,
109
- },
110
- contextWindow: 262128,
111
- maxTokens: 65536,
112
- thinkingLevelMap: {
113
- minimal: null,
114
- low: null,
115
- medium: "medium",
116
- high: null,
117
- xhigh: null,
118
- },
119
- compat: {
120
- supportsDeveloperRole: false,
121
- maxTokensField: "max_tokens",
122
- requiresReasoningContentOnAssistantMessages: true,
123
- },
124
- },
125
- // Kimi K2.5 Fast - MoonshotAI
126
- {
127
- id: "kimi-k2.5-fast",
128
- name: "Kimi K2.5 Fast",
129
- reasoning: false,
130
- input: ["text", "image"],
131
- cost: {
132
- input: 0.52,
133
- output: 2.59,
134
- cacheRead: 0.13,
135
- cacheWrite: 0,
136
- },
137
- contextWindow: 262128,
138
- maxTokens: 65536,
139
- compat: {
140
- supportsDeveloperRole: false,
141
- maxTokensField: "max_tokens",
142
- },
143
- },
144
100
  // Kimi K2.6 - MoonshotAI
145
101
  {
146
102
  id: "kimi-k2.6",
@@ -288,6 +244,136 @@ export const NEURALWATT_MODELS: ProviderModelConfig[] = [
288
244
  requiresReasoningContentOnAssistantMessages: true,
289
245
  },
290
246
  },
247
+ // GLM-5.2 Short Fast Flex - ZhipuAI (flex variant, reasoning disabled)
248
+ {
249
+ id: "glm-5.2-short-fast-flex",
250
+ name: "GLM-5.2 (short, fast, flex)",
251
+ reasoning: false,
252
+ input: ["text"],
253
+ cost: {
254
+ input: 1.45,
255
+ output: 4.5,
256
+ cacheRead: 0.3625,
257
+ cacheWrite: 0,
258
+ },
259
+ contextWindow: 199984,
260
+ maxTokens: 65536,
261
+ compat: {
262
+ supportsDeveloperRole: false,
263
+ maxTokensField: "max_tokens",
264
+ },
265
+ },
266
+ // GLM-5.2 Short Flex - ZhipuAI (flex variant)
267
+ {
268
+ id: "glm-5.2-short-flex",
269
+ name: "GLM-5.2 (short, flex)",
270
+ reasoning: true,
271
+ input: ["text"],
272
+ cost: {
273
+ input: 1.45,
274
+ output: 4.5,
275
+ cacheRead: 0.3625,
276
+ cacheWrite: 0,
277
+ },
278
+ contextWindow: 199984,
279
+ maxTokens: 65536,
280
+ thinkingLevelMap: {
281
+ off: "none",
282
+ minimal: null,
283
+ low: null,
284
+ medium: null,
285
+ high: "high",
286
+ xhigh: "max",
287
+ },
288
+ compat: {
289
+ supportsDeveloperRole: false,
290
+ maxTokensField: "max_tokens",
291
+ requiresReasoningContentOnAssistantMessages: true,
292
+ },
293
+ },
294
+ // Kimi K2.6 Flex - MoonshotAI (flex variant)
295
+ {
296
+ id: "kimi-k2.6-flex",
297
+ name: "Kimi K2.6 (flex)",
298
+ reasoning: true,
299
+ input: ["text", "image"],
300
+ cost: {
301
+ input: 0.69,
302
+ output: 3.22,
303
+ cacheRead: 0.1725,
304
+ cacheWrite: 0,
305
+ },
306
+ contextWindow: 262128,
307
+ maxTokens: 65536,
308
+ thinkingLevelMap: {
309
+ minimal: null,
310
+ low: null,
311
+ medium: "medium",
312
+ high: null,
313
+ xhigh: null,
314
+ },
315
+ compat: {
316
+ supportsDeveloperRole: false,
317
+ maxTokensField: "max_tokens",
318
+ requiresReasoningContentOnAssistantMessages: true,
319
+ },
320
+ },
321
+ // Kimi K2.7 Code Flex - MoonshotAI (flex variant)
322
+ {
323
+ id: "kimi-k2.7-code-flex",
324
+ name: "Kimi K2.7 Code (flex)",
325
+ reasoning: true,
326
+ input: ["text", "image"],
327
+ cost: {
328
+ input: 0.95,
329
+ output: 4.0,
330
+ cacheRead: 0.2375,
331
+ cacheWrite: 0,
332
+ },
333
+ contextWindow: 262128,
334
+ maxTokens: 65536,
335
+ thinkingLevelMap: {
336
+ off: null,
337
+ minimal: null,
338
+ low: null,
339
+ medium: "medium",
340
+ high: null,
341
+ xhigh: null,
342
+ },
343
+ compat: {
344
+ supportsDeveloperRole: false,
345
+ maxTokensField: "max_tokens",
346
+ requiresReasoningContentOnAssistantMessages: true,
347
+ },
348
+ },
349
+ // GLM-5.2 Flex - ZhipuAI (flex variant)
350
+ {
351
+ id: "glm-5.2-flex",
352
+ name: "GLM-5.2 (flex)",
353
+ reasoning: true,
354
+ input: ["text"],
355
+ cost: {
356
+ input: 1.45,
357
+ output: 4.5,
358
+ cacheRead: 0.3625,
359
+ cacheWrite: 0,
360
+ },
361
+ contextWindow: 1048560,
362
+ maxTokens: 65536,
363
+ thinkingLevelMap: {
364
+ off: "none",
365
+ minimal: null,
366
+ low: null,
367
+ medium: null,
368
+ high: "high",
369
+ xhigh: "max",
370
+ },
371
+ compat: {
372
+ supportsDeveloperRole: false,
373
+ maxTokensField: "max_tokens",
374
+ requiresReasoningContentOnAssistantMessages: true,
375
+ },
376
+ },
291
377
  // Qwen3.6 35B Fast - Qwen
292
378
  {
293
379
  id: "qwen3.6-35b-fast",