pi-baseten-provider 1.0.7 → 1.0.9
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 +10 -9
- package/custom-models.json +1 -24
- package/deprecated-models.json +1 -0
- package/index.ts +45 -6
- package/models.json +95 -69
- package/package.json +2 -1
- package/patch.json +183 -18
- package/scripts/update-models.js +72 -8
package/README.md
CHANGED
|
@@ -69,19 +69,20 @@ pi
|
|
|
69
69
|
|
|
70
70
|
| Model | Context | Vision | Reasoning | Input $/M | Output $/M |
|
|
71
71
|
|-------|---------|--------|-----------|-----------|------------|
|
|
72
|
-
|
|
|
72
|
+
| Deepseek V4 Flash 0731 | 1.0M | ❌ | ✅ | $0.13 | $0.26 |
|
|
73
|
+
| Deepseek V4 Pro | 262K | ❌ | ✅ | $1.74 | $3.48 |
|
|
73
74
|
| 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 |
|
|
75
|
+
| GLM 5.2 | 1.0M | ❌ | ✅ | $1.40 | $4.40 |
|
|
77
76
|
| GLM 5.2 Fast | 524K | ❌ | ✅ | $2.10 | $6.60 |
|
|
78
|
-
| Inkling | 1.0M |
|
|
79
|
-
|
|
|
80
|
-
| Kimi K2.6 | 262K | ✅ | ✅ | $0.
|
|
81
|
-
| Kimi K2.7 Code | 262K |
|
|
82
|
-
|
|
|
77
|
+
| Inkling | 1.0M | ✅ | ✅ | $1.00 | $4.05 |
|
|
78
|
+
| Inkling Small | 1.0M | ✅ | ✅ | $0.50 | $1.20 |
|
|
79
|
+
| Kimi K2.6 | 262K | ✅ | ✅ | $0.95 | $4.00 |
|
|
80
|
+
| Kimi K2.7 Code | 262K | ✅ | ✅ | $0.95 | $4.00 |
|
|
81
|
+
| Kimi K3 | 1.0M | ✅ | ✅ | $3.00 | $15.00 |
|
|
82
|
+
| Mercury 2 | 8K | ❌ | ✅ | Free | Free |
|
|
83
83
|
| Nemotron Ultra | 203K | ❌ | ✅ | $0.60 | $2.40 |
|
|
84
84
|
| OpenAI GPT 120B | 128K | ❌ | ✅ | $0.10 | $0.50 |
|
|
85
|
+
| SID-1 | 33K | ❌ | ❌ | Free | Free |
|
|
85
86
|
|
|
86
87
|
*Costs are per million tokens. Prices subject to change — check [baseten.co/pricing](https://www.baseten.co/pricing/) for current pricing.*
|
|
87
88
|
|
package/custom-models.json
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "deepseek-ai/DeepSeek-V4-Pro",
|
|
4
|
-
"name": "DeepSeek V4 Pro",
|
|
5
|
-
"reasoning": true,
|
|
6
|
-
"input": [
|
|
7
|
-
"text"
|
|
8
|
-
],
|
|
9
|
-
"cost": {
|
|
10
|
-
"input": 1.74,
|
|
11
|
-
"output": 3.48,
|
|
12
|
-
"cacheRead": 0.15,
|
|
13
|
-
"cacheWrite": 0
|
|
14
|
-
},
|
|
15
|
-
"contextWindow": 131000,
|
|
16
|
-
"maxTokens": 131000,
|
|
17
|
-
"compat": {
|
|
18
|
-
"supportsDeveloperRole": true,
|
|
19
|
-
"supportsStore": false,
|
|
20
|
-
"maxTokensField": "max_completion_tokens",
|
|
21
|
-
"thinkingFormat": "openai"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
]
|
|
1
|
+
[]
|
|
@@ -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
|
|
|
@@ -48,6 +49,7 @@ interface JsonModel {
|
|
|
48
49
|
contextWindow: number;
|
|
49
50
|
maxTokens: number;
|
|
50
51
|
thinkingLevelMap?: {
|
|
52
|
+
off?: string | null;
|
|
51
53
|
minimal?: string | null;
|
|
52
54
|
low?: string | null;
|
|
53
55
|
medium?: string | null;
|
|
@@ -59,8 +61,10 @@ interface JsonModel {
|
|
|
59
61
|
supportsDeveloperRole?: boolean;
|
|
60
62
|
supportsStore?: boolean;
|
|
61
63
|
maxTokensField?: "max_completion_tokens" | "max_tokens";
|
|
62
|
-
thinkingFormat?: "openai" | "zai" | "qwen" | "qwen-chat-template";
|
|
64
|
+
thinkingFormat?: "openai" | "zai" | "qwen" | "qwen-chat-template" | "chat-template";
|
|
63
65
|
supportsReasoningEffort?: boolean;
|
|
66
|
+
requiresReasoningContentOnAssistantMessages?: boolean;
|
|
67
|
+
chatTemplateKwargs?: Record<string, unknown>;
|
|
64
68
|
};
|
|
65
69
|
}
|
|
66
70
|
|
|
@@ -123,7 +127,10 @@ function applyPatch(model: JsonModel, patch: PatchEntry): JsonModel {
|
|
|
123
127
|
function buildModels(base: JsonModel[], custom: JsonModel[], patch: PatchData): JsonModel[] {
|
|
124
128
|
const modelMap = new Map<string, JsonModel>();
|
|
125
129
|
|
|
126
|
-
|
|
130
|
+
// Seed with the base list plus grace-period deprecated models so patch.json
|
|
131
|
+
// entries apply to deprecated models exactly as while the model was live
|
|
132
|
+
// (withDeprecated keeps live data on id conflicts).
|
|
133
|
+
for (const model of withDeprecated(base)) {
|
|
127
134
|
modelMap.set(model.id, model);
|
|
128
135
|
}
|
|
129
136
|
|
|
@@ -177,15 +184,18 @@ function transformApiModel(apiModel: any): JsonModel | null {
|
|
|
177
184
|
cost: {
|
|
178
185
|
input: toPerM(pricing.prompt),
|
|
179
186
|
output: toPerM(pricing.completion),
|
|
180
|
-
cacheRead: toPerM(pricing.cache_prompt),
|
|
187
|
+
cacheRead: toPerM(pricing.input_cache_read ?? pricing.cache_prompt),
|
|
181
188
|
cacheWrite: 0,
|
|
182
189
|
},
|
|
183
190
|
contextWindow: apiModel.context_length || 131072,
|
|
184
191
|
maxTokens: apiModel.max_completion_tokens || 131072,
|
|
185
192
|
};
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
193
|
+
model.compat = {
|
|
194
|
+
supportsDeveloperRole: true,
|
|
195
|
+
supportsStore: false,
|
|
196
|
+
maxTokensField: "max_completion_tokens",
|
|
197
|
+
...(features.includes("reasoning_effort") ? { supportsReasoningEffort: true } : {}),
|
|
198
|
+
};
|
|
189
199
|
return model;
|
|
190
200
|
}
|
|
191
201
|
|
|
@@ -260,6 +270,35 @@ function mergeWithEmbedded(liveModels: JsonModel[], embeddedModels: JsonModel[])
|
|
|
260
270
|
return result;
|
|
261
271
|
}
|
|
262
272
|
|
|
273
|
+
// Grace period for delisted models. When the provider API stops listing a
|
|
274
|
+
// model, update-models.js moves its last-known definition into
|
|
275
|
+
// deprecated-models.json (stamped with deprecatedAt) instead of dropping it.
|
|
276
|
+
// For 14 days the model keeps working here so in-flight sessions and saved
|
|
277
|
+
// model settings do not break; afterwards it is evicted permanently.
|
|
278
|
+
const DEPRECATED_MODEL_TTL_MS = 14 * 24 * 60 * 60 * 1000;
|
|
279
|
+
|
|
280
|
+
// Grace-period deprecated models with deprecation metadata stripped.
|
|
281
|
+
function activeDeprecatedModels(): JsonModel[] {
|
|
282
|
+
const now = Date.now();
|
|
283
|
+
const result: JsonModel[] = [];
|
|
284
|
+
for (const entry of Object.values(deprecatedData as Record<string, JsonModel & { deprecatedAt?: string }>)) {
|
|
285
|
+
if (!entry?.id) continue;
|
|
286
|
+
const removedAt = Date.parse(entry.deprecatedAt ?? "");
|
|
287
|
+
if (Number.isNaN(removedAt) || now - removedAt > DEPRECATED_MODEL_TTL_MS) continue;
|
|
288
|
+
const model = { ...entry } as JsonModel & { deprecatedAt?: string };
|
|
289
|
+
delete model.deprecatedAt;
|
|
290
|
+
result.push(model);
|
|
291
|
+
}
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Append grace-period deprecated models the list does not already have (live data wins).
|
|
296
|
+
function withDeprecated(models: JsonModel[]): JsonModel[] {
|
|
297
|
+
const seen = new Set(models.map((m) => m.id));
|
|
298
|
+
const extras = activeDeprecatedModels().filter((m) => !seen.has(m.id));
|
|
299
|
+
return extras.length > 0 ? [...models, ...extras] : models;
|
|
300
|
+
}
|
|
301
|
+
|
|
263
302
|
function loadStaleModels(embeddedModels: JsonModel[]): JsonModel[] {
|
|
264
303
|
const cached = loadCachedModels();
|
|
265
304
|
if (!cached || cached.length === 0) return embeddedModels;
|
package/models.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"id": "deepseek-ai/DeepSeek-V4-
|
|
4
|
-
"name": "Deepseek V4
|
|
3
|
+
"id": "deepseek-ai/DeepSeek-V4-Flash-0731",
|
|
4
|
+
"name": "Deepseek V4 Flash 0731",
|
|
5
5
|
"reasoning": true,
|
|
6
6
|
"input": [
|
|
7
7
|
"text"
|
|
8
8
|
],
|
|
9
9
|
"cost": {
|
|
10
|
-
"input":
|
|
11
|
-
"output":
|
|
12
|
-
"cacheRead": 0,
|
|
10
|
+
"input": 0.13,
|
|
11
|
+
"output": 0.26,
|
|
12
|
+
"cacheRead": 0.028,
|
|
13
13
|
"cacheWrite": 0
|
|
14
14
|
},
|
|
15
|
-
"contextWindow":
|
|
16
|
-
"maxTokens":
|
|
15
|
+
"contextWindow": 1048576,
|
|
16
|
+
"maxTokens": 1048576,
|
|
17
17
|
"compat": {
|
|
18
18
|
"supportsDeveloperRole": true,
|
|
19
19
|
"supportsStore": false,
|
|
@@ -22,20 +22,20 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
"id": "
|
|
26
|
-
"name": "
|
|
27
|
-
"reasoning":
|
|
25
|
+
"id": "deepseek-ai/DeepSeek-V4-Pro",
|
|
26
|
+
"name": "Deepseek V4 Pro",
|
|
27
|
+
"reasoning": true,
|
|
28
28
|
"input": [
|
|
29
29
|
"text"
|
|
30
30
|
],
|
|
31
31
|
"cost": {
|
|
32
|
-
"input":
|
|
33
|
-
"output":
|
|
34
|
-
"cacheRead": 0,
|
|
32
|
+
"input": 1.74,
|
|
33
|
+
"output": 3.48,
|
|
34
|
+
"cacheRead": 0.145,
|
|
35
35
|
"cacheWrite": 0
|
|
36
36
|
},
|
|
37
|
-
"contextWindow":
|
|
38
|
-
"maxTokens":
|
|
37
|
+
"contextWindow": 262144,
|
|
38
|
+
"maxTokens": 262144,
|
|
39
39
|
"compat": {
|
|
40
40
|
"supportsDeveloperRole": true,
|
|
41
41
|
"supportsStore": false,
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
"id": "zai-org/GLM-
|
|
48
|
-
"name": "GLM
|
|
47
|
+
"id": "zai-org/GLM-4.7",
|
|
48
|
+
"name": "GLM 4.7",
|
|
49
49
|
"reasoning": false,
|
|
50
50
|
"input": [
|
|
51
51
|
"text"
|
|
52
52
|
],
|
|
53
53
|
"cost": {
|
|
54
|
-
"input": 0.
|
|
55
|
-
"output":
|
|
56
|
-
"cacheRead": 0,
|
|
54
|
+
"input": 0.6,
|
|
55
|
+
"output": 2.2,
|
|
56
|
+
"cacheRead": 0.12,
|
|
57
57
|
"cacheWrite": 0
|
|
58
58
|
},
|
|
59
|
-
"contextWindow":
|
|
60
|
-
"maxTokens":
|
|
59
|
+
"contextWindow": 200000,
|
|
60
|
+
"maxTokens": 200000,
|
|
61
61
|
"compat": {
|
|
62
62
|
"supportsDeveloperRole": true,
|
|
63
63
|
"supportsStore": false,
|
|
@@ -65,27 +65,6 @@
|
|
|
65
65
|
"thinkingFormat": "openai"
|
|
66
66
|
}
|
|
67
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
68
|
{
|
|
90
69
|
"id": "zai-org/GLM-5.2",
|
|
91
70
|
"name": "GLM 5.2",
|
|
@@ -96,11 +75,11 @@
|
|
|
96
75
|
"cost": {
|
|
97
76
|
"input": 1.4,
|
|
98
77
|
"output": 4.4,
|
|
99
|
-
"cacheRead": 0,
|
|
78
|
+
"cacheRead": 0.14,
|
|
100
79
|
"cacheWrite": 0
|
|
101
80
|
},
|
|
102
|
-
"contextWindow":
|
|
103
|
-
"maxTokens":
|
|
81
|
+
"contextWindow": 1048576,
|
|
82
|
+
"maxTokens": 262144,
|
|
104
83
|
"compat": {
|
|
105
84
|
"supportsDeveloperRole": true,
|
|
106
85
|
"supportsStore": false,
|
|
@@ -118,11 +97,11 @@
|
|
|
118
97
|
"cost": {
|
|
119
98
|
"input": 2.1,
|
|
120
99
|
"output": 6.6,
|
|
121
|
-
"cacheRead": 0,
|
|
100
|
+
"cacheRead": 0.21,
|
|
122
101
|
"cacheWrite": 0
|
|
123
102
|
},
|
|
124
103
|
"contextWindow": 524288,
|
|
125
|
-
"maxTokens":
|
|
104
|
+
"maxTokens": 262144,
|
|
126
105
|
"compat": {
|
|
127
106
|
"supportsDeveloperRole": true,
|
|
128
107
|
"supportsStore": false,
|
|
@@ -135,12 +114,13 @@
|
|
|
135
114
|
"name": "Inkling",
|
|
136
115
|
"reasoning": true,
|
|
137
116
|
"input": [
|
|
138
|
-
"text"
|
|
117
|
+
"text",
|
|
118
|
+
"image"
|
|
139
119
|
],
|
|
140
120
|
"cost": {
|
|
141
121
|
"input": 1,
|
|
142
122
|
"output": 4.05,
|
|
143
|
-
"cacheRead": 0,
|
|
123
|
+
"cacheRead": 0.17,
|
|
144
124
|
"cacheWrite": 0
|
|
145
125
|
},
|
|
146
126
|
"contextWindow": 1048576,
|
|
@@ -153,21 +133,21 @@
|
|
|
153
133
|
}
|
|
154
134
|
},
|
|
155
135
|
{
|
|
156
|
-
"id": "
|
|
157
|
-
"name": "
|
|
158
|
-
"reasoning":
|
|
136
|
+
"id": "thinkingmachines/inkling-small",
|
|
137
|
+
"name": "Inkling Small",
|
|
138
|
+
"reasoning": true,
|
|
159
139
|
"input": [
|
|
160
140
|
"text",
|
|
161
141
|
"image"
|
|
162
142
|
],
|
|
163
143
|
"cost": {
|
|
164
|
-
"input": 0.
|
|
165
|
-
"output":
|
|
166
|
-
"cacheRead": 0,
|
|
144
|
+
"input": 0.5,
|
|
145
|
+
"output": 1.2,
|
|
146
|
+
"cacheRead": 0.1,
|
|
167
147
|
"cacheWrite": 0
|
|
168
148
|
},
|
|
169
|
-
"contextWindow":
|
|
170
|
-
"maxTokens":
|
|
149
|
+
"contextWindow": 1048576,
|
|
150
|
+
"maxTokens": 32768,
|
|
171
151
|
"compat": {
|
|
172
152
|
"supportsDeveloperRole": true,
|
|
173
153
|
"supportsStore": false,
|
|
@@ -186,7 +166,7 @@
|
|
|
186
166
|
"cost": {
|
|
187
167
|
"input": 0.95,
|
|
188
168
|
"output": 4,
|
|
189
|
-
"cacheRead": 0,
|
|
169
|
+
"cacheRead": 0.16,
|
|
190
170
|
"cacheWrite": 0
|
|
191
171
|
},
|
|
192
172
|
"contextWindow": 262000,
|
|
@@ -203,12 +183,13 @@
|
|
|
203
183
|
"name": "Kimi K2.7 Code",
|
|
204
184
|
"reasoning": true,
|
|
205
185
|
"input": [
|
|
206
|
-
"text"
|
|
186
|
+
"text",
|
|
187
|
+
"image"
|
|
207
188
|
],
|
|
208
189
|
"cost": {
|
|
209
190
|
"input": 0.95,
|
|
210
191
|
"output": 4,
|
|
211
|
-
"cacheRead": 0,
|
|
192
|
+
"cacheRead": 0.16,
|
|
212
193
|
"cacheWrite": 0
|
|
213
194
|
},
|
|
214
195
|
"contextWindow": 262000,
|
|
@@ -221,20 +202,43 @@
|
|
|
221
202
|
}
|
|
222
203
|
},
|
|
223
204
|
{
|
|
224
|
-
"id": "
|
|
225
|
-
"name": "
|
|
205
|
+
"id": "moonshotai/Kimi-K3",
|
|
206
|
+
"name": "Kimi K3",
|
|
207
|
+
"reasoning": true,
|
|
208
|
+
"input": [
|
|
209
|
+
"text",
|
|
210
|
+
"image"
|
|
211
|
+
],
|
|
212
|
+
"cost": {
|
|
213
|
+
"input": 3,
|
|
214
|
+
"output": 15,
|
|
215
|
+
"cacheRead": 0.3,
|
|
216
|
+
"cacheWrite": 0
|
|
217
|
+
},
|
|
218
|
+
"contextWindow": 1048576,
|
|
219
|
+
"maxTokens": 262144,
|
|
220
|
+
"compat": {
|
|
221
|
+
"supportsDeveloperRole": true,
|
|
222
|
+
"supportsStore": false,
|
|
223
|
+
"maxTokensField": "max_completion_tokens",
|
|
224
|
+
"thinkingFormat": "openai"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"id": "inception/mercury-2",
|
|
229
|
+
"name": "Mercury 2",
|
|
226
230
|
"reasoning": true,
|
|
227
231
|
"input": [
|
|
228
232
|
"text"
|
|
229
233
|
],
|
|
230
234
|
"cost": {
|
|
231
|
-
"input": 0
|
|
232
|
-
"output": 0
|
|
235
|
+
"input": 0,
|
|
236
|
+
"output": 0,
|
|
233
237
|
"cacheRead": 0,
|
|
234
238
|
"cacheWrite": 0
|
|
235
239
|
},
|
|
236
|
-
"contextWindow":
|
|
237
|
-
"maxTokens":
|
|
240
|
+
"contextWindow": 8192,
|
|
241
|
+
"maxTokens": 5000,
|
|
238
242
|
"compat": {
|
|
239
243
|
"supportsDeveloperRole": true,
|
|
240
244
|
"supportsStore": false,
|
|
@@ -252,7 +256,7 @@
|
|
|
252
256
|
"cost": {
|
|
253
257
|
"input": 0.6,
|
|
254
258
|
"output": 2.4,
|
|
255
|
-
"cacheRead": 0,
|
|
259
|
+
"cacheRead": 0.12,
|
|
256
260
|
"cacheWrite": 0
|
|
257
261
|
},
|
|
258
262
|
"contextWindow": 202800,
|
|
@@ -274,7 +278,7 @@
|
|
|
274
278
|
"cost": {
|
|
275
279
|
"input": 0.1,
|
|
276
280
|
"output": 0.5,
|
|
277
|
-
"cacheRead": 0,
|
|
281
|
+
"cacheRead": 0.1,
|
|
278
282
|
"cacheWrite": 0
|
|
279
283
|
},
|
|
280
284
|
"contextWindow": 128072,
|
|
@@ -286,5 +290,27 @@
|
|
|
286
290
|
"thinkingFormat": "openai",
|
|
287
291
|
"supportsReasoningEffort": true
|
|
288
292
|
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"id": "sid/sid-1",
|
|
296
|
+
"name": "SID-1",
|
|
297
|
+
"reasoning": true,
|
|
298
|
+
"input": [
|
|
299
|
+
"text"
|
|
300
|
+
],
|
|
301
|
+
"cost": {
|
|
302
|
+
"input": 0,
|
|
303
|
+
"output": 0,
|
|
304
|
+
"cacheRead": 0,
|
|
305
|
+
"cacheWrite": 0
|
|
306
|
+
},
|
|
307
|
+
"contextWindow": 32768,
|
|
308
|
+
"maxTokens": 5000,
|
|
309
|
+
"compat": {
|
|
310
|
+
"supportsDeveloperRole": true,
|
|
311
|
+
"supportsStore": false,
|
|
312
|
+
"maxTokensField": "max_completion_tokens",
|
|
313
|
+
"thinkingFormat": "openai"
|
|
314
|
+
}
|
|
289
315
|
}
|
|
290
316
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-baseten-provider",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
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/patch.json
CHANGED
|
@@ -1,54 +1,219 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
"
|
|
2
|
+
"deepseek-ai/DeepSeek-V4-Flash-0731": {
|
|
3
|
+
"thinkingLevelMap": {
|
|
4
|
+
"off": "none",
|
|
5
|
+
"minimal": null,
|
|
6
|
+
"low": "low",
|
|
7
|
+
"medium": null,
|
|
8
|
+
"high": "high",
|
|
9
|
+
"xhigh": null,
|
|
10
|
+
"max": "max"
|
|
7
11
|
},
|
|
8
12
|
"compat": {
|
|
9
|
-
"thinkingFormat": "
|
|
13
|
+
"thinkingFormat": "chat-template",
|
|
14
|
+
"supportsReasoningEffort": false,
|
|
15
|
+
"requiresReasoningContentOnAssistantMessages": true,
|
|
16
|
+
"chatTemplateKwargs": {
|
|
17
|
+
"thinking": {
|
|
18
|
+
"$var": "thinking.enabled"
|
|
19
|
+
},
|
|
20
|
+
"reasoning_effort": {
|
|
21
|
+
"$var": "thinking.effort"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
10
24
|
}
|
|
11
25
|
},
|
|
12
|
-
"
|
|
13
|
-
"
|
|
26
|
+
"deepseek-ai/DeepSeek-V4-Pro": {
|
|
27
|
+
"thinkingLevelMap": {
|
|
28
|
+
"off": "none",
|
|
29
|
+
"minimal": "minimal",
|
|
30
|
+
"low": "low",
|
|
31
|
+
"medium": "medium",
|
|
32
|
+
"high": "high",
|
|
33
|
+
"xhigh": "xhigh",
|
|
34
|
+
"max": "max"
|
|
35
|
+
},
|
|
14
36
|
"compat": {
|
|
15
|
-
"thinkingFormat": "
|
|
37
|
+
"thinkingFormat": "openai",
|
|
38
|
+
"supportsReasoningEffort": true,
|
|
39
|
+
"requiresReasoningContentOnAssistantMessages": true
|
|
16
40
|
}
|
|
17
41
|
},
|
|
18
42
|
"zai-org/GLM-4.7": {
|
|
19
43
|
"reasoning": true,
|
|
44
|
+
"thinkingLevelMap": {
|
|
45
|
+
"off": "none",
|
|
46
|
+
"minimal": null,
|
|
47
|
+
"low": null,
|
|
48
|
+
"medium": null,
|
|
49
|
+
"high": "high",
|
|
50
|
+
"xhigh": null,
|
|
51
|
+
"max": null
|
|
52
|
+
},
|
|
20
53
|
"compat": {
|
|
21
|
-
"thinkingFormat": "qwen-chat-template"
|
|
54
|
+
"thinkingFormat": "qwen-chat-template",
|
|
55
|
+
"supportsReasoningEffort": false,
|
|
56
|
+
"requiresReasoningContentOnAssistantMessages": true
|
|
22
57
|
}
|
|
23
58
|
},
|
|
24
|
-
"zai-org/GLM-5": {
|
|
25
|
-
"
|
|
59
|
+
"zai-org/GLM-5.2": {
|
|
60
|
+
"thinkingLevelMap": {
|
|
61
|
+
"off": "none",
|
|
62
|
+
"minimal": null,
|
|
63
|
+
"low": null,
|
|
64
|
+
"medium": null,
|
|
65
|
+
"high": "high",
|
|
66
|
+
"xhigh": null,
|
|
67
|
+
"max": "max"
|
|
68
|
+
},
|
|
26
69
|
"compat": {
|
|
27
|
-
"thinkingFormat": "
|
|
70
|
+
"thinkingFormat": "openai",
|
|
71
|
+
"supportsReasoningEffort": true,
|
|
72
|
+
"requiresReasoningContentOnAssistantMessages": true
|
|
28
73
|
}
|
|
29
74
|
},
|
|
30
|
-
"zai-org/GLM-5.2": {
|
|
75
|
+
"zai-org/GLM-5.2-Fast": {
|
|
76
|
+
"thinkingLevelMap": {
|
|
77
|
+
"off": "none",
|
|
78
|
+
"minimal": null,
|
|
79
|
+
"low": null,
|
|
80
|
+
"medium": null,
|
|
81
|
+
"high": "high",
|
|
82
|
+
"xhigh": null,
|
|
83
|
+
"max": "max"
|
|
84
|
+
},
|
|
31
85
|
"compat": {
|
|
32
|
-
"thinkingFormat": "
|
|
86
|
+
"thinkingFormat": "openai",
|
|
87
|
+
"supportsReasoningEffort": true,
|
|
88
|
+
"requiresReasoningContentOnAssistantMessages": true
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"thinkingmachines/inkling": {
|
|
92
|
+
"thinkingLevelMap": {
|
|
93
|
+
"off": "none",
|
|
94
|
+
"minimal": "minimal",
|
|
95
|
+
"low": "low",
|
|
96
|
+
"medium": "medium",
|
|
97
|
+
"high": "high",
|
|
98
|
+
"xhigh": "xhigh",
|
|
99
|
+
"max": "max"
|
|
33
100
|
},
|
|
101
|
+
"compat": {
|
|
102
|
+
"thinkingFormat": "openai",
|
|
103
|
+
"supportsReasoningEffort": true
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"thinkingmachines/inkling-small": {
|
|
34
107
|
"thinkingLevelMap": {
|
|
108
|
+
"off": "none",
|
|
35
109
|
"minimal": "minimal",
|
|
36
110
|
"low": "low",
|
|
37
111
|
"medium": "medium",
|
|
38
112
|
"high": "high",
|
|
113
|
+
"xhigh": "xhigh",
|
|
39
114
|
"max": "max"
|
|
115
|
+
},
|
|
116
|
+
"compat": {
|
|
117
|
+
"thinkingFormat": "openai",
|
|
118
|
+
"supportsReasoningEffort": true
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"moonshotai/Kimi-K2.6": {
|
|
122
|
+
"thinkingLevelMap": {
|
|
123
|
+
"off": "none",
|
|
124
|
+
"minimal": null,
|
|
125
|
+
"low": null,
|
|
126
|
+
"medium": null,
|
|
127
|
+
"high": "high",
|
|
128
|
+
"xhigh": null,
|
|
129
|
+
"max": null
|
|
130
|
+
},
|
|
131
|
+
"compat": {
|
|
132
|
+
"thinkingFormat": "qwen-chat-template",
|
|
133
|
+
"supportsReasoningEffort": false,
|
|
134
|
+
"requiresReasoningContentOnAssistantMessages": true
|
|
40
135
|
}
|
|
41
136
|
},
|
|
42
137
|
"moonshotai/Kimi-K2.7-Code": {
|
|
43
138
|
"thinkingLevelMap": {
|
|
139
|
+
"off": "none",
|
|
140
|
+
"minimal": null,
|
|
141
|
+
"low": null,
|
|
142
|
+
"medium": null,
|
|
143
|
+
"high": "high",
|
|
144
|
+
"xhigh": null,
|
|
145
|
+
"max": null
|
|
146
|
+
},
|
|
147
|
+
"compat": {
|
|
148
|
+
"thinkingFormat": "qwen-chat-template",
|
|
149
|
+
"supportsReasoningEffort": false,
|
|
150
|
+
"requiresReasoningContentOnAssistantMessages": true
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"moonshotai/Kimi-K3": {
|
|
154
|
+
"thinkingLevelMap": {
|
|
155
|
+
"off": "none",
|
|
156
|
+
"minimal": null,
|
|
157
|
+
"low": "low",
|
|
158
|
+
"medium": null,
|
|
159
|
+
"high": "high",
|
|
160
|
+
"xhigh": null,
|
|
161
|
+
"max": "max"
|
|
162
|
+
},
|
|
163
|
+
"compat": {
|
|
164
|
+
"thinkingFormat": "openai",
|
|
165
|
+
"supportsReasoningEffort": true,
|
|
166
|
+
"requiresReasoningContentOnAssistantMessages": true
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B": {
|
|
170
|
+
"thinkingLevelMap": {
|
|
171
|
+
"off": "none",
|
|
44
172
|
"minimal": null,
|
|
173
|
+
"low": null,
|
|
174
|
+
"medium": null,
|
|
175
|
+
"high": "high",
|
|
176
|
+
"xhigh": null,
|
|
177
|
+
"max": null
|
|
178
|
+
},
|
|
179
|
+
"compat": {
|
|
180
|
+
"thinkingFormat": "qwen-chat-template",
|
|
181
|
+
"supportsReasoningEffort": false,
|
|
182
|
+
"requiresReasoningContentOnAssistantMessages": true
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"openai/gpt-oss-120b": {
|
|
186
|
+
"thinkingLevelMap": {
|
|
187
|
+
"off": "none",
|
|
188
|
+
"minimal": "minimal",
|
|
189
|
+
"low": "low",
|
|
190
|
+
"medium": "medium",
|
|
191
|
+
"high": "high",
|
|
192
|
+
"xhigh": "xhigh",
|
|
193
|
+
"max": "max"
|
|
194
|
+
},
|
|
195
|
+
"compat": {
|
|
196
|
+
"thinkingFormat": "openai",
|
|
197
|
+
"supportsReasoningEffort": true
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"inception/mercury-2": {
|
|
201
|
+
"reasoning": true,
|
|
202
|
+
"thinkingLevelMap": {
|
|
203
|
+
"off": "instant",
|
|
204
|
+
"minimal": "low",
|
|
45
205
|
"low": "low",
|
|
46
206
|
"medium": "medium",
|
|
47
207
|
"high": "high",
|
|
48
|
-
"xhigh": null
|
|
208
|
+
"xhigh": null,
|
|
209
|
+
"max": null
|
|
210
|
+
},
|
|
211
|
+
"compat": {
|
|
212
|
+
"thinkingFormat": "openai",
|
|
213
|
+
"supportsReasoningEffort": true
|
|
49
214
|
}
|
|
50
215
|
},
|
|
51
|
-
"
|
|
52
|
-
"reasoning":
|
|
216
|
+
"sid/sid-1": {
|
|
217
|
+
"reasoning": false
|
|
53
218
|
}
|
|
54
219
|
}
|
package/scripts/update-models.js
CHANGED
|
@@ -96,16 +96,17 @@ function transformApiModel(apiModel, existingModelsMap) {
|
|
|
96
96
|
}
|
|
97
97
|
// Update features from API
|
|
98
98
|
const features = apiModel.supported_features || [];
|
|
99
|
-
existing.reasoning = features.includes('reasoning')
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
99
|
+
existing.reasoning = features.includes('reasoning');
|
|
100
|
+
const hasVision = (apiModel.input_modalities || []).includes('image');
|
|
101
|
+
existing.input = hasVision ? ['text', 'image'] : ['text'];
|
|
103
102
|
// Update pricing from API
|
|
104
103
|
const pricing = apiModel.pricing || {};
|
|
105
104
|
const inputCost = toPerMillion(pricing.prompt);
|
|
106
105
|
const outputCost = toPerMillion(pricing.completion);
|
|
107
|
-
|
|
108
|
-
if (
|
|
106
|
+
const cacheReadCost = toPerMillion(pricing.input_cache_read ?? pricing.cache_prompt);
|
|
107
|
+
if (inputCost !== null) existing.cost.input = inputCost;
|
|
108
|
+
if (outputCost !== null) existing.cost.output = outputCost;
|
|
109
|
+
if (cacheReadCost !== null) existing.cost.cacheRead = cacheReadCost;
|
|
109
110
|
return existing;
|
|
110
111
|
}
|
|
111
112
|
|
|
@@ -113,7 +114,7 @@ function transformApiModel(apiModel, existingModelsMap) {
|
|
|
113
114
|
const features = apiModel.supported_features || [];
|
|
114
115
|
const pricing = apiModel.pricing || {};
|
|
115
116
|
const hasReasoning = features.includes('reasoning');
|
|
116
|
-
const hasVision =
|
|
117
|
+
const hasVision = (apiModel.input_modalities || []).includes('image');
|
|
117
118
|
|
|
118
119
|
const inputTypes = ['text'];
|
|
119
120
|
if (hasVision) inputTypes.push('image');
|
|
@@ -130,7 +131,7 @@ function transformApiModel(apiModel, existingModelsMap) {
|
|
|
130
131
|
cost: {
|
|
131
132
|
input: inputCost,
|
|
132
133
|
output: outputCost,
|
|
133
|
-
cacheRead: 0,
|
|
134
|
+
cacheRead: toPerMillion(pricing.input_cache_read ?? pricing.cache_prompt) || 0,
|
|
134
135
|
cacheWrite: 0,
|
|
135
136
|
},
|
|
136
137
|
contextWindow: apiModel.context_length || 131072,
|
|
@@ -276,6 +277,67 @@ function updateReadme(models) {
|
|
|
276
277
|
|
|
277
278
|
// ─── Main ────────────────────────────────────────────────────────────────────
|
|
278
279
|
|
|
280
|
+
// Grace period for delisted models: update-models.js moves models the API no
|
|
281
|
+
// longer lists into deprecated-models.json (stamped with deprecatedAt) instead
|
|
282
|
+
// of dropping them; the runtime appends them back so sessions and saved model
|
|
283
|
+
// settings keep working, and after 14 days they are evicted permanently.
|
|
284
|
+
const DEPRECATED_MODEL_TTL_MS = 14 * 24 * 60 * 60 * 1000;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Reconcile deprecated-models.json against the freshly fetched model list.
|
|
288
|
+
* - in old models.json but not the API: moved into the deprecated file
|
|
289
|
+
* (deprecatedAt = now; preserved on repeat runs so the grace clock is not reset)
|
|
290
|
+
* - back in the API: resurrected (dropped from the deprecated file)
|
|
291
|
+
* - deprecatedAt older than 14 days: evicted permanently
|
|
292
|
+
* Must run BEFORE the new models.json is written; it reads the old file itself.
|
|
293
|
+
*/
|
|
294
|
+
function updateDeprecatedModels(modelsJsonPath, newModels) {
|
|
295
|
+
const deprecatedPath = path.join(path.dirname(modelsJsonPath), 'deprecated-models.json');
|
|
296
|
+
|
|
297
|
+
let oldModels = [];
|
|
298
|
+
try {
|
|
299
|
+
const parsed = JSON.parse(fs.readFileSync(modelsJsonPath, 'utf8'));
|
|
300
|
+
if (Array.isArray(parsed)) oldModels = parsed;
|
|
301
|
+
} catch { /* first run: no previous models.json */ }
|
|
302
|
+
|
|
303
|
+
let deprecated = {};
|
|
304
|
+
try {
|
|
305
|
+
const parsed = JSON.parse(fs.readFileSync(deprecatedPath, 'utf8'));
|
|
306
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) deprecated = parsed;
|
|
307
|
+
} catch { /* no graveyard yet */ }
|
|
308
|
+
|
|
309
|
+
const currentIds = new Set(newModels.map(m => m.id));
|
|
310
|
+
const now = new Date().toISOString();
|
|
311
|
+
const added = [];
|
|
312
|
+
const resurrected = [];
|
|
313
|
+
const evicted = [];
|
|
314
|
+
|
|
315
|
+
for (const old of oldModels) {
|
|
316
|
+
if (old && old.id && !currentIds.has(old.id) && !deprecated[old.id]) {
|
|
317
|
+
deprecated[old.id] = { ...old, deprecatedAt: now };
|
|
318
|
+
added.push(old.id);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
for (const [id, entry] of Object.entries(deprecated)) {
|
|
323
|
+
if (currentIds.has(id)) {
|
|
324
|
+
delete deprecated[id];
|
|
325
|
+
resurrected.push(id);
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
const removedAt = Date.parse(entry && entry.deprecatedAt ? entry.deprecatedAt : '');
|
|
329
|
+
if (Number.isNaN(removedAt) || Date.now() - removedAt > DEPRECATED_MODEL_TTL_MS) {
|
|
330
|
+
delete deprecated[id];
|
|
331
|
+
evicted.push(id);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (added.length > 0 || resurrected.length > 0 || evicted.length > 0) {
|
|
336
|
+
fs.writeFileSync(deprecatedPath, JSON.stringify(deprecated, null, 2) + '\n');
|
|
337
|
+
console.log('Updated deprecated-models.json ' + JSON.stringify({ added, resurrected, evicted }));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
279
341
|
async function main() {
|
|
280
342
|
try {
|
|
281
343
|
const apiModels = await fetchModels();
|
|
@@ -299,6 +361,8 @@ async function main() {
|
|
|
299
361
|
models.sort((a, b) => a.name.localeCompare(b.name));
|
|
300
362
|
|
|
301
363
|
// Save models.json (pure API output, no patch/custom baked in)
|
|
364
|
+
// Move delisted models to deprecated-models.json BEFORE models.json is overwritten
|
|
365
|
+
updateDeprecatedModels(MODELS_JSON_PATH, models);
|
|
302
366
|
saveJson(MODELS_JSON_PATH, models);
|
|
303
367
|
|
|
304
368
|
// Build full model list for README: base → patch → custom
|