pi-baseten-provider 1.0.1 → 1.0.2
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 +1 -1
- package/index.ts +4 -1
- package/models.json +4 -4
- package/package.json +1 -1
- package/scripts/update-models.js +3 -1
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ pi
|
|
|
73
73
|
| GLM 4.7 | 200K | ❌ | ✅ | $0.60 | $2.20 |
|
|
74
74
|
| GLM 5 | 203K | ❌ | ✅ | $0.95 | $3.15 |
|
|
75
75
|
| GLM 5.1 | 203K | ❌ | ❌ | $1.30 | $4.30 |
|
|
76
|
-
| GLM 5.2 |
|
|
76
|
+
| GLM 5.2 | 203K | ❌ | ✅ | $1.40 | $4.40 |
|
|
77
77
|
| Kimi K2.5 | 262K | ✅ | ✅ | $0.60 | $3.00 |
|
|
78
78
|
| Kimi K2.6 | 262K | ✅ | ✅ | $0.60 | $3.00 |
|
|
79
79
|
| Kimi K2.7 Code | 262K | ❌ | ✅ | $0.95 | $4.00 |
|
package/index.ts
CHANGED
|
@@ -165,7 +165,10 @@ function transformApiModel(apiModel: any): JsonModel | null {
|
|
|
165
165
|
const features: string[] = apiModel.supported_features || [];
|
|
166
166
|
const hasVision = (apiModel.input_modalities || []).includes("image");
|
|
167
167
|
const pricing = apiModel.pricing || {};
|
|
168
|
-
|
|
168
|
+
// API returns per-token pricing; convert to $/M and round to 6 decimals.
|
|
169
|
+
// The ×1e6 multiply produces float noise (e.g. 0.7000000000000001); rounding to
|
|
170
|
+
// 6 decimals normalizes it and preserves sub-cent cache prices like 0.003.
|
|
171
|
+
const toPerM = (v: any) => Math.round((typeof v === "string" ? parseFloat(v) : (v || 0)) * 1_000_000 * 1e6) / 1e6;
|
|
169
172
|
const model: JsonModel = {
|
|
170
173
|
id: apiModel.id,
|
|
171
174
|
name: apiModel.name || apiModel.id,
|
package/models.json
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"cacheRead": 0,
|
|
13
13
|
"cacheWrite": 0
|
|
14
14
|
},
|
|
15
|
-
"contextWindow":
|
|
16
|
-
"maxTokens":
|
|
15
|
+
"contextWindow": 262144,
|
|
16
|
+
"maxTokens": 262144,
|
|
17
17
|
"compat": {
|
|
18
18
|
"supportsDeveloperRole": true,
|
|
19
19
|
"supportsStore": false,
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"cacheRead": 0,
|
|
100
100
|
"cacheWrite": 0
|
|
101
101
|
},
|
|
102
|
-
"contextWindow":
|
|
103
|
-
"maxTokens":
|
|
102
|
+
"contextWindow": 202720,
|
|
103
|
+
"maxTokens": 202720,
|
|
104
104
|
"compat": {
|
|
105
105
|
"supportsDeveloperRole": true,
|
|
106
106
|
"supportsStore": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-baseten-provider",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
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",
|
package/scripts/update-models.js
CHANGED
|
@@ -50,7 +50,9 @@ function saveJson(filePath, data) {
|
|
|
50
50
|
// Convert per-token pricing from API to per-million-tokens
|
|
51
51
|
function toPerMillion(val) {
|
|
52
52
|
if (val === '' || val === null || val === undefined) return null;
|
|
53
|
-
|
|
53
|
+
// Round to 6 decimals of $/M: normalizes float noise from the ×1e6 multiply
|
|
54
|
+
// and preserves sub-cent cache prices like 0.003 ($/M).
|
|
55
|
+
return Math.round(parseFloat(val) * 1_000_000 * 1e6) / 1e6;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
// ─── API fetch ───────────────────────────────────────────────────────────────
|