pi-free 2.0.9 → 2.0.11
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/CHANGELOG.md +576 -544
- package/README.md +16 -0
- package/banner.svg +12 -10
- package/config.ts +86 -20
- package/constants.ts +3 -0
- package/index.ts +3 -0
- package/lib/util.ts +72 -8
- package/package.json +1 -1
- package/providers/crofai/crofai.ts +106 -15
- package/providers/deepinfra/deepinfra.ts +108 -11
- package/providers/ollama/ollama.ts +400 -85
- package/providers/ollama/thinking-levels.ts +96 -0
- package/providers/together/together.ts +197 -0
- package/providers/zenmux/zenmux.ts +32 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,544 +1,576 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [
|
|
9
|
-
|
|
10
|
-
###
|
|
11
|
-
|
|
12
|
-
- **
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
###
|
|
43
|
-
|
|
44
|
-
- **
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
### Fixed
|
|
75
|
-
|
|
76
|
-
- **
|
|
77
|
-
`
|
|
78
|
-
`
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
###
|
|
83
|
-
|
|
84
|
-
- **
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
###
|
|
99
|
-
|
|
100
|
-
- **
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
###
|
|
107
|
-
|
|
108
|
-
- **
|
|
109
|
-
(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
###
|
|
125
|
-
|
|
126
|
-
- **
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
- **
|
|
146
|
-
`
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
- **
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
-
|
|
241
|
-
|
|
242
|
-
-
|
|
243
|
-
|
|
244
|
-
- **
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
- **
|
|
258
|
-
|
|
259
|
-
- **
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
- **
|
|
300
|
-
-
|
|
301
|
-
-
|
|
302
|
-
-
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
- **
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
- Removed
|
|
328
|
-
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
-
|
|
341
|
-
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
- **
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
###
|
|
356
|
-
|
|
357
|
-
- **
|
|
358
|
-
-
|
|
359
|
-
-
|
|
360
|
-
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
- **
|
|
373
|
-
-
|
|
374
|
-
-
|
|
375
|
-
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
- `
|
|
385
|
-
-
|
|
386
|
-
|
|
387
|
-
###
|
|
388
|
-
|
|
389
|
-
- **
|
|
390
|
-
-
|
|
391
|
-
-
|
|
392
|
-
-
|
|
393
|
-
|
|
394
|
-
### Added
|
|
395
|
-
|
|
396
|
-
- **
|
|
397
|
-
-
|
|
398
|
-
-
|
|
399
|
-
-
|
|
400
|
-
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
- **
|
|
405
|
-
-
|
|
406
|
-
-
|
|
407
|
-
-
|
|
408
|
-
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
- Toggle
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
- **openrouter**:
|
|
423
|
-
- **
|
|
424
|
-
-
|
|
425
|
-
|
|
426
|
-
###
|
|
427
|
-
|
|
428
|
-
-
|
|
429
|
-
-
|
|
430
|
-
-
|
|
431
|
-
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
- **
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
-
|
|
481
|
-
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
-
|
|
502
|
-
-
|
|
503
|
-
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
-
|
|
512
|
-
-
|
|
513
|
-
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
-
|
|
519
|
-
-
|
|
520
|
-
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
-
|
|
534
|
-
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
-
|
|
544
|
-
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [2.0.11] - 2026-05-08
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Config wipe on JSON parse failure** — `saveConfig` used `loadConfigFile()` which returns `{}` on any parse error, causing `{ ...{}, ...updates }` to write a partial config that permanently destroyed all API keys. Now reads the raw file directly and refuses to save if corrupt. `ensureConfigFile` also refuses to overwrite corrupt files.
|
|
13
|
+
|
|
14
|
+
- **Built-in provider keys removed from pi-free config** — `mistral_api_key`, `groq_api_key`, `cerebras_api_key`, `xai_api_key`, and `hf_token` are no longer in `~/.pi/free.json`. These are pi's own built-in providers; their keys come from environment variables only.
|
|
15
|
+
|
|
16
|
+
## [2.0.9] - 2026-05-08
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **Together AI provider** — Fast inference on 200+ open-source models (Llama, DeepSeek, Qwen, etc.) through an OpenAI-compatible API. $1 trial credit on signup, no credit card required. Set `TOGETHER_AI_API_KEY`.
|
|
21
|
+
|
|
22
|
+
- **Per-model metadata for Ollama Cloud** — Fetches `/api/show` details for every Ollama Cloud model to detect real capabilities: thinking/vision support, actual context windows (up to 1M tokens), and thinking level maps (`reasoning_effort`). Models now show parameter size and quantization in display names.
|
|
23
|
+
|
|
24
|
+
- **Thinking level maps** — Four curated maps (`DEFAULT`, `GPT_OSS`, `QWEN3`, `NO_OFF`) for Ollama Cloud models that map Pi's thinking levels to Ollama's `reasoning_effort` values, based on per-model API testing.
|
|
25
|
+
|
|
26
|
+
- **`/ollama-cloud-refresh` command** — Re-fetch Ollama Cloud models from the API and update the provider live, no restart needed.
|
|
27
|
+
|
|
28
|
+
- **Persistent Ollama Cloud cache** — Models cached via `provider-cache.ts` for fast startup. Stale cache auto-refreshes on `session_start`. Fallback models used when cache is unavailable.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- **ZenMux pricing** — Fixed `pricings` key (was reading `pricing`, always returned $0). Now correctly extracts per-model pricing (per-million-tokens ÷ 1M). Also uses `display_name`, `input_modalities` (vision detection), and `capabilities.reasoning` from API.
|
|
33
|
+
|
|
34
|
+
- **CrofAI model metadata** — Custom fetch now reads per-model `name`, `custom_reasoning`, `context_length`, `max_completion_tokens`, and per-million-token `pricing` from the API.
|
|
35
|
+
|
|
36
|
+
- **DeepInfra model metadata** — Extracts real model data from the `metadata` sub-object (context_length, max_tokens, pricing, reasoning tags). Filters non-chat models (embedding, rerank, whisper).
|
|
37
|
+
|
|
38
|
+
- **Ollama Cloud model names** — Enriched with parameter size and quantization (e.g., `deepseek-v4-pro (671B, Q4_0)`). Set `supportsDeveloperRole: false` (fixes GLM models silently ignoring prompts). Bumped `maxTokens` from 4096 to 32768.
|
|
39
|
+
|
|
40
|
+
- **SambaNova model accuracy** — `fetchOpenAICompatibleModels` now reads per-model `context_length`, `max_completion_tokens`, and `pricing` from SambaNova's extended API response. Also reads `reasoning`, `input_modalities`, and accepts plain array responses.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- **Package scope migration** — Updated all peer dependency imports from `@mariozechner/*` to `@earendil-works/*` (`pi-ai`, `pi-coding-agent`, `pi-tui`) to match the upstream scope rename in `@earendil-works/pi` v0.74.0.
|
|
45
|
+
|
|
46
|
+
## [2.0.8] - 2026-05-07
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
|
|
50
|
+
- **Codestral provider** — Mistral's code-focused model via codestral.mistral.ai.
|
|
51
|
+
Free tier (Experiment plan): 2 req/min, 500K tokens/min, 1B tokens/month.
|
|
52
|
+
Uses pi's built-in Mistral SDK (`mistral-conversations` API type).
|
|
53
|
+
|
|
54
|
+
- **LLM7.io provider** — OpenAI-compatible API gateway routing across
|
|
55
|
+
multiple providers (OpenAI, Mistral, Google, DeepSeek, etc.). Free tier:
|
|
56
|
+
default/fast selectors, 100 req/hr, 20 req/min.
|
|
57
|
+
|
|
58
|
+
- **DeepInfra provider** — AI inference cloud with 100+ open-source models.
|
|
59
|
+
$5 one-time credit on signup (no credit card). Models fetched dynamically.
|
|
60
|
+
Shown as trial credit provider in `/free-providers`.
|
|
61
|
+
|
|
62
|
+
- **SambaNova provider** — Fast inference on custom RDU hardware with
|
|
63
|
+
OpenAI-compatible API. All models accessible on free tier (no credit card):
|
|
64
|
+
20-480 RPM. Models include Llama 3.3 70B, DeepSeek-V3/R1, Llama 4 Maverick.
|
|
65
|
+
Shown as freemium provider in `/free-providers`.
|
|
66
|
+
|
|
67
|
+
### Changed
|
|
68
|
+
|
|
69
|
+
- **Codestral: fixed HTTP 422 error** — Switched API type from
|
|
70
|
+
`openai-completions` to `mistral-conversations`. The OpenAI completions
|
|
71
|
+
adapter was sending unrecognized fields (`stream_options`, `store`,
|
|
72
|
+
`max_completion_tokens`) that Mistral's API rejects with 422.
|
|
73
|
+
|
|
74
|
+
### Fixed
|
|
75
|
+
|
|
76
|
+
- **Toggle commands persist across sessions for all providers** — Providers using
|
|
77
|
+
`setupProvider` (zenmux, crofai, llm7, sambanova, deepinfra) were always
|
|
78
|
+
registering `freeModels` on startup, ignoring the persisted `show_paid` config.
|
|
79
|
+
Now each provider reads its config getter and registers the correct initial
|
|
80
|
+
model set. Fixes #149.
|
|
81
|
+
|
|
82
|
+
### Security
|
|
83
|
+
|
|
84
|
+
- **Log injection prevention** — `scripts/update-benchmarks.ts` sanitizes external
|
|
85
|
+
API data (CRLF stripping) before logging. Fixes SonarCloud S1075.
|
|
86
|
+
|
|
87
|
+
### Reliability
|
|
88
|
+
|
|
89
|
+
- **Prefer `String#replaceAll()` over `String#replace()`** — Replaced all 7 flagged
|
|
90
|
+
instances. Where regex is unnecessary (2/7), switched to string literal form.
|
|
91
|
+
Fixes SonarCloud S4144.
|
|
92
|
+
|
|
93
|
+
### Added
|
|
94
|
+
|
|
95
|
+
- **`agents.md`** — Codebase guide for AI agents covering architecture, patterns,
|
|
96
|
+
conventions, testing, and the Pi extension API.
|
|
97
|
+
|
|
98
|
+
### Added
|
|
99
|
+
|
|
100
|
+
- **Passive quota monitoring** — Extracts rate-limit headers from every
|
|
101
|
+
provider response via `after_provider_response` event (no extra API calls).
|
|
102
|
+
Tries 6 header format variants (`x-ratelimit-remaining`,
|
|
103
|
+
`ratelimit-remaining-requests-day`, etc.). Shows remaining quota in the
|
|
104
|
+
status bar with warning icons when ≤25% or ≤10%. Fixes #147.
|
|
105
|
+
|
|
106
|
+
### Fixed
|
|
107
|
+
|
|
108
|
+
- **Missing `g` flag on `replaceAll` regexps broke model filtering** —
|
|
109
|
+
`String.prototype.replaceAll()` requires a global RegExp; 20+ patterns in
|
|
110
|
+
`benchmark-lookup.ts` were missing it, causing a `TypeError` that prevented
|
|
111
|
+
models from appearing for providers like cline and kilo. Added `/g` flag to
|
|
112
|
+
all affected patterns. Fixes #151.
|
|
113
|
+
|
|
114
|
+
### Changed
|
|
115
|
+
|
|
116
|
+
- **Resolved ~280 SonarCloud issues across 21 files** — Bulk code-quality
|
|
117
|
+
cleanup including: stripping trailing zeros from `toFixed()` (S7748),
|
|
118
|
+
`global` → `globalThis` (S7764), `parseFloat` → `Number.parseFloat` (S7773),
|
|
119
|
+
naming unnamed async exports (S7726), `String.raw` for path strings (S7780),
|
|
120
|
+
top-level await over promise chains (S7785), re-export from source (S7763),
|
|
121
|
+
`.at(-1)` over `[length-1]` (S7755), `node:fs` protocol imports (S7772),
|
|
122
|
+
and logging user-controlled data sanitization (S5145). Fixes #148.
|
|
123
|
+
|
|
124
|
+
### Security
|
|
125
|
+
|
|
126
|
+
- **Bump `basic-ftp` 5.3.0 → 5.3.1** — Patches GHSA-rpmf-866q-6p89 (high
|
|
127
|
+
severity): malicious FTP server could cause client-side DoS via unbounded
|
|
128
|
+
multiline control response buffering. Fixes `npm audit` finding.
|
|
129
|
+
|
|
130
|
+
### Refactored
|
|
131
|
+
|
|
132
|
+
- **Extracted shared model-fetch helper** — `fetchOpenAICompatibleModels()`
|
|
133
|
+
in `lib/util.ts` eliminates ~120 lines of duplicated fetch→parse→map
|
|
134
|
+
boilerplate across CrofAI, DeepInfra, and SambaNova providers.
|
|
135
|
+
|
|
136
|
+
## [2.0.6] - 2026-05-02
|
|
137
|
+
|
|
138
|
+
### Security
|
|
139
|
+
|
|
140
|
+
- **5x S5852 regex super-linear runtime** — Replaced all flagged regex patterns
|
|
141
|
+
(nested quantifiers in model size extraction) with manual char-by-char string
|
|
142
|
+
parsing in `parseModelSize()`, `normalizeSizeTokenOrder()`, and test helpers.
|
|
143
|
+
Eliminates catastrophic backtracking risk.
|
|
144
|
+
|
|
145
|
+
- **4x S4036 PATH variable security** —
|
|
146
|
+
- `open-browser.ts`: Added `resolveExe()` helper that prefers known absolute
|
|
147
|
+
paths (`/usr/bin/open`, `C:\Windows\System32\...\powershell.exe`) before
|
|
148
|
+
falling back to PATH lookup
|
|
149
|
+
- `check-extensions.mjs`: Removed hardcoded PATH override; resolved `npm` via
|
|
150
|
+
`execFileSync` with known absolute paths
|
|
151
|
+
|
|
152
|
+
- **1x S4721 command injection** — Replaced `execSync` with `execFileSync` in
|
|
153
|
+
`resolveExe()` helper. `execFileSync` takes separate arguments and never
|
|
154
|
+
spawns a shell, eliminating the injection vector.
|
|
155
|
+
|
|
156
|
+
### Changed
|
|
157
|
+
|
|
158
|
+
- **Banner image** — Converted `banner.svg` to `banner.png` for reliable
|
|
159
|
+
rendering across all GitHub surfaces (mobile, email, dark mode readers).
|
|
160
|
+
|
|
161
|
+
## [2.0.5] - 2026-05-02
|
|
162
|
+
|
|
163
|
+
### Added
|
|
164
|
+
|
|
165
|
+
- **NVIDIA model probe auto-discovery** — Lazy auto-probe for NVIDIA models on
|
|
166
|
+
first `session_start` (once per session). Broken 404 models detected and
|
|
167
|
+
auto-hidden without requiring manual `/probe-nvidia`.
|
|
168
|
+
|
|
169
|
+
### Changed
|
|
170
|
+
|
|
171
|
+
- **Ollama provider updates** — Improved cloud model detection and configuration.
|
|
172
|
+
|
|
173
|
+
## [2.0.4] - 2026-05-02
|
|
174
|
+
|
|
175
|
+
### Fixed
|
|
176
|
+
|
|
177
|
+
- **OpenRouter key resolution no longer falls back to `free.json`** —
|
|
178
|
+
`getOpenrouterApiKey()` now only checks the `OPENROUTER_API_KEY` environment variable.
|
|
179
|
+
Previously it fell back to `~/.pi/free.json`, which could contain stale/revoked keys
|
|
180
|
+
that conflict with pi's built-in OpenRouter provider (which reads from
|
|
181
|
+
`~/.pi/agent/auth.json`).
|
|
182
|
+
|
|
183
|
+
- **Removed `openrouter_api_key` from `PiFreeConfig` interface and config template** —
|
|
184
|
+
Prevents future persistence of OpenRouter keys in `free.json`, eliminating the
|
|
185
|
+
source of stale key conflicts for built-in providers.
|
|
186
|
+
|
|
187
|
+
## [2.0.3] - 2026-05-02
|
|
188
|
+
|
|
189
|
+
### Added
|
|
190
|
+
|
|
191
|
+
- **Consistent `isFreeModel` helper with Route A/B logic** — Created a unified helper for free model detection that automatically detects whether a provider exposes pricing:
|
|
192
|
+
- **Route A (pricing-exposed)**: Model is free if `cost === 0` OR `"free"` in name (OR logic)
|
|
193
|
+
- **Route B (non-pricing-exposed)**: Model is free only if `"free"` in name
|
|
194
|
+
- Dynamic detection: If ALL models have cost === 0, assumes pricing not exposed → uses Route B
|
|
195
|
+
- If ANY model has cost > 0, assumes pricing exposed → uses Route A
|
|
196
|
+
- All providers (Cline, Kilo, NVIDIA, Ollama, dynamic built-in) now use this consistent helper
|
|
197
|
+
|
|
198
|
+
- **CrofAI provider (PAID)** — Added new **paid** provider for CrofAI (https://crof.ai), an OpenAI-compatible LLM inference API. **Note: CrofAI is a paid provider** — users must have a CrofAI API key with credits. The provider uses Route B detection (name-only) since CrofAI's API doesn't expose per-model pricing. Only models with `"free"` in their names are marked as free (none currently).
|
|
199
|
+
|
|
200
|
+
- **ZenMux provider (PAID)** — Added new **paid** provider for ZenMux AI gateway (https://zenmux.ai), a unified API for 200+ models from OpenAI, Anthropic, Google, etc. **Note: ZenMux is a paid provider** — users must have a ZenMux API key with credits. The provider uses Route A detection (OR logic) since ZenMux exposes pricing. Models marked as free only if `cost === 0` OR `"free"` in name (2 free models identified: GLM 4.7 Flash Free, GLM 4.6v Flash Free).
|
|
201
|
+
|
|
202
|
+
- **Comprehensive `isFreeModel` test suite** — Added 30+ unit tests covering Route A, Route B, freemium behavior, and edge cases. Tests verify correct classification on actual OpenRouter API data (371 models, 30 free).
|
|
203
|
+
|
|
204
|
+
- **Toggle commands for dynamic built-in providers** — Added `/toggle-mistral`, `/toggle-groq`,
|
|
205
|
+
`/toggle-cerebras`, `/toggle-xai`, and `/toggle-huggingface` commands. These providers were
|
|
206
|
+
registered with the global toggle system but lacked per-provider toggle commands, making
|
|
207
|
+
free/paid switching inaccessible without editing config files.
|
|
208
|
+
|
|
209
|
+
- **Lazy auto-probe for NVIDIA models** — Extracted `runNvidiaProbe()` into a shared function
|
|
210
|
+
called automatically on first `session_start` (once per session). Previously, users had to
|
|
211
|
+
manually run `/probe-nvidia` to discover 404 models. Now broken models are detected and
|
|
212
|
+
auto-hidden on first use.
|
|
213
|
+
|
|
214
|
+
### Changed
|
|
215
|
+
|
|
216
|
+
- **Cline provider now uses `isFreeModel`** — Fixed Cline to use the consistent `isFreeModel` helper instead of `m.cost.input === 0`. Previously used cost-only filtering, now uses proper OR logic for pricing-exposed providers.
|
|
217
|
+
|
|
218
|
+
- **NVIDIA test expectations updated** — Updated tests to reflect strict Route B behavior (name-only detection for non-pricing-exposed providers). Added test for models with `"free"` in name being marked as free.
|
|
219
|
+
|
|
220
|
+
### Fixed
|
|
221
|
+
|
|
222
|
+
- **`provider-factory.ts` — `beforeProviderRequest` hook now scoped to owning provider** —
|
|
223
|
+
The hook was firing for **all** provider requests regardless of which provider the factory
|
|
224
|
+
was configuring. Now checks `evt.provider !== def.providerId` and returns early if the
|
|
225
|
+
event doesn't belong to the owning provider.
|
|
226
|
+
|
|
227
|
+
- **`provider-factory.ts` — `reRegister` callback no longer corrupts stored model lists** —
|
|
228
|
+
When toggling between free/paid modes, the callback was overwriting `stored.all` with only
|
|
229
|
+
the filtered subset, losing the original full model list. Now preserves the original model
|
|
230
|
+
lists for correct subsequent toggling.
|
|
231
|
+
|
|
232
|
+
- **`lib/types.ts` — Removed leftover `LspTestInterface`** — Removed a test interface that
|
|
233
|
+
was left in production code.
|
|
234
|
+
|
|
235
|
+
- **`index.ts` — Removed redundant `.catch()` on deprecated Qwen provider** — The `.catch()`
|
|
236
|
+
was unnecessary since `Promise.allSettled` already handles rejections.
|
|
237
|
+
|
|
238
|
+
### Removed
|
|
239
|
+
|
|
240
|
+
- **Qwen provider (deprecated)** — Removed Qwen OAuth provider as the 1,000 req/day free tier is no longer available. Provider remains functional for existing authenticated users but new free tier registrations are not supported.
|
|
241
|
+
|
|
242
|
+
- **Modal provider** — Removed single-model Modal provider (only had GLM-5.1 FP8). Users should use other providers for GLM models.
|
|
243
|
+
|
|
244
|
+
- **Cloudflare provider** — Removed Cloudflare Workers AI provider as it's now built into pi core. Users can use pi's built-in Cloudflare provider instead.
|
|
245
|
+
|
|
246
|
+
- **Qwen test file** — Removed `tests/qwen.test.ts` along with the deprecated provider.
|
|
247
|
+
|
|
248
|
+
## [2.0.2] - 2026-04-26
|
|
249
|
+
|
|
250
|
+
### Added
|
|
251
|
+
|
|
252
|
+
- **Model matching debug logging** — Added `~/.pi/modelmatch.log` to diagnose which models get Coding Index scores and which don't:
|
|
253
|
+
- Logs every matching attempt with provider, model ID, normalization strategy, and result
|
|
254
|
+
- CSV-like format: `timestamp|provider|modelId|modelName|action|strategy|normalizedId|matchKey|codingIndex|details`
|
|
255
|
+
- Provider-specific normalizers for better matching:
|
|
256
|
+
- **NVIDIA**: Strips vendor prefixes (`meta/`, `mistralai/`, `microsoft/`, `qwen/`, etc.)
|
|
257
|
+
- **Cloudflare**: Strips `@cf/namespace/` prefixes
|
|
258
|
+
- **Groq**: Removes `-versatile` and numeric context suffixes (`-32768`)
|
|
259
|
+
- **Cerebras**: Normalizes `llama3.1` → `llama-3.1`, auto-adds `instruct` suffix
|
|
260
|
+
- **Mistral**: Strips `-latest` suffix
|
|
261
|
+
- **Ollama**: Converts `model:tag` → `model-tag`
|
|
262
|
+
- Common suffix stripping: `:free`, date codes (`-20250514`), versions (`-v1.1`), `-it`, `-fp8`/`-bf16`
|
|
263
|
+
|
|
264
|
+
- **Enhanced benchmark lookup** — `enhanceModelNameWithCodingIndex()` now accepts optional `provider` parameter for provider-aware normalization
|
|
265
|
+
|
|
266
|
+
- **Static 404 model blocklist for NVIDIA** — Probed all 136 models from `integrate.api.nvidia.com/v1/models` and identified 57 that return 404 "Function not found" on `/v1/chat/completions`. These are now hard-filtered so they never appear in the model selector:
|
|
267
|
+
- Covers discontinued models (`databricks/dbrx-instruct`, `meta/codellama-70b`, `meta/llama2-70b`, `ibm/granite-*`, etc.)
|
|
268
|
+
- Covers embedding-only models listed as chat-capable (`nvidia/nv-embed-v1`, `nvidia/nv-embedqa-*`, `snowflake/arctic-embed-l`, etc.)
|
|
269
|
+
- Covers stale API catalog entries (`mistralai/mistral-large`, `mistralai/mistral-large-2-instruct`, `writer/palmyra-*`, etc.)
|
|
270
|
+
- Full list in `NVIDIA_KNOWN_404_MODELS` in `providers/nvidia/nvidia.ts`
|
|
271
|
+
|
|
272
|
+
- **`/probe-nvidia` command** — On-demand model health check. Tests every registered NVIDIA model with a minimal `max_tokens: 1` request, auto-hides any new 404s in `~/.pi/free.json`, and re-registers the provider immediately.
|
|
273
|
+
|
|
274
|
+
- **`scripts/probe-nvidia.mjs`** — Standalone Node.js script to reproduce the probe. Reads `~/.pi/free.json` for the API key, batches 20 requests at a time with 10s timeout, and prints all broken model IDs for adding to the blocklist.
|
|
275
|
+
|
|
276
|
+
- **Ollama Cloud 403 handling** — Same pattern as NVIDIA 404s for Ollama Cloud:
|
|
277
|
+
- `OLLAMA_KNOWN_403_MODELS` blocklist for models that return 403 "access denied"
|
|
278
|
+
- `/probe-ollama` command to test all models on-demand, auto-hide broken ones, and re-register
|
|
279
|
+
- `scripts/probe-ollama.mjs` standalone script for blocklist maintenance
|
|
280
|
+
|
|
281
|
+
- **Provider-scoped hidden models** — Hidden models are now provider-specific:
|
|
282
|
+
- Format: `"provider/model-id"` (e.g., `"ollama/kimi-k2.6"`, `"nvidia/broken-model"`)
|
|
283
|
+
- A model hidden from one provider doesn't hide it from other providers
|
|
284
|
+
- Backward compatible with old global `"model-id"` format
|
|
285
|
+
- All providers updated: NVIDIA, Ollama, Cloudflare, Cline, Kilo, Modal
|
|
286
|
+
|
|
287
|
+
### Fixed
|
|
288
|
+
|
|
289
|
+
- **Probe commands timeout handling** — Added `fetchWithTimeout` with 10-second timeout to `/probe-nvidia` and `/probe-ollama` commands. Prevents the coding harness from freezing when individual model probe requests hang indefinitely.
|
|
290
|
+
|
|
291
|
+
- **NVIDIA provider now sends `authHeader: true`** — Explicitly enables `Authorization: Bearer` header injection. Previously relied on pi's implicit behavior which could fail in some configurations.
|
|
292
|
+
|
|
293
|
+
### Removed
|
|
294
|
+
|
|
295
|
+
- **NVIDIA 404 model warning log** — Removed the `console.warn("[nvidia] Skipping known 404 model: ...")` output when filtering out known broken models. The filter still works silently; use `/probe-nvidia` to identify new 404s if needed.
|
|
296
|
+
|
|
297
|
+
### Changed
|
|
298
|
+
|
|
299
|
+
- **Cloudflare provider now fetches models dynamically** — Replaced static 19-model hardcoded list with live API fetch from `api.cloudflare.com/client/v4/accounts/{account_id}/ai/models`:
|
|
300
|
+
- Automatically discovers all 30+ text generation models (was manually maintaining 19)
|
|
301
|
+
- Smart filtering excludes embeddings, image generation, speech, translation, and vision-only models via regex patterns
|
|
302
|
+
- Metadata inference from model IDs: detects vision (`vision`/`multimodal`), reasoning (`r1`/`thinking`/`qwq`), context windows, and estimated costs
|
|
303
|
+
- Fixed Mistral Small ID: changed from incorrect `@cf/mistralai/...` to correct `@cf/mistral/...`
|
|
304
|
+
- Added new fallback models: Kimi K2.6, OpenAI GPT-OSS 120B/20B, Qwen 2.5 Coder 32B, QwQ 32B, Llama 3.2 11B Vision
|
|
305
|
+
- Graceful fallback to expanded 18-model hardcoded list if API fetch fails
|
|
306
|
+
|
|
307
|
+
- **NVIDIA provider now queries NVIDIA's API directly** — Source of truth switched from `models.dev` curated JSON to `https://integrate.api.nvidia.com/v1/models`:
|
|
308
|
+
- Eliminates 57 missing models and 25 stale entries from the old third-party source
|
|
309
|
+
- Models not in `models.dev` get inferred metadata (128k context, 4k output, vision/reasoning heuristics)
|
|
310
|
+
- Added regex-based non-chat model filtering for unknown models (embeddings, whisper, reward models, safety guards, parsers, detectors, etc.)
|
|
311
|
+
- Graceful fallback to `models.dev` if NVIDIA API is unreachable
|
|
312
|
+
- Removed paid/free toggle filtering — NVIDIA is freemium (all models use free credits)
|
|
313
|
+
|
|
314
|
+
## [2.0.1] - 2026-04-24
|
|
315
|
+
|
|
316
|
+
### Added
|
|
317
|
+
|
|
318
|
+
- **Built-in provider toggle support** (`lib/built-in-toggle.ts`) — Enables free/paid filtering for Pi's built-in providers that expose per-model pricing:
|
|
319
|
+
- **OpenCode (`/toggle-opencode`)** — Captures built-in OpenCode models on session start and filters to free-only by default
|
|
320
|
+
- **OpenRouter (`/toggle-openrouter`)** — Now uses the built-in toggle system for consistency
|
|
321
|
+
- Toggle works in the current session (no restart needed)
|
|
322
|
+
- Persisted via `opencode_show_paid` and `openrouter_show_paid` in `~/.pi/free.json`
|
|
323
|
+
|
|
324
|
+
### Changed
|
|
325
|
+
|
|
326
|
+
- **OpenRouter moved to built-in toggle system** — OpenRouter is now handled by `lib/built-in-toggle.ts` alongside OpenCode for a unified approach:
|
|
327
|
+
- Removed from `providers/dynamic-built-in/index.ts`
|
|
328
|
+
- Eliminated duplicate toggle command registration logic
|
|
329
|
+
- Consolidated toggle persistence with other built-in providers
|
|
330
|
+
|
|
331
|
+
- **Standardized all toggle commands to `toggle-{provider}`** — Renamed from `{provider}-toggle` for consistency:
|
|
332
|
+
- `/kilo-toggle` → `/toggle-kilo`
|
|
333
|
+
- `/cline-toggle` → `/toggle-cline`
|
|
334
|
+
- `/openrouter-toggle` → `/toggle-openrouter`
|
|
335
|
+
- `/nvidia-toggle` → `/toggle-nvidia`
|
|
336
|
+
- `/cloudflare-toggle` → `/toggle-cloudflare`
|
|
337
|
+
- `/ollama-toggle` → `/toggle-ollama`
|
|
338
|
+
- `/mistral-toggle` → `/toggle-mistral`
|
|
339
|
+
- `/groq-toggle` → `/toggle-groq`
|
|
340
|
+
- `/cerebras-toggle` → `/toggle-cerebras`
|
|
341
|
+
- `/toggle-opencode` (new)
|
|
342
|
+
|
|
343
|
+
### Fixed
|
|
344
|
+
|
|
345
|
+
- **Ollama Cloud model fetching endpoint** — Corrected the `/v1/models` → `/models` endpoint path in `providers/ollama/ollama.ts`:
|
|
346
|
+
- The previous fix (2.0.0) incorrectly used `/v1/models`; Ollama Cloud's models endpoint is `/v1/models` for chat completions but `/models` for listing
|
|
347
|
+
- This ensures model fetching works correctly with the OpenAI-compatible API
|
|
348
|
+
|
|
349
|
+
### Removed
|
|
350
|
+
|
|
351
|
+
- **Global `/free` command** — Removed the global free-only toggle. Per-provider toggles (`/toggle-{provider}`) are now the only way to switch between free and paid models. The `/free-providers` status command remains.
|
|
352
|
+
|
|
353
|
+
## [2.0.0] - 2026-04-23
|
|
354
|
+
|
|
355
|
+
### Breaking Changes
|
|
356
|
+
|
|
357
|
+
- **Removed Fireworks provider** — Fireworks is now a built-in Pi provider (added in pi 0.68.1), so the extension's Fireworks provider has been removed to avoid conflicts:
|
|
358
|
+
- Deleted `providers/fireworks/fireworks.ts` and `tests/fireworks.test.ts`
|
|
359
|
+
- Removed all Fireworks configuration options from `config.ts` (`fireworks_api_key`, `fireworks_show_paid`)
|
|
360
|
+
- Users should now use Pi's built-in Fireworks support with `FIREWORKS_API_KEY`
|
|
361
|
+
|
|
362
|
+
- **Renamed Ollama provider to `ollama-cloud`** — Changed provider ID from `"ollama"` to `"ollama-cloud"` to avoid collision with Pi's built-in local Ollama provider:
|
|
363
|
+
- This prevents provider ID conflicts when both are registered
|
|
364
|
+
- All log messages and documentation now reference "Ollama Cloud"
|
|
365
|
+
|
|
366
|
+
### Removed
|
|
367
|
+
|
|
368
|
+
- **Dropped `@sinclair/typebox` peer dependency** — Pi 0.69.0 migrated from `@sinclair/typebox` to `typebox` 1.x. The extension didn't directly import this package, so it was removed from `peerDependencies` to avoid potential conflicts.
|
|
369
|
+
|
|
370
|
+
### Fixed
|
|
371
|
+
|
|
372
|
+
- **Ollama Cloud API endpoint** — Fixed broken Ollama Cloud integration:
|
|
373
|
+
- Changed `BASE_URL_OLLAMA` from `https://ollama.com` to `https://ollama.com/v1` — the OpenAI-compatible API endpoint
|
|
374
|
+
- Fixed model fetching to use `/v1/models` instead of `/api/tags` — ensures model IDs work with chat completions endpoint
|
|
375
|
+
- Previously calls went to HTML homepage instead of API endpoints, causing 404 errors
|
|
376
|
+
|
|
377
|
+
### Removed
|
|
378
|
+
|
|
379
|
+
- **Removed paid model warning on selection** — Deleted the `model_select` event handler that showed:
|
|
380
|
+
- `⚠️ Paid model selected (${model.id}). Use "/free off" to enable paid models.`
|
|
381
|
+
- This warning was redundant since the global `/free` toggle and provider toggles already control model visibility
|
|
382
|
+
|
|
383
|
+
- **Removed pointless `/modal-toggle` command** — Modal provider only has 1 free model (GLM-5.1 FP8), so there was nothing meaningful to toggle:
|
|
384
|
+
- Added `skipToggle` option to `ProviderDefinition` and `ProviderSetupConfig` interfaces
|
|
385
|
+
- Modal provider now sets `skipToggle: true` to prevent toggle command creation
|
|
386
|
+
|
|
387
|
+
### Changed
|
|
388
|
+
|
|
389
|
+
- **Marked Qwen provider as fully deprecated** — Updated messaging to clarify the provider is broken:
|
|
390
|
+
- Changed model name from `"Qwen Coder — Free 1k/day"` to `"Qwen Coder — DEPRECATED (free tier discontinued)"`
|
|
391
|
+
- Updated all JSDoc comments to clearly state auth is broken and free tier is no longer available
|
|
392
|
+
- Provider remains for backward compatibility but should not be used
|
|
393
|
+
|
|
394
|
+
### Added
|
|
395
|
+
|
|
396
|
+
- **Cloudflare Workers AI provider** — New provider for Cloudflare's serverless GPU platform:
|
|
397
|
+
- 50+ open-source models: Llama 4, Mistral Small 3.1, Qwen 2.5/3, DeepSeek R1, Gemma 4, Kimi K2.5/2.6, and more
|
|
398
|
+
- **10,000 Neurons/day FREE tier** (resets daily at 00:00 UTC)
|
|
399
|
+
- **$0.011 per 1,000 Neurons** beyond free allocation
|
|
400
|
+
- Only requires `CLOUDFLARE_API_TOKEN` — account ID auto-derived from token
|
|
401
|
+
- Toggle with `/cloudflare-toggle`
|
|
402
|
+
- Create token at https://dash.cloudflare.com/profile/api-tokens
|
|
403
|
+
|
|
404
|
+
- **Unified dynamic built-in providers module** — New `providers/dynamic-built-in/` module that dynamically fetches models from Pi's built-in providers when users have API keys:
|
|
405
|
+
- **Mistral** (`MISTRAL_API_KEY`) — Fetches from `api.mistral.ai/v1/models`
|
|
406
|
+
- **Groq** (`GROQ_API_KEY`) — Fetches from `api.groq.com/openai/v1/models`
|
|
407
|
+
- **Cerebras** (`CEREBRAS_API_KEY`) — Fetches from `api.cerebras.ai/v1/models`
|
|
408
|
+
- **xAI** (`XAI_API_KEY`) — Fetches from `api.x.ai/v1/models`
|
|
409
|
+
- **Hugging Face** (`HF_TOKEN` — optional) — Fetches public + authenticated models
|
|
410
|
+
- **OpenRouter** — Moved from `index.ts` to unified module with dynamic fetch
|
|
411
|
+
- All integrate with global `/free` toggle and have per-provider toggle commands (`/mistral-toggle`, `/groq-toggle`, etc.)
|
|
412
|
+
|
|
413
|
+
- **Global `/free` toggle system** — New centralized free/paid filtering across ALL providers:
|
|
414
|
+
- `/free on/off/status` — Toggle free-only view globally
|
|
415
|
+
- `/free-providers` — Show free/paid model counts by provider
|
|
416
|
+
- `FREE_ONLY` config option and `PI_FREE_ONLY` environment variable
|
|
417
|
+
- Providers register via `registerWithGlobalToggle()` for unified filtering
|
|
418
|
+
|
|
419
|
+
### Fixed
|
|
420
|
+
|
|
421
|
+
- **Toggle commands now actually filter models from UI** — Previously, toggle commands only showed notifications but didn't remove paid models from the model picker:
|
|
422
|
+
- **OpenRouter (`/openrouter-toggle`)**: Now uses `registerProvider`/`unregisterProvider` to actually filter models from the picker UI
|
|
423
|
+
- **NVIDIA (`/nvidia-toggle`)**: Added dynamic `showPaid` parameter to `fetchNvidiaModels()` so toggle properly switches between free and paid model sets
|
|
424
|
+
- **Fireworks**: Removed broken toggle command — all models are paid with no free tier, so there was nothing to toggle
|
|
425
|
+
|
|
426
|
+
### Added
|
|
427
|
+
|
|
428
|
+
- **OpenRouter per-provider free model toggle** — Added `/openrouter-toggle` command for the built-in OpenRouter provider:
|
|
429
|
+
- `/openrouter-toggle` — Switch between showing only free models vs all models (including paid)
|
|
430
|
+
- New config flag `openrouter_show_paid` in `~/.pi/free.json` (default: `false`)
|
|
431
|
+
- Environment variable: `OPENROUTER_SHOW_PAID=true` to show paid models by default
|
|
432
|
+
- This brings OpenRouter (a built-in pi provider) in line with extension providers that have per-provider toggles
|
|
433
|
+
|
|
434
|
+
### Deprecated
|
|
435
|
+
|
|
436
|
+
- **Qwen provider** — The 1,000 requests/day free tier is no longer available from Qwen/DashScope. The provider code remains for backward compatibility but is now deprecated:
|
|
437
|
+
- Added `@deprecated` JSDoc tags to all Qwen-related exports
|
|
438
|
+
- Added deprecation warning when Qwen provider loads
|
|
439
|
+
- Added warning when `QWEN_SHOW_PAID` config is used
|
|
440
|
+
- Consider migrating to other free providers: Kilo, Cline, NVIDIA, or Modal
|
|
441
|
+
|
|
442
|
+
### Added
|
|
443
|
+
|
|
444
|
+
- **Go provider** — OpenCode Go subscription gateway (⚠️ paid only — $5 first month, then $10/month, no free tier) with models: GLM-5, Kimi K2.5, MiMo-V2-Pro, MiMo-V2-Omni, MiniMax M2.7, MiniMax M2.5
|
|
445
|
+
- Set `OPENCODE_GO_API_KEY` or `opencode_go_api_key` in `~/.pi/free.json`
|
|
446
|
+
- Toggle with `/go-toggle`
|
|
447
|
+
|
|
448
|
+
### Fixed
|
|
449
|
+
|
|
450
|
+
- **All providers now show Coding Index scores in model selector** — Added `enhanceWithCI()` to factory-based providers (nvidia, fireworks, mistral, modal, ollama) and cline. Now all providers display CI scores in `/models` command (pi-models extension).
|
|
451
|
+
|
|
452
|
+
- **All providers now show in `--list-models`** — Providers (zen, openrouter, go) that registered models only in `session_start` were missing from `pi --list-models` which runs before session starts. Added immediate registration for these providers:
|
|
453
|
+
- **zen**: Added model caching to `~/.pi/provider-cache.json` for immediate registration + dynamic refresh
|
|
454
|
+
- **openrouter**: Immediate model registration at extension load (like kilo/cline)
|
|
455
|
+
- **go**: Immediate registration with static model list (no API to fetch from)
|
|
456
|
+
- All 11 providers now visible in `--list-models`
|
|
457
|
+
|
|
458
|
+
### Changed
|
|
459
|
+
|
|
460
|
+
- Updated README with clear free vs paid provider distinction (9 free + 2 paid-only: Go, Fireworks)
|
|
461
|
+
- Added Go and Fireworks provider documentation under new "💳 Paid-Only Providers" section
|
|
462
|
+
- Added `opencode_go_api_key` to config file template
|
|
463
|
+
- Updated package.json description and keywords to include all 11 providers
|
|
464
|
+
|
|
465
|
+
### Added
|
|
466
|
+
|
|
467
|
+
- **Provider model cache** (`lib/provider-cache.ts`) — New utility for caching provider model lists to `~/.pi/provider-cache.json`. Used by zen provider for faster startup and offline access after first successful fetch.
|
|
468
|
+
|
|
469
|
+
## [1.0.9] - 2026-04-14
|
|
470
|
+
|
|
471
|
+
### Fixed
|
|
472
|
+
|
|
473
|
+
- **Qwen OAuth breaks other OAuth providers** — `modifyModels` receives all models across every registered provider, not just Qwen's. The previous `map()` stamped the Qwen dashscope `baseUrl` onto every model, causing other OAuth providers (Kilo, OpenRouter, etc.) to return 404 after a `/login qwen` flow. Now only models with `provider === PROVIDER_QWEN` are patched; others pass through unchanged.
|
|
474
|
+
|
|
475
|
+
## [1.0.8] - 2026-04-13
|
|
476
|
+
|
|
477
|
+
### Added
|
|
478
|
+
|
|
479
|
+
- **Modal provider** — Free access to GLM-5.1 FP8 (128k context, 16k max output) during promotional period (free until April 30, 2026)
|
|
480
|
+
- Requires a free Modal API key (`MODAL_API_KEY` or `modal_api_key` in `~/.pi/free.json`)
|
|
481
|
+
- Model: `zai-org/GLM-5.1-FP8` — 128k context window, 16k max output tokens
|
|
482
|
+
- **Qwen provider** — Free access to Qwen Coder (1,000 requests/day) via OAuth device flow
|
|
483
|
+
- Run `/login qwen` to authenticate through Qwen Studio (chat.qwen.ai)
|
|
484
|
+
- Uses `coder-model` alias (maps to Qwen3.6-Plus on the backend)
|
|
485
|
+
- 131k context window, 16k max output tokens, zero cost
|
|
486
|
+
|
|
487
|
+
### Fixed
|
|
488
|
+
|
|
489
|
+
- **Qwen OAuth browser launch on Windows** — URLs with `&` query params were truncated by `cmd.exe`'s `&` command separator; switched to `powershell.exe Start-Process` which passes the URL as a literal string
|
|
490
|
+
- **Qwen API endpoint** — Replicates qwen-code's `getCurrentEndpoint()` logic: uses `resource_url` from OAuth token response (`dashscope.aliyuncs.com` for Chinese accounts, `portal.qwen.ai` for international), with fallback to `dashscope.aliyuncs.com/compatible-mode/v1`
|
|
491
|
+
- **Qwen DashScope headers** — Added all headers required by DashScope's OpenAI-compatible API: `X-DashScope-AuthType: qwen-oauth`, `X-DashScope-CacheControl: enable`, `X-DashScope-UserAgent`, `Client-Code: QwenCode`
|
|
492
|
+
- **Qwen modifyModels crash** — `modifyModels` must be synchronous; making it async caused the pi framework to receive a `Promise` instead of a `Model[]`, breaking `ModelRegistry.find()`
|
|
493
|
+
|
|
494
|
+
## [1.0.5] - 2025-04-03
|
|
495
|
+
|
|
496
|
+
### Fixed
|
|
497
|
+
|
|
498
|
+
- **NVIDIA provider non-chat model filtering** (comment/implementation mismatch)
|
|
499
|
+
- Added modalities-based filtering to exclude embedding, speech-to-text, OCR, and image-gen models
|
|
500
|
+
- Filters models where `output` is not `["text"]` (e.g., image generation like `black-forest-labs/flux.1-dev`)
|
|
501
|
+
- Filters models where `input` lacks `"text"` (e.g., OCR like `nvidia/nemoretriever-ocr-v1`, speech-to-text like `openai/whisper-large-v3`)
|
|
502
|
+
- Updated file comment to accurately describe the filtering behavior
|
|
503
|
+
- Added 8 comprehensive unit tests for model filtering logic
|
|
504
|
+
|
|
505
|
+
## [1.0.4] - 2025-04-03
|
|
506
|
+
|
|
507
|
+
### Fixed
|
|
508
|
+
|
|
509
|
+
- **All tests now passing** (127/127)
|
|
510
|
+
- Fixed mock paths in kilo.test.ts, zen.test.ts, ollama.test.ts
|
|
511
|
+
- Fixed createCtxReRegister mocks in zen.test.ts and openrouter.test.ts
|
|
512
|
+
- Fixed cline.test.ts to test actual provider re-registration behavior
|
|
513
|
+
- Added missing DEFAULT_MIN_SIZE_B constant to openrouter mock
|
|
514
|
+
|
|
515
|
+
### Changed
|
|
516
|
+
|
|
517
|
+
- **Code quality improvements**
|
|
518
|
+
- Refactored usage modules to break circular dependency (limits.ts ↔ formatters.ts)
|
|
519
|
+
- Created usage/types.ts with shared interfaces (FreeTierLimit, FreeTierUsage)
|
|
520
|
+
- Bumped version to 1.0.4
|
|
521
|
+
|
|
522
|
+
## [1.0.3] - 2025-04-03
|
|
523
|
+
|
|
524
|
+
### Changed
|
|
525
|
+
|
|
526
|
+
- Updated package.json metadata (name, description, keywords, repository URL)
|
|
527
|
+
- Updated .npmignore for cleaner publishes
|
|
528
|
+
|
|
529
|
+
## [1.0.0] - 2024-03-28
|
|
530
|
+
|
|
531
|
+
### Added
|
|
532
|
+
|
|
533
|
+
- Initial release with 6 providers: Kilo, Zen, OpenRouter, NVIDIA, Cline, Fireworks
|
|
534
|
+
- Free tier usage tracking across all sessions
|
|
535
|
+
- Provider failover with model hopping
|
|
536
|
+
- Autocompact integration for rate limit recovery
|
|
537
|
+
- Usage widget with glimpseui
|
|
538
|
+
- Command toggles for free/all model filtering
|
|
539
|
+
- Hardcoded benchmark data from Artificial Analysis
|
|
540
|
+
|
|
541
|
+
### Changed
|
|
542
|
+
|
|
543
|
+
- **Major refactoring**: Split free-tier-limits.ts into usage/\* modules
|
|
544
|
+
- usage/tracking.ts - runtime session tracking
|
|
545
|
+
- usage/cumulative.ts - persistent storage
|
|
546
|
+
- usage/formatters.ts - display formatting
|
|
547
|
+
- 77% line reduction (741 → 166 lines)
|
|
548
|
+
- **Major refactoring**: Split usage-widget.ts into widget/\* modules
|
|
549
|
+
- widget/data.ts - data collection
|
|
550
|
+
- widget/format.ts - formatting utilities
|
|
551
|
+
- widget/render.ts - HTML generation
|
|
552
|
+
- 74% line reduction (~350 → 90 lines)
|
|
553
|
+
- **Refactoring**: Extracted functions from cline-auth.ts
|
|
554
|
+
- fetchAuthorizeUrl() - auth URL fetching
|
|
555
|
+
- waitForAuthCode() - callback handling
|
|
556
|
+
- exchangeCodeForTokens() - token exchange
|
|
557
|
+
- parseManualInput() - manual input parsing
|
|
558
|
+
- **Refactoring**: Simplified model-hop.ts complexity
|
|
559
|
+
- Extracted handleDowngradeDecision()
|
|
560
|
+
- Extracted tryAlternativeModel()
|
|
561
|
+
- **Deduplication**: Created shared modules
|
|
562
|
+
- lib/json-persistence.ts - file I/O with caching
|
|
563
|
+
- lib/logger.ts - structured logging
|
|
564
|
+
- providers/model-fetcher.ts - OpenRouter-compatible fetching
|
|
565
|
+
- Replaced ~30 console.log statements with structured logging
|
|
566
|
+
- Fixed all 9 pre-existing test failures
|
|
567
|
+
- fetchWithRetry now throws after last retry
|
|
568
|
+
- Fixed auth pattern matching (added key.*not.*valid)
|
|
569
|
+
- Updated capability ranking tests
|
|
570
|
+
- Added resetUsageStats() for test isolation
|
|
571
|
+
|
|
572
|
+
### Fixed
|
|
573
|
+
|
|
574
|
+
- fetchWithRetry() now properly throws after exhausting retries
|
|
575
|
+
- Auth error pattern matching now handles more message variants
|
|
576
|
+
- Test isolation for free-tier-limits tests
|