pi-tensorix-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 CHANGED
@@ -29,7 +29,6 @@ _32 models — DeepSeek, Kimi, GLM, Qwen, MiniMax, Llama — all **free** for [p
29
29
  | Chatterbox Turbo | 131K | ❌ | ❌ | **Free** | **Free** |
30
30
  | Deepseek R1 0528 | 131K | ❌ | ✅ | **Free** | **Free** |
31
31
  | Deepseek V3.2 | 164K | ❌ | ✅ | **Free** | **Free** |
32
- | Deepseek V4 Flash | 1.0M | ❌ | ✅ | **Free** | **Free** |
33
32
  | Deepseek V4 Flash 0731 | 131K | ❌ | ✅ | **Free** | **Free** |
34
33
  | Deepseek V4 Pro | 1.0M | ❌ | ✅ | **Free** | **Free** |
35
34
  | Glm 5 | 203K | ❌ | ✅ | **Free** | **Free** |
@@ -46,6 +45,8 @@ _32 models — DeepSeek, Kimi, GLM, Qwen, MiniMax, Llama — all **free** for [p
46
45
  | Qwen3 235b A22b 2507 | 262K | ❌ | ✅ | **Free** | **Free** |
47
46
  | Qwen3.5 122b A10b | 262K | ❌ | ✅ | **Free** | **Free** |
48
47
  | Qwen3.5 9b | 262K | ❌ | ✅ | **Free** | **Free** |
48
+ | Qwen3.8 2.4t A95b | 131K | ❌ | ❌ | **Free** | **Free** |
49
+ | Qwen3.8 27b | 131K | ❌ | ❌ | **Free** | **Free** |
49
50
 
50
51
  ## Installation
51
52
 
package/package.json CHANGED
@@ -1,16 +1,9 @@
1
1
  {
2
2
  "name": "pi-tensorix-provider",
3
- "version": "1.0.7",
4
- "packageManager": "pnpm@11.18.0",
3
+ "version": "1.0.9",
5
4
  "description": "Tensorix provider extension for pi - Access DeepSeek, GLM, Kimi, Qwen, MiniMax, Llama, and more through the Tensorix API",
6
5
  "type": "module",
7
6
  "main": "index.ts",
8
- "scripts": {
9
- "clean": "echo 'nothing to clean'",
10
- "build": "echo 'nothing to build'",
11
- "check": "echo 'nothing to check'",
12
- "update-models": "node scripts/update-models.js"
13
- },
14
7
  "keywords": [
15
8
  "pi",
16
9
  "extension",
@@ -31,5 +24,15 @@
31
24
  "extensions": [
32
25
  "./index.ts"
33
26
  ]
27
+ },
28
+ "files": [
29
+ "README.md",
30
+ "LICENSE"
31
+ ],
32
+ "scripts": {
33
+ "clean": "echo 'nothing to clean'",
34
+ "build": "echo 'nothing to build'",
35
+ "check": "echo 'nothing to check'",
36
+ "update-models": "node scripts/update-models.js"
34
37
  }
35
- }
38
+ }
@@ -1,4 +0,0 @@
1
- github: monotykamary
2
- ko_fi: monotykamary
3
- buy_me_a_coffee: monotykamary
4
- polar: monotykamary
package/AGENTS.md DELETED
@@ -1,57 +0,0 @@
1
- # AGENTS.md
2
-
3
- ## DO NOT EDIT — Auto-generated Files
4
-
5
- The following files are **idempotent** and regenerated by `scripts/update-models.js`. Never edit them directly — your changes will be overwritten on the next model sync.
6
-
7
- | File | Why it's auto-generated |
8
- |------|------------------------|
9
- | `models.json` | Built from the provider API. `update-models.js` fetches models, preserves curated data for known IDs, and writes this file. |
10
- | `deprecated-models.json` | Graveyard for models the API delisted. update-models.js stamps them with deprecatedAt and pi keeps serving them for a 2-week grace period, then evicts them. Never edit by hand. |
11
- | `README.md` (model table) | The table under `## Available Models` is replaced in-place by `update-models.js` after merging base models → patch → custom models. |
12
-
13
- ## Correct Files to Edit
14
-
15
- When a model needs overrides, new properties, or corrections, edit the appropriate source file below. These are the **source of truth** that the update script reads but never writes.
16
-
17
- | File | Purpose |
18
- |------|---------|
19
- | `patch.json` | Per-model overrides keyed by model ID. Add reasoning flags, compat settings, pricing corrections, thinking level maps, etc. Applied on top of `models.json` at runtime and for README generation. |
20
- | `custom-models.json` | Models that don't exist in the provider API (hidden models, router endpoints, cross-provider aliases). Merged after patch. Format: array of full model objects (same schema as `models.json` entries). |
21
- | `index.ts` | Provider extension code. |
22
- | `scripts/update-models.js` | The sync script itself (edit only if changing how models are fetched/transformed). |
23
-
24
- ## Data Flow
25
-
26
- ```
27
- Provider API ──fetch──► models.json ──apply──► patch.json ──merge──► custom-models.json
28
- │ │ │
29
- └────────────────────────────┴──────────────────────┘
30
- │
31
- README model table
32
- ```
33
-
34
- 1. `models.json` — base data from the provider API (auto-generated, DO NOT EDIT)
35
- 2. `patch.json` — overrides applied on top (EDIT THIS for corrections/enrichments)
36
- 3. `custom-models.json` — additional models not in the API (EDIT THIS for new models)
37
- 4. README table — rendered from the merged result of all three (auto-generated, DO NOT EDIT)
38
-
39
- ## Common Tasks
40
-
41
- ### Add a compat setting or override pricing for an existing model
42
- → Edit `patch.json`. Add an entry keyed by the model's `id`.
43
-
44
- ### Add a model not available in the provider API
45
- → Edit `custom-models.json`. Add a full model object to the array.
46
-
47
- ### Update models from the provider API
48
- → Run `node scripts/update-models.js` (may require an API key env var).
49
-
50
- ### Regenerate the README model table
51
- → Run `node scripts/update-models.js` — it updates both `models.json` and the README table.
52
-
53
- ## TL;DR
54
-
55
- - **Never edit `models.json`** — edit `patch.json` instead.
56
- - **Never edit the README model table** — run the update script instead.
57
- - `patch.json` and `custom-models.json` are the source files you should modify.
@@ -1 +0,0 @@
1
- []
@@ -1,87 +0,0 @@
1
- {
2
- "deepseek/deepseek-chat-v3.1": {
3
- "id": "deepseek/deepseek-chat-v3.1",
4
- "name": "Deepseek Chat V3.1",
5
- "reasoning": false,
6
- "input": [
7
- "text"
8
- ],
9
- "cost": {
10
- "input": 0,
11
- "output": 0,
12
- "cacheRead": 0,
13
- "cacheWrite": 0
14
- },
15
- "contextWindow": 131072,
16
- "maxTokens": 131072,
17
- "deprecatedAt": "2026-08-01T02:00:23.121Z"
18
- },
19
- "nvidia/nemotron-3-super-120b-a12b": {
20
- "id": "nvidia/nemotron-3-super-120b-a12b",
21
- "name": "Nemotron 3 Super 120b A12b",
22
- "reasoning": false,
23
- "input": [
24
- "text"
25
- ],
26
- "cost": {
27
- "input": 0,
28
- "output": 0,
29
- "cacheRead": 0,
30
- "cacheWrite": 0
31
- },
32
- "contextWindow": 131072,
33
- "maxTokens": 131072,
34
- "deprecatedAt": "2026-08-01T02:00:23.121Z"
35
- },
36
- "openai/gpt-oss-120b": {
37
- "id": "openai/gpt-oss-120b",
38
- "name": "Gpt Oss 120b",
39
- "reasoning": false,
40
- "input": [
41
- "text"
42
- ],
43
- "cost": {
44
- "input": 0,
45
- "output": 0,
46
- "cacheRead": 0,
47
- "cacheWrite": 0
48
- },
49
- "contextWindow": 131072,
50
- "maxTokens": 131072,
51
- "deprecatedAt": "2026-08-01T02:00:23.121Z"
52
- },
53
- "qwen/qwen3-coder-30b-a3b-instruct": {
54
- "id": "qwen/qwen3-coder-30b-a3b-instruct",
55
- "name": "Qwen3 Coder 30b A3b Instruct",
56
- "reasoning": false,
57
- "input": [
58
- "text"
59
- ],
60
- "cost": {
61
- "input": 0,
62
- "output": 0,
63
- "cacheRead": 0,
64
- "cacheWrite": 0
65
- },
66
- "contextWindow": 131072,
67
- "maxTokens": 131072,
68
- "deprecatedAt": "2026-08-01T02:00:23.121Z"
69
- },
70
- "qwen/qwen3-vl-235b-a22b-instruct": {
71
- "id": "qwen/qwen3-vl-235b-a22b-instruct",
72
- "name": "Qwen3 Vl 235b A22b Instruct",
73
- "reasoning": false,
74
- "input": [
75
- "text"
76
- ],
77
- "cost": {
78
- "input": 0,
79
- "output": 0,
80
- "cacheRead": 0,
81
- "cacheWrite": 0
82
- },
83
- "contextWindow": 131072,
84
- "maxTokens": 131072,
85
- "deprecatedAt": "2026-08-01T02:00:23.121Z"
86
- }
87
- }
package/models.json DELETED
@@ -1,322 +0,0 @@
1
- [
2
- {
3
- "id": "chatterbox-turbo",
4
- "name": "Chatterbox Turbo",
5
- "reasoning": false,
6
- "input": [
7
- "text"
8
- ],
9
- "cost": {
10
- "input": 0,
11
- "output": 0,
12
- "cacheRead": 0,
13
- "cacheWrite": 0
14
- },
15
- "contextWindow": 131072,
16
- "maxTokens": 131072
17
- },
18
- {
19
- "id": "deepseek/deepseek-r1-0528",
20
- "name": "Deepseek R1 0528",
21
- "reasoning": false,
22
- "input": [
23
- "text"
24
- ],
25
- "cost": {
26
- "input": 0,
27
- "output": 0,
28
- "cacheRead": 0,
29
- "cacheWrite": 0
30
- },
31
- "contextWindow": 131072,
32
- "maxTokens": 131072
33
- },
34
- {
35
- "id": "deepseek/deepseek-v3.2",
36
- "name": "Deepseek V3.2",
37
- "reasoning": false,
38
- "input": [
39
- "text"
40
- ],
41
- "cost": {
42
- "input": 0,
43
- "output": 0,
44
- "cacheRead": 0,
45
- "cacheWrite": 0
46
- },
47
- "contextWindow": 131072,
48
- "maxTokens": 131072
49
- },
50
- {
51
- "id": "deepseek/deepseek-v4-flash",
52
- "name": "Deepseek V4 Flash",
53
- "reasoning": false,
54
- "input": [
55
- "text"
56
- ],
57
- "cost": {
58
- "input": 0,
59
- "output": 0,
60
- "cacheRead": 0,
61
- "cacheWrite": 0
62
- },
63
- "contextWindow": 131072,
64
- "maxTokens": 131072
65
- },
66
- {
67
- "id": "deepseek/deepseek-v4-flash-0731",
68
- "name": "Deepseek V4 Flash 0731",
69
- "reasoning": false,
70
- "input": [
71
- "text"
72
- ],
73
- "cost": {
74
- "input": 0,
75
- "output": 0,
76
- "cacheRead": 0,
77
- "cacheWrite": 0
78
- },
79
- "contextWindow": 131072,
80
- "maxTokens": 131072
81
- },
82
- {
83
- "id": "deepseek/deepseek-v4-pro",
84
- "name": "Deepseek V4 Pro",
85
- "reasoning": false,
86
- "input": [
87
- "text"
88
- ],
89
- "cost": {
90
- "input": 0,
91
- "output": 0,
92
- "cacheRead": 0,
93
- "cacheWrite": 0
94
- },
95
- "contextWindow": 131072,
96
- "maxTokens": 131072
97
- },
98
- {
99
- "id": "minimax/minimax-m2.5",
100
- "name": "Minimax M2.5",
101
- "reasoning": false,
102
- "input": [
103
- "text"
104
- ],
105
- "cost": {
106
- "input": 0,
107
- "output": 0,
108
- "cacheRead": 0,
109
- "cacheWrite": 0
110
- },
111
- "contextWindow": 131072,
112
- "maxTokens": 131072
113
- },
114
- {
115
- "id": "minimax/minimax-m3",
116
- "name": "Minimax M3",
117
- "reasoning": false,
118
- "input": [
119
- "text"
120
- ],
121
- "cost": {
122
- "input": 0,
123
- "output": 0,
124
- "cacheRead": 0,
125
- "cacheWrite": 0
126
- },
127
- "contextWindow": 131072,
128
- "maxTokens": 131072
129
- },
130
- {
131
- "id": "moonshotai/kimi-k2.5",
132
- "name": "Kimi K2.5",
133
- "reasoning": false,
134
- "input": [
135
- "text"
136
- ],
137
- "cost": {
138
- "input": 0,
139
- "output": 0,
140
- "cacheRead": 0,
141
- "cacheWrite": 0
142
- },
143
- "contextWindow": 131072,
144
- "maxTokens": 131072
145
- },
146
- {
147
- "id": "moonshotai/kimi-k2.6",
148
- "name": "Kimi K2.6",
149
- "reasoning": false,
150
- "input": [
151
- "text"
152
- ],
153
- "cost": {
154
- "input": 0,
155
- "output": 0,
156
- "cacheRead": 0,
157
- "cacheWrite": 0
158
- },
159
- "contextWindow": 131072,
160
- "maxTokens": 131072
161
- },
162
- {
163
- "id": "moonshotai/kimi-k2.7-code",
164
- "name": "Kimi K2.7 Code",
165
- "reasoning": false,
166
- "input": [
167
- "text"
168
- ],
169
- "cost": {
170
- "input": 0,
171
- "output": 0,
172
- "cacheRead": 0,
173
- "cacheWrite": 0
174
- },
175
- "contextWindow": 131072,
176
- "maxTokens": 131072
177
- },
178
- {
179
- "id": "moonshotai/kimi-k3",
180
- "name": "Kimi K3",
181
- "reasoning": false,
182
- "input": [
183
- "text"
184
- ],
185
- "cost": {
186
- "input": 0,
187
- "output": 0,
188
- "cacheRead": 0,
189
- "cacheWrite": 0
190
- },
191
- "contextWindow": 131072,
192
- "maxTokens": 131072
193
- },
194
- {
195
- "id": "qwen/qwen3-235b-a22b-2507",
196
- "name": "Qwen3 235b A22b 2507",
197
- "reasoning": false,
198
- "input": [
199
- "text"
200
- ],
201
- "cost": {
202
- "input": 0,
203
- "output": 0,
204
- "cacheRead": 0,
205
- "cacheWrite": 0
206
- },
207
- "contextWindow": 131072,
208
- "maxTokens": 131072
209
- },
210
- {
211
- "id": "qwen/qwen3.5-122b-a10b",
212
- "name": "Qwen3.5 122b A10b",
213
- "reasoning": false,
214
- "input": [
215
- "text"
216
- ],
217
- "cost": {
218
- "input": 0,
219
- "output": 0,
220
- "cacheRead": 0,
221
- "cacheWrite": 0
222
- },
223
- "contextWindow": 131072,
224
- "maxTokens": 131072
225
- },
226
- {
227
- "id": "qwen/qwen3.5-9b",
228
- "name": "Qwen3.5 9b",
229
- "reasoning": false,
230
- "input": [
231
- "text"
232
- ],
233
- "cost": {
234
- "input": 0,
235
- "output": 0,
236
- "cacheRead": 0,
237
- "cacheWrite": 0
238
- },
239
- "contextWindow": 131072,
240
- "maxTokens": 131072
241
- },
242
- {
243
- "id": "z-ai/glm-5",
244
- "name": "Glm 5",
245
- "reasoning": false,
246
- "input": [
247
- "text"
248
- ],
249
- "cost": {
250
- "input": 0,
251
- "output": 0,
252
- "cacheRead": 0,
253
- "cacheWrite": 0
254
- },
255
- "contextWindow": 131072,
256
- "maxTokens": 131072
257
- },
258
- {
259
- "id": "z-ai/glm-5-turbo",
260
- "name": "Glm 5 Turbo",
261
- "reasoning": false,
262
- "input": [
263
- "text"
264
- ],
265
- "cost": {
266
- "input": 0,
267
- "output": 0,
268
- "cacheRead": 0,
269
- "cacheWrite": 0
270
- },
271
- "contextWindow": 131072,
272
- "maxTokens": 131072
273
- },
274
- {
275
- "id": "z-ai/glm-5.1",
276
- "name": "Glm 5.1",
277
- "reasoning": false,
278
- "input": [
279
- "text"
280
- ],
281
- "cost": {
282
- "input": 0,
283
- "output": 0,
284
- "cacheRead": 0,
285
- "cacheWrite": 0
286
- },
287
- "contextWindow": 131072,
288
- "maxTokens": 131072
289
- },
290
- {
291
- "id": "z-ai/glm-5.2",
292
- "name": "Glm 5.2",
293
- "reasoning": false,
294
- "input": [
295
- "text"
296
- ],
297
- "cost": {
298
- "input": 0,
299
- "output": 0,
300
- "cacheRead": 0,
301
- "cacheWrite": 0
302
- },
303
- "contextWindow": 131072,
304
- "maxTokens": 131072
305
- },
306
- {
307
- "id": "z-ai/glm-5v-turbo",
308
- "name": "Glm 5v Turbo",
309
- "reasoning": false,
310
- "input": [
311
- "text"
312
- ],
313
- "cost": {
314
- "input": 0,
315
- "output": 0,
316
- "cacheRead": 0,
317
- "cacheWrite": 0
318
- },
319
- "contextWindow": 131072,
320
- "maxTokens": 131072
321
- }
322
- ]
package/patch.json DELETED
@@ -1,251 +0,0 @@
1
- {
2
- "deepseek/deepseek-r1-0528": {
3
- "reasoning": true,
4
- "compat": {
5
- "thinkingFormat": "openai",
6
- "supportsDeveloperRole": true,
7
- "supportsReasoningEffort": true
8
- }
9
- },
10
- "deepseek/deepseek-v3.2": {
11
- "reasoning": true,
12
- "contextWindow": 163840,
13
- "maxTokens": 163840,
14
- "compat": {
15
- "thinkingFormat": "openai",
16
- "supportsDeveloperRole": true,
17
- "supportsReasoningEffort": true
18
- }
19
- },
20
- "deepseek/deepseek-v4-flash": {
21
- "reasoning": true,
22
- "contextWindow": 1000000,
23
- "maxTokens": 131072,
24
- "compat": {
25
- "thinkingFormat": "qwen-chat-template",
26
- "requiresReasoningContentOnAssistantMessages": true,
27
- "supportsDeveloperRole": true,
28
- "supportsReasoningEffort": true
29
- }
30
- },
31
- "deepseek/deepseek-v4-pro": {
32
- "reasoning": true,
33
- "contextWindow": 1000000,
34
- "maxTokens": 131072,
35
- "compat": {
36
- "thinkingFormat": "openai",
37
- "supportsDeveloperRole": true,
38
- "supportsReasoningEffort": true
39
- }
40
- },
41
- "z-ai/glm-5": {
42
- "reasoning": true,
43
- "contextWindow": 202752,
44
- "maxTokens": 131072,
45
- "compat": {
46
- "thinkingFormat": "openai",
47
- "supportsDeveloperRole": true,
48
- "supportsReasoningEffort": true
49
- }
50
- },
51
- "z-ai/glm-5-turbo": {
52
- "reasoning": true,
53
- "contextWindow": 202752,
54
- "maxTokens": 131072,
55
- "compat": {
56
- "thinkingFormat": "openai",
57
- "supportsDeveloperRole": true,
58
- "supportsReasoningEffort": true
59
- }
60
- },
61
- "z-ai/glm-5.1": {
62
- "reasoning": true,
63
- "contextWindow": 202752,
64
- "maxTokens": 131072,
65
- "compat": {
66
- "thinkingFormat": "openai",
67
- "supportsDeveloperRole": true,
68
- "supportsReasoningEffort": true
69
- }
70
- },
71
- "z-ai/glm-5v-turbo": {
72
- "reasoning": true,
73
- "input": [
74
- "text",
75
- "image"
76
- ],
77
- "contextWindow": 202752,
78
- "maxTokens": 131072,
79
- "compat": {
80
- "thinkingFormat": "openai",
81
- "supportsDeveloperRole": true,
82
- "supportsReasoningEffort": true
83
- }
84
- },
85
- "minimax/minimax-m2.5": {
86
- "reasoning": true,
87
- "contextWindow": 204800,
88
- "maxTokens": 131072,
89
- "compat": {
90
- "thinkingFormat": "openai",
91
- "supportsDeveloperRole": true,
92
- "supportsReasoningEffort": true
93
- }
94
- },
95
- "moonshotai/kimi-k2.5": {
96
- "reasoning": true,
97
- "input": [
98
- "text",
99
- "image"
100
- ],
101
- "contextWindow": 262144,
102
- "maxTokens": 262144,
103
- "compat": {
104
- "thinkingFormat": "openai",
105
- "supportsDeveloperRole": true,
106
- "supportsReasoningEffort": true
107
- }
108
- },
109
- "moonshotai/kimi-k2.6": {
110
- "reasoning": true,
111
- "input": [
112
- "text",
113
- "image"
114
- ],
115
- "contextWindow": 262144,
116
- "maxTokens": 262144,
117
- "compat": {
118
- "thinkingFormat": "openai",
119
- "supportsDeveloperRole": true,
120
- "supportsReasoningEffort": true
121
- }
122
- },
123
- "qwen/qwen3-235b-a22b-2507": {
124
- "reasoning": true,
125
- "contextWindow": 262144,
126
- "maxTokens": 262144,
127
- "compat": {
128
- "thinkingFormat": "openai",
129
- "supportsDeveloperRole": true,
130
- "supportsReasoningEffort": true
131
- }
132
- },
133
- "qwen/qwen3-coder-30b-a3b-instruct": {
134
- "reasoning": true,
135
- "contextWindow": 262144,
136
- "maxTokens": 262144,
137
- "compat": {
138
- "thinkingFormat": "openai",
139
- "supportsDeveloperRole": true,
140
- "supportsReasoningEffort": true
141
- }
142
- },
143
- "qwen/qwen3-vl-235b-a22b-instruct": {
144
- "reasoning": true,
145
- "input": [
146
- "text",
147
- "image"
148
- ],
149
- "contextWindow": 262144,
150
- "maxTokens": 262144,
151
- "compat": {
152
- "thinkingFormat": "openai",
153
- "supportsDeveloperRole": true,
154
- "supportsReasoningEffort": true
155
- }
156
- },
157
- "qwen/qwen3.5-122b-a10b": {
158
- "reasoning": true,
159
- "contextWindow": 262144,
160
- "maxTokens": 262144,
161
- "compat": {
162
- "thinkingFormat": "openai",
163
- "supportsDeveloperRole": true,
164
- "supportsReasoningEffort": true
165
- }
166
- },
167
- "qwen/qwen3.5-9b": {
168
- "reasoning": true,
169
- "contextWindow": 262144,
170
- "maxTokens": 262144,
171
- "compat": {
172
- "thinkingFormat": "openai",
173
- "supportsDeveloperRole": true,
174
- "supportsReasoningEffort": true
175
- }
176
- },
177
- "openai/gpt-oss-120b": {
178
- "reasoning": true,
179
- "contextWindow": 131072,
180
- "maxTokens": 32768,
181
- "compat": {
182
- "supportsDeveloperRole": true,
183
- "supportsReasoningEffort": true
184
- }
185
- },
186
- "nvidia/nemotron-3-super-120b-a12b": {
187
- "contextWindow": 4096,
188
- "maxTokens": 4096
189
- },
190
- "deepseek/deepseek-v4-flash-0731": {
191
- "reasoning": true,
192
- "compat": {
193
- "thinkingFormat": "openai",
194
- "supportsDeveloperRole": true,
195
- "supportsReasoningEffort": true
196
- }
197
- },
198
- "minimax/minimax-m3": {
199
- "reasoning": true,
200
- "input": [
201
- "text",
202
- "image"
203
- ],
204
- "compat": {
205
- "thinkingFormat": "openai",
206
- "supportsDeveloperRole": true,
207
- "supportsReasoningEffort": true
208
- }
209
- },
210
- "moonshotai/kimi-k2.7-code": {
211
- "reasoning": true,
212
- "input": [
213
- "text",
214
- "image"
215
- ],
216
- "compat": {
217
- "thinkingFormat": "openai",
218
- "supportsDeveloperRole": true,
219
- "supportsReasoningEffort": true
220
- }
221
- },
222
- "moonshotai/kimi-k3": {
223
- "reasoning": true,
224
- "input": [
225
- "text",
226
- "image"
227
- ],
228
- "thinkingLevelMap": {
229
- "off": null,
230
- "minimal": null,
231
- "low": "low",
232
- "medium": null,
233
- "high": "high",
234
- "xhigh": null,
235
- "max": "max"
236
- },
237
- "compat": {
238
- "thinkingFormat": "openai",
239
- "supportsDeveloperRole": true,
240
- "supportsReasoningEffort": true
241
- }
242
- },
243
- "z-ai/glm-5.2": {
244
- "reasoning": true,
245
- "compat": {
246
- "thinkingFormat": "openai",
247
- "supportsDeveloperRole": true,
248
- "supportsReasoningEffort": true
249
- }
250
- }
251
- }
@@ -1,358 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Update Tensorix models from API
4
- *
5
- * Fetches models from https://api.tensorix.ai/v1/models and updates:
6
- * - models.json: API model definitions with preserved curated data
7
- * - README.md: Model table with patch.json overrides applied
8
- *
9
- * The Tensorix /v1/models API returns minimal metadata (id only — no pricing,
10
- * context_length, or reasoning flags). models.json preserves curated specs for
11
- * known models and creates skeleton entries for new ones. patch.json corrects
12
- * reasoning capability and adds compatibility overrides at runtime.
13
- *
14
- * Merge order for README: models.json → apply patch.json → merge custom-models.json
15
- */
16
-
17
- import fs from 'fs';
18
- import path from 'path';
19
- import { fileURLToPath } from 'url';
20
-
21
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
22
-
23
- const MODELS_API_URL = 'https://api.tensorix.ai/v1/models';
24
- const MODELS_JSON_PATH = path.join(__dirname, '..', 'models.json');
25
- const PATCH_JSON_PATH = path.join(__dirname, '..', 'patch.json');
26
- const CUSTOM_MODELS_JSON_PATH = path.join(__dirname, '..', 'custom-models.json');
27
- const README_PATH = path.join(__dirname, '..', 'README.md');
28
-
29
- const MODELS_TO_SKIP = new Set([
30
- 'qwen/qwen3-embedding-8b',
31
- 'Systran/faster-whisper-large-v3',
32
- ]);
33
-
34
- // ─── Patch application ────────────────────────────────────────────────────────
35
-
36
- function applyPatch(model, patch) {
37
- const result = { ...model };
38
-
39
- if (patch.name !== undefined) result.name = patch.name;
40
- if (patch.reasoning !== undefined) result.reasoning = patch.reasoning;
41
- if (patch.input !== undefined) result.input = patch.input;
42
- if (patch.contextWindow !== undefined) result.contextWindow = patch.contextWindow;
43
- if (patch.maxTokens !== undefined) result.maxTokens = patch.maxTokens;
44
- if (patch.thinkingLevelMap !== undefined) result.thinkingLevelMap = { ...patch.thinkingLevelMap };
45
-
46
- if (patch.cost) {
47
- result.cost = {
48
- input: patch.cost.input ?? result.cost.input,
49
- output: patch.cost.output ?? result.cost.output,
50
- cacheRead: patch.cost.cacheRead ?? result.cost.cacheRead,
51
- cacheWrite: patch.cost.cacheWrite ?? result.cost.cacheWrite,
52
- };
53
- }
54
- if (patch.compat) {
55
- result.compat = { ...(result.compat || {}), ...patch.compat };
56
- }
57
-
58
- if (!result.reasoning && result.compat?.thinkingFormat) {
59
- delete result.compat.thinkingFormat;
60
- }
61
- if (result.compat && Object.keys(result.compat).length === 0) {
62
- delete result.compat;
63
- }
64
-
65
- return result;
66
- }
67
-
68
- function buildModels(baseModels, customModels, patchData) {
69
- const modelMap = new Map();
70
-
71
- for (const model of baseModels) {
72
- modelMap.set(model.id, model);
73
- }
74
-
75
- for (const [id, patchEntry] of Object.entries(patchData)) {
76
- const existing = modelMap.get(id);
77
- if (existing) {
78
- modelMap.set(id, applyPatch(existing, patchEntry));
79
- }
80
- }
81
-
82
- for (const model of customModels) {
83
- const existing = modelMap.get(model.id);
84
- const patchEntry = patchData[model.id];
85
- if (existing && patchEntry) {
86
- modelMap.set(model.id, applyPatch(model, patchEntry));
87
- } else if (existing) {
88
- modelMap.set(model.id, model);
89
- } else if (patchEntry) {
90
- modelMap.set(model.id, applyPatch(model, patchEntry));
91
- } else {
92
- modelMap.set(model.id, model);
93
- }
94
- }
95
-
96
- return Array.from(modelMap.values());
97
- }
98
-
99
- // ─── Model transformation ─────────────────────────────────────────────────────
100
-
101
- function buildDisplayName(apiModel) {
102
- const id = apiModel.id || '';
103
- const parts = id.split('/');
104
- const rawName = parts.length > 1 ? parts.slice(1).join('/') : id;
105
- return rawName
106
- .replace(/-/g, ' ')
107
- .replace(/\b\w/g, c => c.toUpperCase());
108
- }
109
-
110
- function transformModel(apiModel, existingModelsMap) {
111
- const modelId = apiModel.id;
112
-
113
- // Preserve existing curated data (reasoning, vision, compat, context, etc.)
114
- if (existingModelsMap[modelId]) {
115
- const existing = { ...existingModelsMap[modelId] };
116
- existing._meta = { isFree: true };
117
- return existing;
118
- }
119
-
120
- // New model — build from API data + sensible defaults
121
- return {
122
- id: modelId,
123
- name: buildDisplayName(apiModel),
124
- reasoning: false,
125
- input: ['text'],
126
- cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
127
- contextWindow: 131072,
128
- maxTokens: 131072,
129
- _meta: { isFree: true },
130
- };
131
- }
132
-
133
- // ─── File I/O ─────────────────────────────────────────────────────────────────
134
-
135
- function loadJson(filePath) {
136
- try {
137
- const data = fs.readFileSync(filePath, 'utf8');
138
- return JSON.parse(data);
139
- } catch {
140
- return {};
141
- }
142
- }
143
-
144
- // ─── README generation ────────────────────────────────────────────────────────
145
-
146
- function formatCost(cost, isFree) {
147
- if (isFree) return '**Free**';
148
- if (cost === 0) return '-';
149
- return `$${cost.toFixed(2)}`;
150
- }
151
-
152
- function formatContextWindow(n) {
153
- if (n >= 1000000) return `${(n / 1000000).toFixed(1)}M`;
154
- if (n >= 1000) return `${Math.round(n / 1000)}K`;
155
- return n.toString();
156
- }
157
-
158
- function generateReadmeTable(models) {
159
- const lines = [
160
- '| Model | Context | Vision | Reasoning | Input $/M | Output $/M |',
161
- '|-------|---------|--------|-----------|-----------|------------|',
162
- ];
163
-
164
- for (const model of models) {
165
- const name = model.name;
166
- const context = formatContextWindow(model.contextWindow);
167
- const vision = model.input.includes('image') ? '✅' : '❌';
168
- const reasoning = model.reasoning ? '✅' : '❌';
169
- const isFree = model._meta?.isFree ?? (model.cost.input === 0 && model.cost.output === 0);
170
- const inputCost = formatCost(model.cost.input, isFree);
171
- const outputCost = formatCost(model.cost.output, isFree);
172
-
173
- lines.push(`| ${name} | ${context} | ${vision} | ${reasoning} | ${inputCost} | ${outputCost} |`);
174
- }
175
-
176
- return lines.join('\n');
177
- }
178
-
179
- function updateReadme(models) {
180
- let readme = fs.readFileSync(README_PATH, 'utf8');
181
- const newTable = generateReadmeTable(models);
182
-
183
- const tableRegex = /(## Available Models\n\n)\| Model \| Context \| Vision \| Reasoning \| Input \$\/M \| Output \$\/M \|\n\|[-| ]+\|(\n\|[^\n]+\|)*\n*/;
184
-
185
- if (tableRegex.test(readme)) {
186
- readme = readme.replace(tableRegex, (match, header) => `${header}${newTable}\n\n`);
187
- fs.writeFileSync(README_PATH, readme);
188
- console.log('✓ Updated README.md');
189
- } else {
190
- console.warn('⚠ Could not find model table in "## Available Models" section');
191
- }
192
- }
193
-
194
- function cleanModelForJson(model) {
195
- const { _meta, ...cleanModel } = model;
196
- return cleanModel;
197
- }
198
-
199
- // ─── Main ──────────────────────────────────────────────────────────────────────
200
-
201
- // Grace period for delisted models: update-models.js moves models the API no
202
- // longer lists into deprecated-models.json (stamped with deprecatedAt) instead
203
- // of dropping them; the runtime appends them back so sessions and saved model
204
- // settings keep working, and after 14 days they are evicted permanently.
205
- const DEPRECATED_MODEL_TTL_MS = 14 * 24 * 60 * 60 * 1000;
206
-
207
- /**
208
- * Reconcile deprecated-models.json against the freshly fetched model list.
209
- * - in old models.json but not the API: moved into the deprecated file
210
- * (deprecatedAt = now; preserved on repeat runs so the grace clock is not reset)
211
- * - back in the API: resurrected (dropped from the deprecated file)
212
- * - deprecatedAt older than 14 days: evicted permanently
213
- * Must run BEFORE the new models.json is written; it reads the old file itself.
214
- */
215
- function updateDeprecatedModels(modelsJsonPath, newModels) {
216
- const deprecatedPath = path.join(path.dirname(modelsJsonPath), 'deprecated-models.json');
217
-
218
- let oldModels = [];
219
- try {
220
- const parsed = JSON.parse(fs.readFileSync(modelsJsonPath, 'utf8'));
221
- if (Array.isArray(parsed)) oldModels = parsed;
222
- } catch { /* first run: no previous models.json */ }
223
-
224
- let deprecated = {};
225
- try {
226
- const parsed = JSON.parse(fs.readFileSync(deprecatedPath, 'utf8'));
227
- if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) deprecated = parsed;
228
- } catch { /* no graveyard yet */ }
229
-
230
- const currentIds = new Set(newModels.map(m => m.id));
231
- const now = new Date().toISOString();
232
- const added = [];
233
- const resurrected = [];
234
- const evicted = [];
235
-
236
- for (const old of oldModels) {
237
- if (old && old.id && !currentIds.has(old.id) && !deprecated[old.id]) {
238
- deprecated[old.id] = { ...old, deprecatedAt: now };
239
- added.push(old.id);
240
- }
241
- }
242
-
243
- for (const [id, entry] of Object.entries(deprecated)) {
244
- if (currentIds.has(id)) {
245
- delete deprecated[id];
246
- resurrected.push(id);
247
- continue;
248
- }
249
- const removedAt = Date.parse(entry && entry.deprecatedAt ? entry.deprecatedAt : '');
250
- if (Number.isNaN(removedAt) || Date.now() - removedAt > DEPRECATED_MODEL_TTL_MS) {
251
- delete deprecated[id];
252
- evicted.push(id);
253
- }
254
- }
255
-
256
- if (added.length > 0 || resurrected.length > 0 || evicted.length > 0) {
257
- fs.writeFileSync(deprecatedPath, JSON.stringify(deprecated, null, 2) + '\n');
258
- console.log('Updated deprecated-models.json ' + JSON.stringify({ added, resurrected, evicted }));
259
- }
260
- }
261
-
262
- async function main() {
263
- console.log(`Fetching models from ${MODELS_API_URL}...`);
264
-
265
- try {
266
- const apiKey = process.env.TENSORIX_API_KEY;
267
- const headers = {};
268
- if (apiKey) headers.Authorization = `Bearer ${apiKey}`;
269
-
270
- const response = await fetch(MODELS_API_URL, { headers });
271
- if (!response.ok) {
272
- throw new Error(`HTTP error! status: ${response.status}`);
273
- }
274
-
275
- const apiResponse = await response.json();
276
- const apiModels = apiResponse.data || apiResponse;
277
-
278
- if (!Array.isArray(apiModels)) {
279
- throw new Error('API response does not contain an array of models');
280
- }
281
-
282
- console.log(`✓ Fetched ${apiModels.length} models from API`);
283
-
284
- // Filter out non-chat models
285
- const chatModels = apiModels.filter(m => !MODELS_TO_SKIP.has(m.id));
286
- console.log(`✓ Filtered to ${chatModels.length} chat models (skipped ${apiModels.length - chatModels.length} non-chat)`);
287
-
288
- // Load existing models.json — source of truth for curated specs
289
- let existingModels = [];
290
- try {
291
- existingModels = JSON.parse(fs.readFileSync(MODELS_JSON_PATH, 'utf8'));
292
- } catch {
293
- // File might not exist or be invalid
294
- }
295
- const existingModelsMap = {};
296
- for (const m of existingModels) {
297
- existingModelsMap[m.id] = m;
298
- }
299
-
300
- // Transform models from API, preserving existing curated data
301
- let apiTransformed = chatModels.map(m => transformModel(m, existingModelsMap));
302
-
303
- // Sort by id
304
- apiTransformed.sort((a, b) => a.id.localeCompare(b.id));
305
-
306
- // Update models.json — API-derived model list with curated specs preserved
307
- const cleanModels = apiTransformed.map(cleanModelForJson);
308
- // Move delisted models to deprecated-models.json BEFORE models.json is overwritten
309
- updateDeprecatedModels(MODELS_JSON_PATH, cleanModels);
310
- fs.writeFileSync(MODELS_JSON_PATH, JSON.stringify(cleanModels, null, 2) + '\n');
311
- console.log('✓ Updated models.json (API model list with curated specs)');
312
-
313
- // Log new models not yet in patch.json
314
- const patch = loadJson(PATCH_JSON_PATH);
315
- for (const m of apiTransformed) {
316
- if (!patch[m.id] && !existingModelsMap[m.id]) {
317
- console.log(` 🆕 New model: ${m.id} (${m.name}) — add to patch.json for reasoning/vision/specs`);
318
- }
319
- }
320
-
321
- // Build full model list for README: base → patch → custom
322
- const customModels = loadJson(CUSTOM_MODELS_JSON_PATH);
323
- const readmeModels = buildModels(
324
- apiTransformed,
325
- Array.isArray(customModels) ? customModels : [],
326
- patch
327
- );
328
- readmeModels.sort((a, b) => a.name.localeCompare(b.name));
329
- console.log('✓ Built model list (base → patch → custom) for README');
330
-
331
- // Update README.md with patched data
332
- updateReadme(readmeModels);
333
-
334
- // Summary
335
- console.log('\n--- Summary ---');
336
- console.log(`Total models: ${readmeModels.length}`);
337
- console.log(`Reasoning models (patched): ${readmeModels.filter(m => m.reasoning).length}`);
338
- console.log(`Vision models: ${readmeModels.filter(m => m.input.includes('image')).length}`);
339
-
340
- const newIds = new Set(apiTransformed.map(m => m.id));
341
- const oldIds = new Set(existingModels.map(m => m.id));
342
-
343
- const added = [...newIds].filter(id => !oldIds.has(id));
344
- const removed = [...oldIds].filter(id => !newIds.has(id));
345
-
346
- if (added.length > 0) {
347
- console.log(`\nNew models: ${added.join(', ')}`);
348
- }
349
- if (removed.length > 0) {
350
- console.log(`\nRemoved models: ${removed.join(', ')}`);
351
- }
352
- } catch (error) {
353
- console.error('Error:', error.message);
354
- process.exit(1);
355
- }
356
- }
357
-
358
- main();