pi-baseten-provider 1.0.6 → 1.0.8

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/README.md CHANGED
@@ -71,15 +71,17 @@ pi
71
71
  |-------|---------|--------|-----------|-----------|------------|
72
72
  | DeepSeek V4 Pro | 131K | ❌ | ✅ | $1.74 | $3.48 |
73
73
  | GLM 4.7 | 200K | ❌ | ✅ | $0.60 | $2.20 |
74
- | GLM 5 | 203K | ❌ | ✅ | $0.95 | $3.15 |
75
- | GLM 5.1 | 203K | ❌ | | $1.30 | $4.30 |
76
- | GLM 5.2 | 203K | ❌ | ✅ | $1.40 | $4.40 |
77
- | Kimi K2.5 | 262K | | ✅ | $0.60 | $3.00 |
74
+ | GLM 5.2 | 1.0M | ❌ | ✅ | $1.40 | $4.40 |
75
+ | GLM 5.2 Fast | 524K | ❌ | | $2.10 | $6.60 |
76
+ | Inkling | 1.0M | ❌ | ✅ | $1.00 | $4.05 |
77
+ | Inkling Small | 1.0M | | ✅ | Free | Free |
78
78
  | Kimi K2.6 | 262K | ✅ | ✅ | $0.60 | $3.00 |
79
79
  | Kimi K2.7 Code | 262K | ❌ | ✅ | $0.95 | $4.00 |
80
- | Nemotron Super | 203K | ❌ | ✅ | $0.30 | $0.75 |
80
+ | Kimi K3 | 1.0M | ❌ | ✅ | $3.00 | $15.00 |
81
+ | Mercury 2 | 8K | ❌ | ✅ | Free | Free |
81
82
  | Nemotron Ultra | 203K | ❌ | ✅ | $0.60 | $2.40 |
82
83
  | OpenAI GPT 120B | 128K | ❌ | ✅ | $0.10 | $0.50 |
84
+ | SID-1 | 33K | ❌ | ✅ | Free | Free |
83
85
 
