pi-free 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +143 -2
- package/README.md +261 -129
- package/config.ts +28 -4
- package/constants.ts +1 -0
- package/index.ts +148 -186
- package/lib/built-in-toggle.ts +187 -0
- package/lib/toggle-state.ts +86 -0
- package/lib/util.ts +256 -256
- package/package.json +67 -67
- package/provider-failover/benchmark-lookup.ts +637 -247
- package/provider-helper.ts +9 -8
- package/providers/cline/cline-models.ts +129 -128
- package/providers/cline/cline.ts +284 -300
- package/providers/cloudflare/cloudflare.ts +292 -134
- package/providers/dynamic-built-in/index.ts +433 -513
- package/providers/kilo/kilo-models.ts +2 -1
- package/providers/kilo/kilo.ts +5 -5
- package/providers/modal/modal.ts +47 -44
- package/providers/nvidia/nvidia.ts +297 -34
- package/providers/ollama/ollama.ts +280 -172
package/README.md
CHANGED
|
@@ -6,21 +6,23 @@ Free AI model providers for [Pi](https://pi.dev). Access **free models** from mu
|
|
|
6
6
|
|
|
7
7
|
## What does pi-free do
|
|
8
8
|
|
|
9
|
-
**pi-free is a Pi extension that unlocks free AI models from
|
|
9
|
+
**pi-free is a Pi extension that unlocks free AI models from multiple providers.**
|
|
10
10
|
|
|
11
11
|
When you install pi-free, it:
|
|
12
12
|
|
|
13
|
-
1. **Registers
|
|
13
|
+
1. **Registers free-tier providers** with Pi's model picker — Kilo, Cline, NVIDIA, Cloudflare, Modal, Ollama Cloud, and more
|
|
14
14
|
|
|
15
|
-
2. **
|
|
15
|
+
2. **Fetches models dynamically** from provider APIs — Cloudflare Workers AI (30+ models), NVIDIA NIM, and Pi's built-in providers (Mistral, Groq, Cerebras, xAI, Hugging Face, OpenRouter) when API keys are configured
|
|
16
16
|
|
|
17
|
-
3. **
|
|
17
|
+
3. **Filters to show only free models by default** for providers that expose pricing — You see only the models that cost $0 to use. Paid models are hidden until you explicitly toggle them on.
|
|
18
18
|
|
|
19
|
-
4. **
|
|
19
|
+
4. **Provides per-provider toggle commands** — Run `/toggle-{provider}` (e.g., `/toggle-kilo`, `/toggle-opencode`) to switch between free-only mode and showing all models including paid ones. Changes apply immediately and your preference is saved for the next Pi restart.
|
|
20
20
|
|
|
21
|
-
5. **
|
|
21
|
+
5. **Handles authentication for you** — OAuth flows (Kilo, Cline) open your browser automatically; API keys are read from `~/.pi/free.json` or environment variables
|
|
22
22
|
|
|
23
|
-
6. **
|
|
23
|
+
6. **Adds Coding Index scores** — Model names include a coding benchmark score (CI: 45.2) to help you pick capable coding models at a glance
|
|
24
|
+
|
|
25
|
+
7. **Persists your preferences** — Your toggle choices (free vs all models) are saved to `~/.pi/free.json` and remembered across Pi restarts
|
|
24
26
|
|
|
25
27
|
---
|
|
26
28
|
|
|
@@ -39,24 +41,26 @@ Start Pi and press `Ctrl+L` to open the model picker.
|
|
|
39
41
|
Free models are shown by default — look for the provider prefixes:
|
|
40
42
|
|
|
41
43
|
**✅ Offers Free Models (no usage limits, no payment required):**
|
|
42
|
-
|
|
44
|
+
|
|
45
|
+
- `opencode/` — OpenCode models (no setup required; toggle with `/toggle-opencode`)
|
|
43
46
|
- `kilo/` — Kilo models (free models available immediately, more after `/login kilo`)
|
|
44
47
|
- `openrouter/` — OpenRouter models (free account required)
|
|
45
48
|
- `cline/` — Cline models (run `/login cline` to use)
|
|
46
49
|
|
|
47
50
|
**🔄 Freemium (free tier with limits, then paid):**
|
|
51
|
+
|
|
48
52
|
- `nvidia/` — NVIDIA NIM models (1,000 free requests/month, then credits)
|
|
49
53
|
- `cloudflare/` — Cloudflare Workers AI (10K Neurons/day free tier, then $0.011/1K Neurons)
|
|
50
54
|
- `modal/` — GLM-5.1 FP8 via Modal (free promotional period until April 30, 2026)
|
|
51
|
-
- `ollama/` — Ollama Cloud models (usage-based free tier, resets every 5 hours + 7 days)
|
|
55
|
+
- `ollama-cloud/` — Ollama Cloud models (usage-based free tier, resets every 5 hours + 7 days)
|
|
52
56
|
|
|
53
|
-
**🔧 Dynamic API Providers (
|
|
54
|
-
- `mistral/` — Mistral models (free models via API when `MISTRAL_API_KEY` set)
|
|
55
|
-
- `groq/` — Groq models (free models via API when `GROQ_API_KEY` set)
|
|
56
|
-
- `cerebras/` — Cerebras models (free models via API when `CEREBRAS_API_KEY` set)
|
|
57
|
+
**🔧 Dynamic API Providers (fetched when API key configured):**
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
- `
|
|
59
|
+
- `mistral/` — Mistral models (when `MISTRAL_API_KEY` set)
|
|
60
|
+
- `groq/` — Groq models (when `GROQ_API_KEY` set)
|
|
61
|
+
- `cerebras/` — Cerebras models (when `CEREBRAS_API_KEY` set)
|
|
62
|
+
- `xai/` — xAI models (when `XAI_API_KEY` set)
|
|
63
|
+
- `huggingface/` — Hugging Face models (when `HF_TOKEN` set)
|
|
60
64
|
|
|
61
65
|
**Note:** Fireworks is now a [built-in Pi provider](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/CHANGELOG.md#0681---2026-04-22) — no extension needed. Set `FIREWORKS_API_KEY` to use it directly.
|
|
62
66
|
|
|
@@ -65,27 +69,34 @@ Free models are shown by default — look for the provider prefixes:
|
|
|
65
69
|
Want to see paid models too? Run the toggle command for your provider:
|
|
66
70
|
|
|
67
71
|
```
|
|
68
|
-
/
|
|
69
|
-
/kilo
|
|
70
|
-
/openrouter
|
|
71
|
-
/cline
|
|
72
|
-
/
|
|
73
|
-
/
|
|
74
|
-
/
|
|
72
|
+
/toggle-opencode # Toggle OpenCode (✅ offers free models)
|
|
73
|
+
/toggle-kilo # Toggle Kilo (✅ offers free models)
|
|
74
|
+
/toggle-openrouter # Toggle OpenRouter (✅ offers free models)
|
|
75
|
+
/toggle-cline # Toggle Cline (✅ offers free models)
|
|
76
|
+
/toggle-nvidia # Toggle NVIDIA (🔄 freemium)
|
|
77
|
+
/toggle-cloudflare # Toggle Cloudflare (🔄 freemium)
|
|
78
|
+
/toggle-ollama # Toggle Ollama Cloud (🔄 freemium)
|
|
79
|
+
/toggle-mistral # Toggle Mistral (🔧 dynamic - needs API key)
|
|
80
|
+
/toggle-groq # Toggle Groq (🔧 dynamic - needs API key)
|
|
81
|
+
/toggle-cerebras # Toggle Cerebras (🔧 dynamic - needs API key)
|
|
75
82
|
```
|
|
76
83
|
|
|
77
84
|
**Notes:**
|
|
78
|
-
- **Toggle commands are mainly for ✅ Offers Free Models providers** — to switch between "free models only" vs "show paid models too"
|
|
79
|
-
- **🔄 Freemium providers** (NVIDIA, Cloudflare, Ollama, Modal) show all models by default — you manage your usage limits via their dashboards
|
|
80
|
-
- **💳 Paid-only providers** (Go) have no toggle since all models require payment
|
|
81
85
|
|
|
82
|
-
|
|
86
|
+
- **Toggle commands are mainly for ✅ and 🔄 providers** — to switch between "free models only" vs "show paid models too"
|
|
87
|
+
- **🔧 Dynamic providers** show all fetched models by default — the toggle filters the list when you have an API key configured
|
|
88
|
+
- **Freemium providers** show all models by default; you manage your usage limits via their dashboards
|
|
89
|
+
|
|
90
|
+
You'll see a notification like: `opencode: showing free models` or `opencode: showing all models`
|
|
91
|
+
|
|
92
|
+
**Note:** Built-in provider toggles such as OpenCode and OpenRouter update in the current session — no restart needed.
|
|
83
93
|
|
|
84
94
|
### 4. Add API keys for more providers (optional)
|
|
85
95
|
|
|
86
96
|
Some providers require a free account or API key.
|
|
87
97
|
|
|
88
98
|
**The first time you run Pi after installing this extension, a config file is automatically created:**
|
|
99
|
+
|
|
89
100
|
- **Linux/Mac:** `~/.pi/free.json`
|
|
90
101
|
- **Windows:** `%USERPROFILE%\.pi\free.json`
|
|
91
102
|
|
|
@@ -96,74 +107,109 @@ Add your API keys to this file:
|
|
|
96
107
|
"openrouter_api_key": "sk-or-v1-...",
|
|
97
108
|
"nvidia_api_key": "nvapi-...",
|
|
98
109
|
"cloudflare_api_token": "...",
|
|
110
|
+
"cloudflare_account_id": "...",
|
|
99
111
|
"ollama_api_key": "...",
|
|
100
112
|
"mistral_api_key": "...",
|
|
101
113
|
"modal_api_key": "sk-modal-..."
|
|
102
114
|
}
|
|
103
115
|
```
|
|
104
116
|
|
|
105
|
-
**Note:** Fireworks is now a [built-in Pi provider](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/CHANGELOG.md#0681---2026-04-22) — no extension needed. Set `FIREWORKS_API_KEY` to use it directly.
|
|
106
|
-
|
|
107
117
|
Or set environment variables instead (same names, uppercase: `OPENROUTER_API_KEY`, `NVIDIA_API_KEY`, etc.)
|
|
108
118
|
|
|
119
|
+
If `~/.pi/free.json` contains invalid JSON, pi-free now logs the parse error to `~/.pi/free.log` so you can fix the file quickly.
|
|
120
|
+
|
|
109
121
|
See the [Providers That Need Authentication](#providers-that-need-authentication) section below for detailed setup instructions per provider.
|
|
110
122
|
|
|
111
123
|
### 5. Quick commands reference
|
|
112
124
|
|
|
113
|
-
| Command
|
|
114
|
-
|
|
115
|
-
| `/{provider}
|
|
116
|
-
| `/
|
|
117
|
-
| `/login
|
|
118
|
-
| `/
|
|
119
|
-
| `/logout
|
|
125
|
+
| Command | What it does |
|
|
126
|
+
| -------------------- | --------------------------------------------------------- |
|
|
127
|
+
| `/toggle-{provider}` | Switch between free-only and all models for that provider |
|
|
128
|
+
| `/free-providers` | Show free/paid model counts for all providers |
|
|
129
|
+
| `/login kilo` | Start OAuth flow for Kilo |
|
|
130
|
+
| `/login cline` | Start OAuth flow for Cline |
|
|
131
|
+
| `/logout kilo` | Clear Kilo OAuth credentials |
|
|
132
|
+
| `/logout cline` | Clear Cline OAuth credentials |
|
|
120
133
|
|
|
121
134
|
---
|
|
122
135
|
|
|
123
|
-
##
|
|
136
|
+
## Features
|
|
124
137
|
|
|
125
|
-
###
|
|
138
|
+
### 🔍 NVIDIA: Pre-Filtering + 404 Detection
|
|
126
139
|
|
|
127
|
-
|
|
140
|
+
NVIDIA's API lists 130+ models, but 57+ return 404 "Function not found" when you try to use them. pi-free solves this:
|
|
128
141
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
4. Start chatting
|
|
142
|
+
- **57 known 404s hard-filtered** — Discontinued models (`dbrx-instruct`, `codellama-70b`), embedding models mislabeled as chat-capable (`nv-embed-*`), and stale catalog entries are silently excluded
|
|
143
|
+
- **Auto-discovery from NVIDIA's API** — Queries `integrate.api.nvidia.com/v1/models` directly for the ground-truth list
|
|
144
|
+
- **`/probe-nvidia` command** — On-demand health check: tests every model with a minimal request, auto-hides new 404s, and re-registers immediately
|
|
133
145
|
|
|
134
|
-
|
|
146
|
+
### 🌩️ Cloudflare: Dynamic Model Discovery
|
|
135
147
|
|
|
136
|
-
|
|
148
|
+
Cloudflare Workers AI offers 80+ models including embeddings, image generation, and speech. pi-free automatically finds the chat models:
|
|
137
149
|
|
|
138
|
-
|
|
150
|
+
- **Live API fetching** — Calls Cloudflare's `/ai/models` endpoint on startup to get the current catalog
|
|
151
|
+
- **Smart filtering** — Automatically excludes embeddings (`bge-*`, `embed-*`), image generation (`flux`, `stable-diffusion`), speech (`whisper`, `aura-*`), translation, and vision-only models via regex patterns
|
|
152
|
+
- **Metadata inference** — Detects vision support (`llava`, `vision` in name), reasoning (`r1`, `thinking`, `qwq`), context windows, and estimated costs from model IDs
|
|
153
|
+
- **Expanding fallback** — 18 hand-curated models (Kimi K2.6, GPT-OSS, Qwen 2.5 Coder, QwQ, Llama 3.2 Vision, etc.) if API is unreachable
|
|
139
154
|
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
export OLLAMA_API_KEY="..."
|
|
143
|
-
export OLLAMA_SHOW_PAID=true
|
|
144
|
-
```
|
|
155
|
+
### 🎯 Coding Index (CI) Scores
|
|
145
156
|
|
|
146
|
-
|
|
147
|
-
```json
|
|
148
|
-
{
|
|
149
|
-
"ollama_api_key": "YOUR_KEY",
|
|
150
|
-
"ollama_show_paid": true
|
|
151
|
-
}
|
|
152
|
-
```
|
|
157
|
+
Every model shows a **Coding Index score** (e.g., `CI: 52.3`) in the model picker:
|
|
153
158
|
|
|
154
|
-
**
|
|
159
|
+
- **Benchmark-based** — Scores derived from Artificial Analysis coding benchmarks (HumanEval, MBPP, etc.)
|
|
160
|
+
- **Quality indicator** — Higher scores = better coding performance
|
|
161
|
+
- **All providers** — Applied to every model from every provider (NVIDIA, Cloudflare, Mistral, Groq, etc.)
|
|
155
162
|
|
|
156
|
-
|
|
163
|
+
**Missing CI scores?** Provider model IDs often don't match benchmark database keys exactly. pi-free applies provider-specific normalization to improve matching:
|
|
157
164
|
|
|
158
|
-
|
|
165
|
+
| Provider | Normalization Applied |
|
|
166
|
+
| -------------- | ------------------------------------------------------------------ |
|
|
167
|
+
| **NVIDIA** | Strips vendor prefixes (`meta/`, `mistralai/`, `microsoft/`, etc.) |
|
|
168
|
+
| **Cloudflare** | Strips `@cf/namespace/` prefixes |
|
|
169
|
+
| **Groq** | Removes `-versatile` and numeric suffixes (`-32768`) |
|
|
170
|
+
| **Cerebras** | Normalizes `llama3.1` → `llama-3.1`, adds `instruct` suffix |
|
|
171
|
+
| **Mistral** | Strips `-latest` suffix |
|
|
172
|
+
| **Ollama** | Converts `model:tag` → `model-tag` |
|
|
159
173
|
|
|
160
|
-
|
|
174
|
+
**Debug missing scores:** Check `~/.pi/modelmatch.log` to see which models matched/didn't match and what normalization was applied.
|
|
175
|
+
|
|
176
|
+
### 🔄 Free/Paid Model Toggling
|
|
177
|
+
|
|
178
|
+
Providers have different pricing models. pi-free handles them all:
|
|
179
|
+
|
|
180
|
+
- **Free-only by default** — Shows only zero-cost models initially
|
|
181
|
+
- **Per-provider toggles** — Run `/toggle-{provider}` to switch between "free only" vs "all models"
|
|
182
|
+
- **Persists across sessions** — Your preference is saved to `~/.pi/free.json`
|
|
183
|
+
- **Instant updates** — Changes apply immediately; no Pi restart needed
|
|
184
|
+
|
|
185
|
+
**Provider types:**
|
|
161
186
|
|
|
162
|
-
|
|
187
|
+
- ✅ **Free providers** (OpenCode, Kilo, Cline) — Toggle between free-only vs paid models
|
|
188
|
+
- 🔄 **Freemium** (NVIDIA, Cloudflare, Modal, Ollama) — Free tier with limits, toggle shows all
|
|
189
|
+
- 🔧 **Dynamic API** (Mistral, Groq, Cerebras, xAI) — Fetched when API key configured, toggle filters the list
|
|
190
|
+
|
|
191
|
+
### 🔐 OAuth + API Key Handling
|
|
192
|
+
|
|
193
|
+
Authentication is handled automatically:
|
|
194
|
+
|
|
195
|
+
- **OAuth flows** — `/login kilo` and `/login cline` open your browser, wait for authorization, and complete automatically
|
|
196
|
+
- **Multiple auth sources** — API keys read from `~/.pi/free.json`, environment variables, or standard Pi auth files (`~/.pi/agent/auth.json`)
|
|
197
|
+
- **Smart fallbacks** — New env var names (e.g., `CF_API_TOKEN`) with legacy support (`CLOUDFLARE_API_TOKEN`)
|
|
163
198
|
|
|
164
199
|
---
|
|
165
200
|
|
|
166
|
-
|
|
201
|
+
## Using Free Models (No Setup Required)
|
|
202
|
+
|
|
203
|
+
### OpenCode
|
|
204
|
+
|
|
205
|
+
Works immediately with zero setup:
|
|
206
|
+
|
|
207
|
+
1. Press `Ctrl+L`
|
|
208
|
+
2. Search for `opencode/`
|
|
209
|
+
3. Pick any model (e.g., `opencode/big-pickle`)
|
|
210
|
+
4. Start chatting
|
|
211
|
+
|
|
212
|
+
No account, no API key, no OAuth. Run `/toggle-opencode` to switch between free and paid OpenCode models.
|
|
167
213
|
|
|
168
214
|
### Kilo (free models, more after login)
|
|
169
215
|
|
|
@@ -174,6 +220,7 @@ Kilo shows free models immediately. To unlock all models, authenticate with Kilo
|
|
|
174
220
|
```
|
|
175
221
|
|
|
176
222
|
This command will:
|
|
223
|
+
|
|
177
224
|
1. Open your browser to Kilo's authorization page
|
|
178
225
|
2. Show a device code in Pi's UI
|
|
179
226
|
3. Wait for you to authorize in the browser
|
|
@@ -181,52 +228,83 @@ This command will:
|
|
|
181
228
|
|
|
182
229
|
- No credit card required
|
|
183
230
|
- Free tier: 200 requests/hour
|
|
184
|
-
- After login, run `/kilo
|
|
231
|
+
- After login, run `/toggle-kilo` to switch between free-only and all models
|
|
232
|
+
|
|
233
|
+
### Cline (free account)
|
|
234
|
+
|
|
235
|
+
Cline models appear immediately in the model picker. To use them, authenticate with Cline's free account:
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
/login cline
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
This command will:
|
|
242
|
+
|
|
243
|
+
1. Open your browser to Cline's sign-in page
|
|
244
|
+
2. Wait for you to complete sign-in
|
|
245
|
+
3. Automatically complete login once approved
|
|
246
|
+
|
|
247
|
+
- Free account required (no credit card)
|
|
248
|
+
- Uses local ports 48801-48811 for OAuth callback
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Providers That Need Authentication
|
|
253
|
+
|
|
254
|
+
Some providers require a free account or API key to access their free tiers.
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
### 🆓 Free Providers
|
|
185
259
|
|
|
186
260
|
### OpenRouter (free models available)
|
|
187
261
|
|
|
188
262
|
Get a free API key at [openrouter.ai/keys](https://openrouter.ai/keys), then either:
|
|
189
263
|
|
|
190
264
|
**Option A: Environment variable**
|
|
265
|
+
|
|
191
266
|
```bash
|
|
192
267
|
export OPENROUTER_API_KEY="sk-or-v1-..."
|
|
193
268
|
```
|
|
194
269
|
|
|
195
270
|
**Option B: Config file** (`~/.pi/free.json`)
|
|
271
|
+
|
|
196
272
|
```json
|
|
197
273
|
{
|
|
198
274
|
"openrouter_api_key": "sk-or-v1-..."
|
|
199
275
|
}
|
|
200
276
|
```
|
|
201
277
|
|
|
202
|
-
Then
|
|
203
|
-
```
|
|
204
|
-
/openrouter-all # Show all models (free + paid)
|
|
205
|
-
```
|
|
278
|
+
Then use `/toggle-openrouter` to switch between free-only and all models.
|
|
206
279
|
|
|
207
280
|
### NVIDIA NIM (Free Credits System)
|
|
208
281
|
|
|
209
282
|
NVIDIA provides **free monthly credits** (1000 requests/month) at [build.nvidia.com](https://build.nvidia.com).
|
|
210
283
|
|
|
211
284
|
**Important:** Models have different "costs" per token:
|
|
285
|
+
|
|
212
286
|
- **Zero-cost models**: Don't consume your credit balance (shown by default)
|
|
213
287
|
- **Credit-costing models**: Consume credits faster (hidden by default)
|
|
214
288
|
|
|
215
289
|
Get your API key and optionally enable all models:
|
|
216
290
|
|
|
217
291
|
**Option A: Show only free models (default)**
|
|
292
|
+
|
|
218
293
|
```bash
|
|
219
294
|
export NVIDIA_API_KEY="nvapi-..."
|
|
220
295
|
```
|
|
296
|
+
|
|
221
297
|
Uses only zero-cost models → your 1000 credits last the full month
|
|
222
298
|
|
|
223
299
|
**Option B: Show all models (uses credits faster)**
|
|
300
|
+
|
|
224
301
|
```bash
|
|
225
302
|
export NVIDIA_API_KEY="nvapi-..."
|
|
226
303
|
export NVIDIA_SHOW_PAID=true
|
|
227
304
|
```
|
|
228
305
|
|
|
229
306
|
Or in `~/.pi/free.json`:
|
|
307
|
+
|
|
230
308
|
```json
|
|
231
309
|
{
|
|
232
310
|
"nvidia_api_key": "nvapi-...",
|
|
@@ -234,58 +312,49 @@ Or in `~/.pi/free.json`:
|
|
|
234
312
|
}
|
|
235
313
|
```
|
|
236
314
|
|
|
237
|
-
Toggle anytime with `/nvidia
|
|
315
|
+
Toggle anytime with `/toggle-nvidia`
|
|
238
316
|
|
|
239
317
|
### Cloudflare Workers AI (10K Neurons/day Free Tier)
|
|
240
318
|
|
|
241
|
-
Cloudflare provides **
|
|
319
|
+
Cloudflare provides **30+ text generation models** (auto-discovered from their API) with a generous free tier:
|
|
320
|
+
|
|
242
321
|
- **10,000 Neurons per day FREE** (resets daily at 00:00 UTC)
|
|
243
322
|
- **$0.011 per 1,000 Neurons** beyond the free allocation
|
|
323
|
+
- **Models auto-fetched** — All available chat models are discovered dynamically from Cloudflare's API
|
|
244
324
|
|
|
245
325
|
Get your API token at [dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens):
|
|
326
|
+
|
|
246
327
|
1. Create a token with "Cloudflare AI" → "Read" permission
|
|
247
328
|
2. Or use "My Account" → "Read" for broader access
|
|
248
329
|
|
|
249
330
|
**Setup:**
|
|
250
|
-
```bash
|
|
251
|
-
export CLOUDFLARE_API_TOKEN="your_token_here"
|
|
252
|
-
```
|
|
253
331
|
|
|
254
|
-
The account ID is automatically derived from your token. Optionally, you can also set:
|
|
255
332
|
```bash
|
|
256
|
-
|
|
257
|
-
|
|
333
|
+
# New short env vars (recommended)
|
|
334
|
+
export CF_API_TOKEN="your_token_here"
|
|
335
|
+
export CF_ACCOUNT_ID="your_account_id"
|
|
258
336
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
### Cline (free account)
|
|
264
|
-
|
|
265
|
-
Cline models appear immediately in the model picker. To use them, authenticate with Cline's free account:
|
|
266
|
-
|
|
267
|
-
```
|
|
268
|
-
/login cline
|
|
337
|
+
# Legacy env vars also work
|
|
338
|
+
export CLOUDFLARE_API_TOKEN="your_token_here"
|
|
339
|
+
export CLOUDFLARE_ACCOUNT_ID="your_account_id"
|
|
269
340
|
```
|
|
270
341
|
|
|
271
|
-
|
|
272
|
-
1. Open your browser to Cline's sign-in page
|
|
273
|
-
2. Wait for you to complete sign-in
|
|
274
|
-
3. Automatically complete login once approved
|
|
342
|
+
**Models available:** Llama 4/3.x, Mistral Small 3.1, DeepSeek R1, Gemma 4, Kimi K2.5/2.6, Qwen 3/2.5, OpenAI GPT-OSS, and more.
|
|
275
343
|
|
|
276
|
-
|
|
277
|
-
- Uses local ports 48801-48811 for OAuth callback
|
|
344
|
+
Toggle with `/toggle-cloudflare`
|
|
278
345
|
|
|
279
346
|
### Modal (GLM-5.1 FP8 — free promotional period until April 30, 2026)
|
|
280
347
|
|
|
281
348
|
Modal hosts GLM-5.1 FP8 with a free promotional period. Get an API key at [modal.com](https://modal.com), then:
|
|
282
349
|
|
|
283
350
|
**Option A: Environment variable**
|
|
351
|
+
|
|
284
352
|
```bash
|
|
285
353
|
export MODAL_API_KEY="sk-modal-..."
|
|
286
354
|
```
|
|
287
355
|
|
|
288
356
|
**Option B: Config file** (`~/.pi/free.json`)
|
|
357
|
+
|
|
289
358
|
```json
|
|
290
359
|
{
|
|
291
360
|
"modal_api_key": "sk-modal-..."
|
|
@@ -295,41 +364,42 @@ export MODAL_API_KEY="sk-modal-..."
|
|
|
295
364
|
Then select a `modal/` model in the model picker.
|
|
296
365
|
|
|
297
366
|
**Details:**
|
|
367
|
+
|
|
298
368
|
- Free promotional period until April 30, 2026
|
|
299
369
|
- Model: GLM-5.1 FP8 (128k context, 16k max output)
|
|
300
370
|
- No credit card required during the promotional period
|
|
301
371
|
|
|
302
|
-
###
|
|
372
|
+
### Ollama Cloud
|
|
303
373
|
|
|
304
|
-
|
|
374
|
+
Get an API key from [ollama.com/settings/keys](https://ollama.com/settings/keys), then:
|
|
375
|
+
|
|
376
|
+
**Option A: Environment variable**
|
|
305
377
|
|
|
306
378
|
```bash
|
|
307
|
-
export
|
|
379
|
+
export OLLAMA_API_KEY="..."
|
|
380
|
+
export OLLAMA_SHOW_PAID=true
|
|
308
381
|
```
|
|
309
382
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
### 💳 Paid-Only Providers
|
|
313
|
-
|
|
314
|
-
> **⚠️ These providers have no free tier. All usage incurs costs.**
|
|
383
|
+
**Option B: Config file** (`~/.pi/free.json`)
|
|
315
384
|
|
|
316
|
-
|
|
385
|
+
```json
|
|
386
|
+
{
|
|
387
|
+
"ollama_api_key": "YOUR_KEY",
|
|
388
|
+
"ollama_show_paid": true
|
|
389
|
+
}
|
|
390
|
+
```
|
|
317
391
|
|
|
318
|
-
|
|
392
|
+
**Note:** Ollama requires `OLLAMA_SHOW_PAID=true` because they have usage limits on their cloud API.
|
|
319
393
|
|
|
320
|
-
|
|
394
|
+
Free tier resets every 5 hours + 7 days.
|
|
321
395
|
|
|
322
|
-
|
|
323
|
-
- GLM-5
|
|
324
|
-
- Kimi K2.5
|
|
325
|
-
- MiMo-V2-Pro
|
|
326
|
-
- MiMo-V2-Omni
|
|
327
|
-
- MiniMax M2.7
|
|
328
|
-
- MiniMax M2.5
|
|
396
|
+
### Mistral (free API key)
|
|
329
397
|
|
|
330
|
-
|
|
398
|
+
Add API key to `~/.pi/free.json` or environment variables:
|
|
331
399
|
|
|
332
|
-
|
|
400
|
+
```bash
|
|
401
|
+
export MISTRAL_API_KEY="..."
|
|
402
|
+
```
|
|
333
403
|
|
|
334
404
|
---
|
|
335
405
|
|
|
@@ -337,23 +407,45 @@ Toggle with `/go-toggle`.
|
|
|
337
407
|
|
|
338
408
|
Each provider has toggle commands to switch between free and all models:
|
|
339
409
|
|
|
340
|
-
| Command
|
|
341
|
-
|
|
342
|
-
| `/
|
|
343
|
-
| `/kilo
|
|
344
|
-
| `/openrouter
|
|
345
|
-
| `/cline
|
|
346
|
-
| `/
|
|
347
|
-
| `/
|
|
348
|
-
| `/
|
|
410
|
+
| Command | Action |
|
|
411
|
+
| -------------------- | ---------------------------------------------------- |
|
|
412
|
+
| `/toggle-opencode` | Toggle between free/all OpenCode models |
|
|
413
|
+
| `/toggle-kilo` | Toggle between free/all Kilo models |
|
|
414
|
+
| `/toggle-openrouter` | Toggle between free/all OpenRouter models |
|
|
415
|
+
| `/toggle-cline` | Toggle between free/all Cline models |
|
|
416
|
+
| `/toggle-nvidia` | Toggle between free/all NVIDIA models |
|
|
417
|
+
| `/toggle-cloudflare` | Toggle between free/all Cloudflare models |
|
|
418
|
+
| `/toggle-ollama` | Toggle between free/all Ollama Cloud models |
|
|
419
|
+
| `/toggle-mistral` | Toggle between free/all Mistral models (🔧 dynamic) |
|
|
420
|
+
| `/toggle-groq` | Toggle between free/all Groq models (🔧 dynamic) |
|
|
421
|
+
| `/toggle-cerebras` | Toggle between free/all Cerebras models (🔧 dynamic) |
|
|
349
422
|
|
|
350
423
|
**The toggle command:**
|
|
351
|
-
|
|
352
|
-
- **For
|
|
424
|
+
|
|
425
|
+
- **For ✅ free providers**: Switches between showing only free models vs. all available models (including paid)
|
|
426
|
+
- **For 🔄 freemium providers**: Shows all models by default; toggle switches between filtered and full list
|
|
427
|
+
- **For 🔧 dynamic API providers**: Filters the model list when you have an API key configured
|
|
353
428
|
- **Persists your preference** to `~/.pi/free.json` for next startup
|
|
354
|
-
- Shows a notification: "
|
|
429
|
+
- Shows a notification: "opencode: showing free models" or "opencode: showing all models"
|
|
430
|
+
|
|
431
|
+
### Probe Commands (Health Check)
|
|
432
|
+
|
|
433
|
+
Test models for 404/403 errors and auto-hide broken ones:
|
|
434
|
+
|
|
435
|
+
| Command | What it does |
|
|
436
|
+
| --------------- | ----------------------------------------------------------- |
|
|
437
|
+
| `/probe-nvidia` | Test all NVIDIA models, auto-hide 404s in `~/.pi/free.json` |
|
|
438
|
+
| `/probe-ollama` | Test all Ollama models, auto-hide 403s in `~/.pi/free.json` |
|
|
439
|
+
|
|
440
|
+
**How it works:**
|
|
441
|
+
|
|
442
|
+
1. Sends a minimal test request to every model
|
|
443
|
+
2. Identifies broken models (404/403 responses)
|
|
444
|
+
3. **Auto-hides** broken models in your config (provider-scoped: `"ollama/kimi-k2.6"`)
|
|
445
|
+
4. Re-registers the provider so broken models disappear immediately
|
|
446
|
+
5. Hidden models persist across Pi restarts
|
|
355
447
|
|
|
356
|
-
|
|
448
|
+
Use these when you see models that appear in the picker but fail when you try to use them.
|
|
357
449
|
|
|
358
450
|
---
|
|
359
451
|
|
|
@@ -365,9 +457,10 @@ Create `~/.pi/free.json` in your home directory:
|
|
|
365
457
|
{
|
|
366
458
|
"openrouter_api_key": "YOUR_OPENROUTER_KEY",
|
|
367
459
|
"nvidia_api_key": "YOUR_NVIDIA_KEY",
|
|
460
|
+
"cloudflare_api_token": "YOUR_CLOUDFLARE_TOKEN",
|
|
461
|
+
"cloudflare_account_id": "YOUR_ACCOUNT_ID",
|
|
368
462
|
"mistral_api_key": "YOUR_MISTRAL_KEY",
|
|
369
|
-
"opencode_api_key": "
|
|
370
|
-
"opencode_go_api_key": "YOUR_GO_KEY",
|
|
463
|
+
"opencode_api_key": "YOUR_OPENCODE_KEY",
|
|
371
464
|
"ollama_api_key": "YOUR_OLLAMA_KEY",
|
|
372
465
|
"ollama_show_paid": true,
|
|
373
466
|
"modal_api_key": "YOUR_MODAL_KEY",
|
|
@@ -386,12 +479,12 @@ export NVIDIA_API_KEY="..."
|
|
|
386
479
|
|
|
387
480
|
## Logging & Debugging
|
|
388
481
|
|
|
389
|
-
pi-free
|
|
482
|
+
pi-free writes extension logs to:
|
|
390
483
|
|
|
391
484
|
- **Windows:** `%USERPROFILE%\.pi\free.log`
|
|
392
485
|
- **Linux/macOS:** `~/.pi/free.log`
|
|
393
486
|
|
|
394
|
-
|
|
487
|
+
If the extension fails to read `~/.pi/free.json`, check this log first — config parse errors are written here.
|
|
395
488
|
|
|
396
489
|
```bash
|
|
397
490
|
# Console log verbosity (default: error)
|
|
@@ -407,6 +500,45 @@ PI_FREE_LOG_PATH=/tmp/pi-free.log
|
|
|
407
500
|
PI_FREE_FILE_LOG=false
|
|
408
501
|
```
|
|
409
502
|
|
|
503
|
+
### Model Matching Debug Log
|
|
504
|
+
|
|
505
|
+
To diagnose why some models don't show Coding Index scores, pi-free writes detailed matching diagnostics to:
|
|
506
|
+
|
|
507
|
+
- **Windows:** `%USERPROFILE%\.pi\modelmatch.log`
|
|
508
|
+
- **Linux/macOS:** `~/.pi/modelmatch.log`
|
|
509
|
+
|
|
510
|
+
**Log format:**
|
|
511
|
+
|
|
512
|
+
```
|
|
513
|
+
timestamp|provider|modelId|modelName|action|strategy|normalizedId|matchKey|codingIndex|details
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
**Example entries:**
|
|
517
|
+
|
|
518
|
+
```
|
|
519
|
+
2026-04-26T10:30:00Z|nvidia|meta/llama-3.1-405b-instruct|Llama 3.1 405B|match|provider-normalized:strip-nvidia-prefix|llama-3.1-405b-instruct|llama-3.1-instruct-405b|52.3|
|
|
520
|
+
2026-04-26T10:30:01Z|groq|llama-3.1-70b-versatile|Llama 3.1 70B Versatile|match|strip-groq-versatile|llama-3.1-70b|llama-3.1-instruct-70b|48.5|
|
|
521
|
+
2026-04-26T10:30:02Z|cloudflare|@cf/meta/llama-3.1-70b|Llama 3.1 70B|miss|all-strategies-failed|llama-3.1-70b|||
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
**Common mismatch patterns:**
|
|
525
|
+
|
|
526
|
+
- `miss` + `all-strategies-failed` = Model not in benchmark database or ID format not recognized
|
|
527
|
+
- Check `normalizedId` column to see what the lookup tried against
|
|
528
|
+
|
|
529
|
+
**View the log:**
|
|
530
|
+
|
|
531
|
+
```bash
|
|
532
|
+
# Pretty-print with column alignment
|
|
533
|
+
cat ~/.pi/modelmatch.log | column -t -s '|'
|
|
534
|
+
|
|
535
|
+
# See only misses (models without CI scores)
|
|
536
|
+
grep '|miss|' ~/.pi/modelmatch.log
|
|
537
|
+
|
|
538
|
+
# See stats for specific provider
|
|
539
|
+
grep '|nvidia|' ~/.pi/modelmatch.log | grep -c '|match|'
|
|
540
|
+
```
|
|
541
|
+
|
|
410
542
|
---
|
|
411
543
|
|
|
412
544
|
## License
|