pi-baseten-provider 1.0.7 → 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 +5 -5
- package/deprecated-models.json +1 -0
- package/index.ts +34 -1
- package/models.json +61 -61
- package/package.json +2 -1
- package/scripts/update-models.js +63 -0
package/README.md
CHANGED
|
@@ -71,17 +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 |
|
|
75
|
-
| GLM 5.1 | 203K | ❌ | ❌ | $1.30 | $4.30 |
|
|
76
|
-
| GLM 5.2 | 524K | ❌ | ✅ | $1.40 | $4.40 |
|
|
74
|
+
| GLM 5.2 | 1.0M | ❌ | ✅ | $1.40 | $4.40 |
|
|
77
75
|
| GLM 5.2 Fast | 524K | ❌ | ✅ | $2.10 | $6.60 |
|
|
78
76
|
| Inkling | 1.0M | ❌ | ✅ | $1.00 | $4.05 |
|
|
79
|
-
|
|
|
77
|
+
| Inkling Small | 1.0M | ❌ | ✅ | Free | Free |
|
|
80
78
|
| Kimi K2.6 | 262K | ✅ | ✅ | $0.60 | $3.00 |
|
|
81
79
|
| Kimi K2.7 Code | 262K | ❌ | ✅ | $0.95 | $4.00 |
|
|
82
|
-
|
|
|
80
|
+
| Kimi K3 | 1.0M | ❌ | ✅ | $3.00 | $15.00 |
|
|
81
|
+
| Mercury 2 | 8K | ❌ | ✅ | Free | Free |
|
|
83
82
|
| Nemotron Ultra | 203K | ❌ | ✅ | $0.60 | $2.40 |
|
|
84
83
|
| OpenAI GPT 120B | 128K | ❌ | ✅ | $0.10 | $0.50 |
|
|
84
|
+
| SID-1 | 33K | ❌ | ✅ | Free | Free |
|
|
85
85
|
|
|
86
86
|
*Costs are per million tokens. Prices subject to change — check [baseten.co/pricing](https://www.baseten.co/pricing/) for current pricing.*
|
|
87
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
|
|
|
@@ -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
|
-
|
|
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
|
@@ -43,49 +43,6 @@
|
|
|
43
43
|
"thinkingFormat": "openai"
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
{
|
|
47
|
-
"id": "zai-org/GLM-5",
|
|
48
|
-
"name": "GLM 5",
|
|
49
|
-
"reasoning": false,
|
|
50
|
-
"input": [
|
|
51
|
-
"text"
|
|
52
|
-
],
|
|
53
|
-
"cost": {
|
|
54
|
-
"input": 0.95,
|
|
55
|
-
"output": 3.15,
|
|
56
|
-
"cacheRead": 0,
|
|
57
|
-
"cacheWrite": 0
|
|
58
|
-
},
|
|
59
|
-
"contextWindow": 202800,
|
|
60
|
-
"maxTokens": 202800,
|
|
61
|
-
"compat": {
|
|
62
|
-
"supportsDeveloperRole": true,
|
|
63
|
-
"supportsStore": false,
|
|
64
|
-
"maxTokensField": "max_completion_tokens",
|
|
65
|
-
"thinkingFormat": "openai"
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"id": "zai-org/GLM-5.1",
|
|
70
|
-
"name": "GLM 5.1",
|
|
71
|
-
"reasoning": false,
|
|
72
|
-
"input": [
|
|
73
|
-
"text"
|
|
74
|
-
],
|
|
75
|
-
"cost": {
|
|
76
|
-
"input": 1.3,
|
|
77
|
-
"output": 4.3,
|
|
78
|
-
"cacheRead": 0,
|
|
79
|
-
"cacheWrite": 0
|
|
80
|
-
},
|
|
81
|
-
"contextWindow": 202800,
|
|
82
|
-
"maxTokens": 202800,
|
|
83
|
-
"compat": {
|
|
84
|
-
"supportsDeveloperRole": true,
|
|
85
|
-
"supportsStore": false,
|
|
86
|
-
"maxTokensField": "max_completion_tokens"
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
46
|
{
|
|
90
47
|
"id": "zai-org/GLM-5.2",
|
|
91
48
|
"name": "GLM 5.2",
|
|
@@ -99,8 +56,8 @@
|
|
|
99
56
|
"cacheRead": 0,
|
|
100
57
|
"cacheWrite": 0
|
|
101
58
|
},
|
|
102
|
-
"contextWindow":
|
|
103
|
-
"maxTokens":
|
|
59
|
+
"contextWindow": 1048576,
|
|
60
|
+
"maxTokens": 262144,
|
|
104
61
|
"compat": {
|
|
105
62
|
"supportsDeveloperRole": true,
|
|
106
63
|
"supportsStore": false,
|
|
@@ -122,7 +79,7 @@
|
|
|
122
79
|
"cacheWrite": 0
|
|
123
80
|
},
|
|
124
81
|
"contextWindow": 524288,
|
|
125
|
-
"maxTokens":
|
|
82
|
+
"maxTokens": 262144,
|
|
126
83
|
"compat": {
|
|
127
84
|
"supportsDeveloperRole": true,
|
|
128
85
|
"supportsStore": false,
|
|
@@ -153,21 +110,20 @@
|
|
|
153
110
|
}
|
|
154
111
|
},
|
|
155
112
|
{
|
|
156
|
-
"id": "
|
|
157
|
-
"name": "
|
|
158
|
-
"reasoning":
|
|
113
|
+
"id": "thinkingmachines/inkling-small",
|
|
114
|
+
"name": "Inkling Small",
|
|
115
|
+
"reasoning": true,
|
|
159
116
|
"input": [
|
|
160
|
-
"text"
|
|
161
|
-
"image"
|
|
117
|
+
"text"
|
|
162
118
|
],
|
|
163
119
|
"cost": {
|
|
164
|
-
"input": 0
|
|
165
|
-
"output":
|
|
120
|
+
"input": 0,
|
|
121
|
+
"output": 0,
|
|
166
122
|
"cacheRead": 0,
|
|
167
123
|
"cacheWrite": 0
|
|
168
124
|
},
|
|
169
|
-
"contextWindow":
|
|
170
|
-
"maxTokens":
|
|
125
|
+
"contextWindow": 1048576,
|
|
126
|
+
"maxTokens": 32768,
|
|
171
127
|
"compat": {
|
|
172
128
|
"supportsDeveloperRole": true,
|
|
173
129
|
"supportsStore": false,
|
|
@@ -221,20 +177,42 @@
|
|
|
221
177
|
}
|
|
222
178
|
},
|
|
223
179
|
{
|
|
224
|
-
"id": "
|
|
225
|
-
"name": "
|
|
180
|
+
"id": "moonshotai/Kimi-K3",
|
|
181
|
+
"name": "Kimi K3",
|
|
226
182
|
"reasoning": true,
|
|
227
183
|
"input": [
|
|
228
184
|
"text"
|
|
229
185
|
],
|
|
230
186
|
"cost": {
|
|
231
|
-
"input":
|
|
232
|
-
"output":
|
|
187
|
+
"input": 3,
|
|
188
|
+
"output": 15,
|
|
233
189
|
"cacheRead": 0,
|
|
234
190
|
"cacheWrite": 0
|
|
235
191
|
},
|
|
236
|
-
"contextWindow":
|
|
237
|
-
"maxTokens":
|
|
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,
|
|
238
216
|
"compat": {
|
|
239
217
|
"supportsDeveloperRole": true,
|
|
240
218
|
"supportsStore": false,
|
|
@@ -286,5 +264,27 @@
|
|
|
286
264
|
"thinkingFormat": "openai",
|
|
287
265
|
"supportsReasoningEffort": true
|
|
288
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
|
+
}
|
|
289
289
|
}
|
|
290
290
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-baseten-provider",
|
|
3
|
-
"version": "1.0.
|
|
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"
|
package/scripts/update-models.js
CHANGED
|
@@ -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
|