84
86
  *Costs are per million tokens. Prices subject to change — check [baseten.co/pricing](https://www.baseten.co/pricing/) for current pricing.*
85
87
 
@@ -0,0 +1 @@
1
+ {}
package/index.ts CHANGED
@@ -29,6 +29,7 @@ import { getAgentDir, type ExtensionAPI, type ModelRegistry } from "@earendil-wo
29
29
  import modelsData from "./models.json" with { type: "json" };
30
30
  import customModelsData from "./custom-models.json" with { type: "json" };
31
31
  import patchData from "./patch.json" with { type: "json" };
32
+ import deprecatedData from "./deprecated-models.json" with { type: "json" };
32
33
  import fs from "fs";
33
34
  import path from "path";
34
35
 
@@ -38,7 +39,7 @@ interface JsonModel {
38
39
  id: string;
39
40
  name: string;
40
41
  reasoning: boolean;
41
- input: string[];
42
+ input: ("text" | "image")[];
42
43
  cost: {
43
44
  input: number;
44
45
  output: number;
@@ -67,7 +68,7 @@ interface JsonModel {
67
68
  interface PatchEntry {
68
69
  name?: string;
69
70
  reasoning?: boolean;
70
- input?: string[];
71
+ input?: ("text" | "image")[];
71
72
  cost?: {
72
73
  input?: number;
73
74
  output?: number;
@@ -123,7 +124,10 @@ function applyPatch(model: JsonModel, patch: PatchEntry): JsonModel {
123
124
  function buildModels(base: JsonModel[], custom: JsonModel[], patch: PatchData): JsonModel[] {
124
125
  const modelMap = new Map<string, JsonModel>();
125
126
 
126
- for (const model of base) {
127
+ // Seed with the base list plus grace-period deprecated models so patch.json
128
+ // entries apply to deprecated models exactly as while the model was live
129
+ // (withDeprecated keeps live data on id conflicts).
130
+ for (const model of withDeprecated(base)) {
127
131
  modelMap.set(model.id, model);
128
132
  }
129
133
 
@@ -260,6 +264,35 @@ function mergeWithEmbedded(liveModels: JsonModel[], embeddedModels: JsonModel[])
260
264
  return result;
261
265
  }
262
266
 
267
+ // Grace period for delisted models. When the provider API stops listing a
268
+ // model, update-models.js moves its last-known definition into
269
+ // deprecated-models.json (stamped with deprecatedAt) instead of dropping it.
270
+ // For 14 days the model keeps working here so in-flight sessions and saved
271
+ // model settings do not break; afterwards it is evicted permanently.
272
+ const DEPRECATED_MODEL_TTL_MS = 14 * 24 * 60 * 60 * 1000;
273
+
274
+ // Grace-period deprecated models with deprecation metadata stripped.
275
+ function activeDeprecatedModels(): JsonModel[] {
276
+ const now = Date.now();
277
+ const result: JsonModel[] = [];
278
+ for (const entry of Object.values(deprecatedData as Record<string, JsonModel & { deprecatedAt?: string }>)) {
279
+ if (!entry?.id) continue;
280
+ const removedAt = Date.parse(entry.deprecatedAt ?? "");
281
+ if (Number.isNaN(removedAt) || now - removedAt > DEPRECATED_MODEL_TTL_MS) continue;
282
+ const model = { ...entry } as JsonModel & { deprecatedAt?: string };
283
+ delete model.deprecatedAt;
284
+ result.push(model);
285
+ }
286
+ return result;
287
+ }
288
+
289
+ // Append grace-period deprecated models the list does not already have (live data wins).
290
+ function withDeprecated(models: JsonModel[]): JsonModel[] {
291
+ const seen = new Set(models.map((m) => m.id));
292
+ const extras = activeDeprecatedModels().filter((m) => !seen.has(m.id));
293
+ return extras.length > 0 ? [...models, ...extras] : models;
294
+ }
295
+
263
296
  function loadStaleModels(embeddedModels: JsonModel[]): JsonModel[] {
264
297
  const cached = loadCachedModels();
265
298
  if (!cached || cached.length === 0) return embeddedModels;
package/models.json CHANGED
@@ -44,20 +44,20 @@
44
44
  }
45
45
  },
46
46
  {
47
- "id": "zai-org/GLM-5",
48
- "name": "GLM 5",
49
- "reasoning": false,
47
+ "id": "zai-org/GLM-5.2",
48
+ "name": "GLM 5.2",
49
+ "reasoning": true,
50
50
  "input": [
51
51
  "text"
52
52
  ],
53
53
  "cost": {
54
- "input": 0.95,
55
- "output": 3.15,
54
+ "input": 1.4,
55
+ "output": 4.4,
56
56
  "cacheRead": 0,
57
57
  "cacheWrite": 0
58
58
  },
59
- "contextWindow": 202800,
60
- "maxTokens": 202800,
59
+ "contextWindow": 1048576,
60
+ "maxTokens": 262144,
61
61
  "compat": {
62
62
  "supportsDeveloperRole": true,
63
63
  "supportsStore": false,
@@ -66,41 +66,42 @@
66
66
  }
67
67
  },
68
68
  {
69
- "id": "zai-org/GLM-5.1",
70
- "name": "GLM 5.1",
71
- "reasoning": false,
69
+ "id": "zai-org/GLM-5.2-Fast",
70
+ "name": "GLM 5.2 Fast",
71
+ "reasoning": true,
72
72
  "input": [
73
73
  "text"
74
74
  ],
75
75
  "cost": {
76
- "input": 1.3,
77
- "output": 4.3,
76
+ "input": 2.1,
77
+ "output": 6.6,
78
78
  "cacheRead": 0,
79
79
  "cacheWrite": 0
80
80
  },
81
- "contextWindow": 202800,
82
- "maxTokens": 202800,
81
+ "contextWindow": 524288,
82
+ "maxTokens": 262144,
83
83
  "compat": {
84
84
  "supportsDeveloperRole": true,
85
85
  "supportsStore": false,
86
- "maxTokensField": "max_completion_tokens"
86
+ "maxTokensField": "max_completion_tokens",
87
+ "thinkingFormat": "openai"
87
88
  }
88
89
  },
89
90
  {
90
- "id": "zai-org/GLM-5.2",
91
- "name": "GLM 5.2",
91
+ "id": "thinkingmachines/inkling",
92
+ "name": "Inkling",
92
93
  "reasoning": true,
93
94
  "input": [
94
95
  "text"
95
96
  ],
96
97
  "cost": {
97
- "input": 1.4,
98
- "output": 4.4,
98
+ "input": 1,
99
+ "output": 4.05,
99
100
  "cacheRead": 0,
100
101
  "cacheWrite": 0
101
102
  },
102
- "contextWindow": 202720,
103
- "maxTokens": 202720,
103
+ "contextWindow": 1048576,
104
+ "maxTokens": 32768,
104
105
  "compat": {
105
106
  "supportsDeveloperRole": true,
106
107
  "supportsStore": false,
@@ -109,21 +110,20 @@
109
110
  }
110
111
  },
111
112
  {
112
- "id": "moonshotai/Kimi-K2.5",
113
- "name": "Kimi K2.5",
114
- "reasoning": false,
113
+ "id": "thinkingmachines/inkling-small",
114
+ "name": "Inkling Small",
115
+ "reasoning": true,
115
116
  "input": [
116
- "text",
117
- "image"
117
+ "text"
118
118
  ],
119
119
  "cost": {
120
- "input": 0.6,
121
- "output": 3,
120
+ "input": 0,
121
+ "output": 0,
122
122
  "cacheRead": 0,
123
123
  "cacheWrite": 0
124
124
  },
125
- "contextWindow": 262000,
126
- "maxTokens": 262000,
125
+ "contextWindow": 1048576,
126
+ "maxTokens": 32768,
127
127
  "compat": {
128
128
  "supportsDeveloperRole": true,
129
129
  "supportsStore": false,
@@ -177,20 +177,42 @@
177
177
  }
178
178
  },
179
179
  {
180
- "id": "nvidia/Nemotron-120B-A12B",
181
- "name": "Nemotron Super",
180
+ "id": "moonshotai/Kimi-K3",
181
+ "name": "Kimi K3",
182
182
  "reasoning": true,
183
183
  "input": [
184
184
  "text"
185
185
  ],
186
186
  "cost": {
187
- "input": 0.3,
188
- "output": 0.75,
187
+ "input": 3,
188
+ "output": 15,
189
189
  "cacheRead": 0,
190
190
  "cacheWrite": 0
191
191
  },
192
- "contextWindow": 202800,
193
- "maxTokens": 202800,
192
+ "contextWindow": 1048576,
193
+ "maxTokens": 262144,
194
+ "compat": {
195
+ "supportsDeveloperRole": true,
196
+ "supportsStore": false,
197
+ "maxTokensField": "max_completion_tokens",
198
+ "thinkingFormat": "openai"
199
+ }
200
+ },
201
+ {
202
+ "id": "inception/mercury-2",
203
+ "name": "Mercury 2",
204
+ "reasoning": true,
205
+ "input": [
206
+ "text"
207
+ ],
208
+ "cost": {
209
+ "input": 0,
210
+ "output": 0,
211
+ "cacheRead": 0,
212
+ "cacheWrite": 0
213
+ },
214
+ "contextWindow": 8192,
215
+ "maxTokens": 5000,
194
216
  "compat": {
195
217
  "supportsDeveloperRole": true,
196
218
  "supportsStore": false,
@@ -242,5 +264,27 @@
242
264
  "thinkingFormat": "openai",
243
265
  "supportsReasoningEffort": true
244
266
  }
267
+ },
268
+ {
269
+ "id": "sid/sid-1",
270
+ "name": "SID-1",
271
+ "reasoning": true,
272
+ "input": [
273
+ "text"
274
+ ],
275
+ "cost": {
276
+ "input": 0,
277
+ "output": 0,
278
+ "cacheRead": 0,
279
+ "cacheWrite": 0
280
+ },
281
+ "contextWindow": 32768,
282
+ "maxTokens": 5000,
283
+ "compat": {
284
+ "supportsDeveloperRole": true,
285
+ "supportsStore": false,
286
+ "maxTokensField": "max_completion_tokens",
287
+ "thinkingFormat": "openai"
288
+ }
245
289
  }
246
290
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-baseten-provider",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Baseten provider extension for pi - Access DeepSeek, Kimi, GLM, MiniMax, Nemotron, and GPT-OSS models through the Baseten Model API",
5
5
  "author": "monotykamary",
6
6
  "homepage": "https://github.com/monotykamary/pi-baseten-provider#readme",
@@ -30,6 +30,7 @@
30
30
  "files": [
31
31
  "index.ts",
32
32
  "models.json",
33
+ "deprecated-models.json",
33
34
  "custom-models.json",
34
35
  "patch.json",
35
36
  "scripts/update-models.js"
@@ -276,6 +276,67 @@ function updateReadme(models) {
276
276
 
277
277
  // ─── Main ────────────────────────────────────────────────────────────────────
278
278
 
279
+ // Grace period for delisted models: update-models.js moves models the API no
280
+ // longer lists into deprecated-models.json (stamped with deprecatedAt) instead
281
+ // of dropping them; the runtime appends them back so sessions and saved model
282
+ // settings keep working, and after 14 days they are evicted permanently.
283
+ const DEPRECATED_MODEL_TTL_MS = 14 * 24 * 60 * 60 * 1000;
284
+
285
+ /**
286
+ * Reconcile deprecated-models.json against the freshly fetched model list.
287
+ * - in old models.json but not the API: moved into the deprecated file
288
+ * (deprecatedAt = now; preserved on repeat runs so the grace clock is not reset)
289
+ * - back in the API: resurrected (dropped from the deprecated file)
290
+ * - deprecatedAt older than 14 days: evicted permanently
291
+ * Must run BEFORE the new models.json is written; it reads the old file itself.
292
+ */
293
+ function updateDeprecatedModels(modelsJsonPath, newModels) {
294
+ const deprecatedPath = path.join(path.dirname(modelsJsonPath), 'deprecated-models.json');
295
+
296
+ let oldModels = [];
297
+ try {
298
+ const parsed = JSON.parse(fs.readFileSync(modelsJsonPath, 'utf8'));
299
+ if (Array.isArray(parsed)) oldModels = parsed;
300
+ } catch { /* first run: no previous models.json */ }
301
+
302
+ let deprecated = {};
303
+ try {
304
+ const parsed = JSON.parse(fs.readFileSync(deprecatedPath, 'utf8'));
305
+ if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) deprecated = parsed;
306
+ } catch { /* no graveyard yet */ }
307
+
308
+ const currentIds = new Set(newModels.map(m => m.id));
309
+ const now = new Date().toISOString();
310
+ const added = [];
311
+ const resurrected = [];
312
+ const evicted = [];
313
+
314
+ for (const old of oldModels) {
315
+ if (old && old.id && !currentIds.has(old.id) && !deprecated[old.id]) {
316
+ deprecated[old.id] = { ...old, deprecatedAt: now };
317
+ added.push(old.id);
318
+ }
319
+ }
320
+
321
+ for (const [id, entry] of Object.entries(deprecated)) {
322
+ if (currentIds.has(id)) {
323
+ delete deprecated[id];
324
+ resurrected.push(id);
325
+ continue;
326
+ }
327
+ const removedAt = Date.parse(entry && entry.deprecatedAt ? entry.deprecatedAt : '');
328
+ if (Number.isNaN(removedAt) || Date.now() - removedAt > DEPRECATED_MODEL_TTL_MS) {
329
+ delete deprecated[id];
330
+ evicted.push(id);
331
+ }
332
+ }
333
+
334
+ if (added.length > 0 || resurrected.length > 0 || evicted.length > 0) {
335
+ fs.writeFileSync(deprecatedPath, JSON.stringify(deprecated, null, 2) + '\n');
336
+ console.log('Updated deprecated-models.json ' + JSON.stringify({ added, resurrected, evicted }));
337
+ }
338
+ }
339
+
279
340
  async function main() {
280
341
  try {
281
342
  const apiModels = await fetchModels();
@@ -299,6 +360,8 @@ async function main() {
299
360
  models.sort((a, b) => a.name.localeCompare(b.name));
300
361
 
301
362
  // Save models.json (pure API output, no patch/custom baked in)
363
+ // Move delisted models to deprecated-models.json BEFORE models.json is overwritten
364
+ updateDeprecatedModels(MODELS_JSON_PATH, models);
302
365
  saveJson(MODELS_JSON_PATH, models);
303
366
 
304
367
  // Build full model list for README: base → patch → custom