pi-free 2.1.0 → 2.2.0
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 +48 -3
- package/README.md +32 -4
- package/banner.svg +1 -1
- package/config.ts +644 -629
- package/constants.ts +4 -0
- package/index.ts +380 -378
- package/lib/built-in-toggle.ts +0 -40
- package/lib/probe-cache.ts +8 -0
- package/lib/provider-probe.ts +15 -0
- package/package.json +5 -5
- package/provider-helper.ts +1 -25
- package/providers/bai/bai.ts +232 -0
- package/providers/cline/cline-xml-bridge.ts +631 -105
- package/providers/cline/cline.ts +0 -23
- package/providers/codestral/codestral.ts +0 -11
- package/providers/dynamic-built-in/index.ts +12 -20
- package/providers/kilo/kilo.ts +2 -19
- package/providers/ollama/ollama.ts +12 -12
- package/providers/routeway/routeway.ts +10 -0
- package/providers/tokenrouter/tokenrouter.ts +634 -378
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.2.0] - 2026-06-19
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **b.ai** provider (`api.b.ai/v1`) — OpenAI-compatible gateway with 29 models
|
|
15
|
+
(Claude Opus 4.x / Sonnet 4.x, GPT-5.x family, Gemini 3.x family, DeepSeek
|
|
16
|
+
V4 / V3.2, GLM-5.x, Kimi K2.5, Qwen 3.6-27B, MiniMax M3 / M2.7). Currently
|
|
17
|
+
advertises `MiniMax-M3` as a limited-time free promotional model; all
|
|
18
|
+
other models default to paid (visible by default). Static API key auth via
|
|
19
|
+
`BAI_API_KEY` env var or `bai_api_key` in `~/.pi/free.json`. New commands:
|
|
20
|
+
`/toggle-bai`.
|
|
21
|
+
|
|
22
|
+
### Security
|
|
23
|
+
|
|
24
|
+
- Bumped `@earendil-works/pi-ai`, `@earendil-works/pi-coding-agent`, and
|
|
25
|
+
`@earendil-works/pi-tui` to `^0.79.8` — resolves Dependabot advisories
|
|
26
|
+
#19 and #21 (high-severity protobufjs, ws, undici vulnerabilities in
|
|
27
|
+
`@earendil-works/pi-coding-agent`).
|
|
28
|
+
- Bumped `typescript` devDep to `^6.0.3`.
|
|
29
|
+
- Removed now-redundant `overrides` for `protobufjs` and `ws` (fixed
|
|
30
|
+
upstream).
|
|
31
|
+
|
|
32
|
+
## [2.1.1] - 2026-06-15
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- **Cline XML bridge**:
|
|
37
|
+
- Preserve JSON file content as string in `write_to_file` XML — prevents file bodies from being parsed as JSON objects and corrupted ([#244](https://github.com/apmantza/pi-free/pull/244)).
|
|
38
|
+
- Recover heredoc file writes (Model `cat << 'EOF'` pattern in `execute_command`) as `write`/`write_to_file` tool calls ([#246](https://github.com/apmantza/pi-free/pull/246)).
|
|
39
|
+
- Recover XML tool calls from the reasoning stream when MiMo nests tools inside thinking blocks ([#249](https://github.com/apmantza/pi-free/pull/249)).
|
|
40
|
+
- Surface reasoning-only responses: when MiMo puts the entire answer in reasoning with no visible text, surface it as best-effort visible output instead of a blank stop ([#251](https://github.com/apmantza/pi-free/pull/251)).
|
|
41
|
+
- Strip Unicode math-italic XML tag decorations (`<𝑎𝑛𝑡𝑚𝑙:thinking>`, `<𝑎𝑛𝑡𝑚𝑙:read_file>`) that MiMo emits instead of standard Cline XML tags ([#252](https://github.com/apmantza/pi-free/pull/252)).
|
|
42
|
+
- Hide internal planning phrases and restrict hidden-tool recovery to the reasoning channel only — never leak raw LLM planning as user-visible text ([#252](https://github.com/apmantza/pi-free/pull/252)).
|
|
43
|
+
- Retry MiMo stream errors with reasoning disabled on the second attempt ([#252](https://github.com/apmantza/pi-free/pull/252)).
|
|
44
|
+
- Parse MiMo Pi SDK `<function=name>` tool-call syntax directly — no double conversion through Cline XML ([#255](https://github.com/apmantza/pi-free/pull/255)).
|
|
45
|
+
- Auto-retry reasoning-only MiMo responses with a "continue" nudge instead of showing a dead-end error to the user ([#256](https://github.com/apmantza/pi-free/pull/256)).
|
|
46
|
+
|
|
47
|
+
- **TokenRouter**:
|
|
48
|
+
- Patch nested MiniMax `<think>` blocks that appear inside `reasoning_content` deltas ([#247](https://github.com/apmantza/pi-free/pull/247)).
|
|
49
|
+
- Scope MiniMax thinking patches to active MiniMax models only, avoiding interference with other model families ([#248](https://github.com/apmantza/pi-free/pull/248)).
|
|
50
|
+
- Patch MiniMax payloads in the stream wrapper to prevent malformed SSE from breaking the parser ([#250](https://github.com/apmantza/pi-free/pull/250)).
|
|
51
|
+
- Retry high-load 2064 errors from TokenRouter with automatic backoff ([#254](https://github.com/apmantza/pi-free/pull/254)).
|
|
52
|
+
|
|
53
|
+
- **UI**: Remove provider-count footer status text unconditionally — reduces status bar clutter ([#245](https://github.com/apmantza/pi-free/pull/245)).
|
|
54
|
+
|
|
10
55
|
## [2.1.0] - 2026-06-15
|
|
11
56
|
|
|
12
57
|
### Added
|
|
@@ -349,9 +394,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
349
394
|
- If ANY model has cost > 0, assumes pricing exposed → uses Route A
|
|
350
395
|
- All providers (Cline, Kilo, NVIDIA, Ollama, dynamic built-in) now use this consistent helper
|
|
351
396
|
|
|
352
|
-
- **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).
|
|
397
|
+
- **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).
|
|
353
398
|
|
|
354
|
-
- **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).
|
|
399
|
+
- **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).
|
|
355
400
|
|
|
356
401
|
- **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).
|
|
357
402
|
|
|
@@ -553,7 +598,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
553
598
|
- **$0.011 per 1,000 Neurons** beyond free allocation
|
|
554
599
|
- Only requires `CLOUDFLARE_API_TOKEN` — account ID auto-derived from token
|
|
555
600
|
- Toggle with `/cloudflare-toggle`
|
|
556
|
-
- Create token at https://dash.cloudflare.com/profile/api-tokens
|
|
601
|
+
- Create token at <https://dash.cloudflare.com/profile/api-tokens>
|
|
557
602
|
|
|
558
603
|
- **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:
|
|
559
604
|
- **Mistral** (`MISTRAL_API_KEY`) — Fetches from `api.mistral.ai/v1/models`
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Free and paid AI model providers for [Pi](https://pi.dev). Access **free and pai
|
|
|
14
14
|
|
|
15
15
|
When you install pi-free, it:
|
|
16
16
|
|
|
17
|
-
1. **Registers free-tier providers** with Pi's model picker — Kilo (free), Cline (free), LLM7 (free), TokenRouter (1 free model), ZenMux (paid), CrofAI (paid), Ollama Cloud (freemium), SambaNova (freemium), Codestral (freemium), DeepInfra (trial credit), Together AI (trial credit), Novita (paid), Routeway (paid), and more
|
|
17
|
+
1. **Registers free-tier providers** with Pi's model picker — Kilo (free), Cline (free), LLM7 (free), TokenRouter (1 free model), ZenMux (paid), CrofAI (paid), b.ai (paid, 1 free promo model), Ollama Cloud (freemium), SambaNova (freemium), Codestral (freemium), DeepInfra (trial credit), Together AI (trial credit), Novita (paid), Routeway (paid), and more
|
|
18
18
|
|
|
19
19
|
2. **Captures Pi's built-in OpenCode and OpenRouter providers** with a free/paid toggle — OpenCode and OpenRouter are now built into Pi; pi-free adds `/toggle-opencode` and `/toggle-openrouter` so you can switch between free-only and all models without restart
|
|
20
20
|
|
|
@@ -341,7 +341,7 @@ Codestral is Mistral's code-focused model via `codestral.mistral.ai`:
|
|
|
341
341
|
|
|
342
342
|
- Free tier (Experiment plan): 2 req/min, 500K tokens/min, 1B tokens/month
|
|
343
343
|
- No credit card — phone verification only
|
|
344
|
-
- Sign up at https://console.mistral.ai/codestral
|
|
344
|
+
- Sign up at <https://console.mistral.ai/codestral>
|
|
345
345
|
|
|
346
346
|
```bash
|
|
347
347
|
export CODESTRAL_API_KEY="..."
|
|
@@ -363,7 +363,7 @@ LLM7 routes across multiple providers through a single OpenAI-compatible endpoin
|
|
|
363
363
|
|
|
364
364
|
- Free tier: default/fast selectors, 100 req/hr, 20 req/min
|
|
365
365
|
- No credit card required
|
|
366
|
-
- Get free token at https://token.llm7.io
|
|
366
|
+
- Get free token at <https://token.llm7.io/>
|
|
367
367
|
|
|
368
368
|
```bash
|
|
369
369
|
export LLM7_API_KEY="..."
|
|
@@ -404,6 +404,34 @@ Fast inference on custom RDU hardware:
|
|
|
404
404
|
export SAMBANOVA_API_KEY="..."
|
|
405
405
|
```
|
|
406
406
|
|
|
407
|
+
### b.ai (paid gateway with 1 free promo model)
|
|
408
|
+
|
|
409
|
+
OpenAI-compatible gateway at `api.b.ai/v1` providing access to 29 frontier models:
|
|
410
|
+
|
|
411
|
+
- **Anthropic**: Claude Opus 4.5–4.8, Claude Sonnet 4.5–4.6, Claude Haiku 4.5
|
|
412
|
+
- **OpenAI**: GPT-5.5, GPT-5.5 Instant, GPT-5.4, GPT-5.4 Pro/Mini/Nano, GPT-5.2, GPT-5 Mini/Nano
|
|
413
|
+
- **Google**: Gemini 3.1 Pro, Gemini 3 Flash, Gemini 3.5 Flash
|
|
414
|
+
- **DeepSeek**: V4 Pro, V4 Flash, V3.2
|
|
415
|
+
- **GLM**: GLM-5.x family
|
|
416
|
+
- **Other**: Kimi K2.5, Qwen 3.6-27B, MiniMax M3 / M2.7
|
|
417
|
+
|
|
418
|
+
Currently advertises `MiniMax-M3` as a limited-time free promotional model. All other models are paid — they're visible by default (toggle with `/toggle-bai` to show free-only).
|
|
419
|
+
|
|
420
|
+
```bash
|
|
421
|
+
export BAI_API_KEY="sk-..."
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
Or add to `~/.pi/free.json`:
|
|
425
|
+
|
|
426
|
+
```json
|
|
427
|
+
{
|
|
428
|
+
"bai_api_key": "sk-...",
|
|
429
|
+
"bai_show_paid": true
|
|
430
|
+
}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
Get a key at <https://b.ai/>.
|
|
434
|
+
|
|
407
435
|
---
|
|
408
436
|
|
|
409
437
|
## Slash Commands
|
|
@@ -426,6 +454,7 @@ Each provider has toggle commands to switch between free and all models:
|
|
|
426
454
|
| `/toggle-deepinfra` | Toggle DeepInfra (💳 trial credit) |
|
|
427
455
|
| `/toggle-together` | Toggle Together AI (💳 trial credit) |
|
|
428
456
|
| `/toggle-sambanova` | Toggle SambaNova (🔄 freemium) |
|
|
457
|
+
| `/toggle-bai` | Toggle b.ai (💳 paid — 1 free promo model) |
|
|
429
458
|
| `/toggle-llm7` | Toggle LLM7 (✅ free gateway) |
|
|
430
459
|
| `/toggle-zenmux` | Toggle ZenMux (💳 paid) |
|
|
431
460
|
| `/toggle-crofai` | Toggle CrofAI (💳 paid) |
|
|
@@ -443,7 +472,6 @@ Each provider has toggle commands to switch between free and all models:
|
|
|
443
472
|
- **For 🔧 dynamic API providers**: Filters the model list when you have an API key configured
|
|
444
473
|
- **Persists your preference** to `~/.pi/free.json` for next startup
|
|
445
474
|
|
|
446
|
-
|
|
447
475
|
### Probe Commands (Health Check)
|
|
448
476
|
|
|
449
477
|
Test models for errors and auto-hide broken ones:
|
package/banner.svg
CHANGED
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
<text x="20" y="70" font-family="system-ui, sans-serif" font-size="11" fill="#8b9aaa">Ollama Cloud · SambaNova</text>
|
|
97
97
|
<text x="20" y="90" font-family="system-ui, sans-serif" font-size="11" fill="#8b9aaa">Codestral · LLM7 · Novita</text>
|
|
98
98
|
<text x="20" y="110" font-family="system-ui, sans-serif" font-size="11" fill="#8b9aaa">ZenMux · CrofAI · DeepInfra</text>
|
|
99
|
-
<text x="20" y="130" font-family="system-ui, sans-serif" font-size="11" fill="#8b9aaa">Together · TokenRouter ·
|
|
99
|
+
<text x="20" y="130" font-family="system-ui, sans-serif" font-size="11" fill="#8b9aaa">Together · TokenRouter · b.ai</text>
|
|
100
100
|
</g>
|
|
101
101
|
|
|
102
102
|
<g transform="translate(970, 55)">
|