pi-free 2.0.0 → 2.0.1
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 +37 -0
- package/README.md +393 -416
- package/config.ts +6 -2
- package/constants.ts +1 -0
- package/index.ts +6 -44
- package/lib/built-in-toggle.ts +206 -0
- package/package.json +67 -67
- package/provider-helper.ts +260 -260
- package/providers/cline/cline-models.ts +1 -1
- package/providers/cline/cline.ts +5 -7
- package/providers/dynamic-built-in/index.ts +432 -513
- package/providers/kilo/kilo.ts +5 -5
- package/providers/nvidia/nvidia.ts +1 -1
- package/providers/ollama/ollama.ts +3 -3
package/README.md
CHANGED
|
@@ -1,416 +1,393 @@
|
|
|
1
|
-
# pi-free-providers
|
|
2
|
-
|
|
3
|
-
Free AI model providers for [Pi](https://pi.dev). Access **free models** from multiple providers in one install.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## What does pi-free do
|
|
8
|
-
|
|
9
|
-
**pi-free is a Pi extension that unlocks free AI models from
|
|
10
|
-
|
|
11
|
-
When you install pi-free, it:
|
|
12
|
-
|
|
13
|
-
1. **Registers
|
|
14
|
-
|
|
15
|
-
2. **
|
|
16
|
-
|
|
17
|
-
3. **
|
|
18
|
-
|
|
19
|
-
4. **
|
|
20
|
-
|
|
21
|
-
5. **
|
|
22
|
-
|
|
23
|
-
6. **
|
|
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
|
-
/
|
|
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
|
-
**Option
|
|
218
|
-
```bash
|
|
219
|
-
export NVIDIA_API_KEY="nvapi-..."
|
|
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
|
-
- Free
|
|
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
|
-
### Mistral (free API key)
|
|
303
|
-
|
|
304
|
-
Add API key to `~/.pi/free.json` or environment variables:
|
|
305
|
-
|
|
306
|
-
```bash
|
|
307
|
-
export MISTRAL_API_KEY="..."
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
---
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
-
|
|
324
|
-
-
|
|
325
|
-
-
|
|
326
|
-
-
|
|
327
|
-
-
|
|
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
|
-
Useful env vars:
|
|
395
|
-
|
|
396
|
-
```bash
|
|
397
|
-
# Console log verbosity (default: error)
|
|
398
|
-
LOG_LEVEL=debug
|
|
399
|
-
|
|
400
|
-
# File log verbosity (default: debug)
|
|
401
|
-
PI_FREE_LOG_LEVEL=debug
|
|
402
|
-
|
|
403
|
-
# Custom log path (optional)
|
|
404
|
-
PI_FREE_LOG_PATH=/tmp/pi-free.log
|
|
405
|
-
|
|
406
|
-
# Disable file logging
|
|
407
|
-
PI_FREE_FILE_LOG=false
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
---
|
|
411
|
-
|
|
412
|
-
## License
|
|
413
|
-
|
|
414
|
-
MIT — See [LICENSE](LICENSE)
|
|
415
|
-
|
|
416
|
-
**Questions?** [Open an issue](https://github.com/apmantza/pi-free/issues)
|
|
1
|
+
# pi-free-providers
|
|
2
|
+
|
|
3
|
+
Free AI model providers for [Pi](https://pi.dev). Access **free models** from multiple providers in one install.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What does pi-free do
|
|
8
|
+
|
|
9
|
+
**pi-free is a Pi extension that unlocks free AI models from multiple providers.**
|
|
10
|
+
|
|
11
|
+
When you install pi-free, it:
|
|
12
|
+
|
|
13
|
+
1. **Registers free-tier providers** with Pi's model picker — Kilo, Cline, NVIDIA, Cloudflare, Modal, Ollama Cloud, and more
|
|
14
|
+
|
|
15
|
+
2. **Fetches models dynamically** for Pi's built-in providers when API keys are configured — Mistral, Groq, Cerebras, xAI, Hugging Face, OpenRouter
|
|
16
|
+
|
|
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
|
+
|
|
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
|
|
20
|
+
|
|
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
|
+
|
|
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
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## How to use
|
|
30
|
+
|
|
31
|
+
### 1. Install the extension
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pi install git:github.com/apmantza/pi-free
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. Open the model picker
|
|
38
|
+
|
|
39
|
+
Start Pi and press `Ctrl+L` to open the model picker.
|
|
40
|
+
|
|
41
|
+
Free models are shown by default — look for the provider prefixes:
|
|
42
|
+
|
|
43
|
+
**✅ Offers Free Models (no usage limits, no payment required):**
|
|
44
|
+
- `opencode/` — OpenCode models (no setup required; toggle with `/toggle-opencode`)
|
|
45
|
+
- `kilo/` — Kilo models (free models available immediately, more after `/login kilo`)
|
|
46
|
+
- `openrouter/` — OpenRouter models (free account required)
|
|
47
|
+
- `cline/` — Cline models (run `/login cline` to use)
|
|
48
|
+
|
|
49
|
+
**🔄 Freemium (free tier with limits, then paid):**
|
|
50
|
+
- `nvidia/` — NVIDIA NIM models (1,000 free requests/month, then credits)
|
|
51
|
+
- `cloudflare/` — Cloudflare Workers AI (10K Neurons/day free tier, then $0.011/1K Neurons)
|
|
52
|
+
- `modal/` — GLM-5.1 FP8 via Modal (free promotional period until April 30, 2026)
|
|
53
|
+
- `ollama-cloud/` — Ollama Cloud models (usage-based free tier, resets every 5 hours + 7 days)
|
|
54
|
+
|
|
55
|
+
**🔧 Dynamic API Providers (fetched when API key configured):**
|
|
56
|
+
- `mistral/` — Mistral models (when `MISTRAL_API_KEY` set)
|
|
57
|
+
- `groq/` — Groq models (when `GROQ_API_KEY` set)
|
|
58
|
+
- `cerebras/` — Cerebras models (when `CEREBRAS_API_KEY` set)
|
|
59
|
+
- `xai/` — xAI models (when `XAI_API_KEY` set)
|
|
60
|
+
- `huggingface/` — Hugging Face models (when `HF_TOKEN` set)
|
|
61
|
+
|
|
62
|
+
**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.
|
|
63
|
+
|
|
64
|
+
### 3. Toggle between free and paid models
|
|
65
|
+
|
|
66
|
+
Want to see paid models too? Run the toggle command for your provider:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
/toggle-opencode # Toggle OpenCode (✅ offers free models)
|
|
70
|
+
/toggle-kilo # Toggle Kilo (✅ offers free models)
|
|
71
|
+
/toggle-openrouter # Toggle OpenRouter (✅ offers free models)
|
|
72
|
+
/toggle-cline # Toggle Cline (✅ offers free models)
|
|
73
|
+
/toggle-nvidia # Toggle NVIDIA (🔄 freemium)
|
|
74
|
+
/toggle-cloudflare # Toggle Cloudflare (🔄 freemium)
|
|
75
|
+
/toggle-ollama # Toggle Ollama Cloud (🔄 freemium)
|
|
76
|
+
/toggle-mistral # Toggle Mistral (🔧 dynamic - needs API key)
|
|
77
|
+
/toggle-groq # Toggle Groq (🔧 dynamic - needs API key)
|
|
78
|
+
/toggle-cerebras # Toggle Cerebras (🔧 dynamic - needs API key)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Notes:**
|
|
82
|
+
- **Toggle commands are mainly for ✅ and 🔄 providers** — to switch between "free models only" vs "show paid models too"
|
|
83
|
+
- **🔧 Dynamic providers** show all fetched models by default — the toggle filters the list when you have an API key configured
|
|
84
|
+
- **Freemium providers** show all models by default; you manage your usage limits via their dashboards
|
|
85
|
+
|
|
86
|
+
You'll see a notification like: `opencode: showing free models` or `opencode: showing all models`
|
|
87
|
+
|
|
88
|
+
### 4. Add API keys for more providers (optional)
|
|
89
|
+
|
|
90
|
+
Some providers require a free account or API key.
|
|
91
|
+
|
|
92
|
+
**The first time you run Pi after installing this extension, a config file is automatically created:**
|
|
93
|
+
- **Linux/Mac:** `~/.pi/free.json`
|
|
94
|
+
- **Windows:** `%USERPROFILE%\.pi\free.json`
|
|
95
|
+
|
|
96
|
+
Add your API keys to this file:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"openrouter_api_key": "sk-or-v1-...",
|
|
101
|
+
"nvidia_api_key": "nvapi-...",
|
|
102
|
+
"cloudflare_api_token": "...",
|
|
103
|
+
"ollama_api_key": "...",
|
|
104
|
+
"mistral_api_key": "...",
|
|
105
|
+
"modal_api_key": "sk-modal-..."
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Or set environment variables instead (same names, uppercase: `OPENROUTER_API_KEY`, `NVIDIA_API_KEY`, etc.)
|
|
110
|
+
|
|
111
|
+
See the [Providers That Need Authentication](#providers-that-need-authentication) section below for detailed setup instructions per provider.
|
|
112
|
+
|
|
113
|
+
### 5. Quick commands reference
|
|
114
|
+
|
|
115
|
+
| Command | What it does |
|
|
116
|
+
|---------|-------------|
|
|
117
|
+
| `/toggle-{provider}` | Switch between free-only and all models for that provider |
|
|
118
|
+
| `/free-providers` | Show free/paid model counts for all providers |
|
|
119
|
+
| `/login kilo` | Start OAuth flow for Kilo |
|
|
120
|
+
| `/login cline` | Start OAuth flow for Cline |
|
|
121
|
+
| `/logout kilo` | Clear Kilo OAuth credentials |
|
|
122
|
+
| `/logout cline` | Clear Cline OAuth credentials |
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Using Free Models (No Setup Required)
|
|
127
|
+
|
|
128
|
+
### OpenCode
|
|
129
|
+
|
|
130
|
+
Works immediately with zero setup:
|
|
131
|
+
|
|
132
|
+
1. Press `Ctrl+L`
|
|
133
|
+
2. Search for `opencode/`
|
|
134
|
+
3. Pick any model (e.g., `opencode/big-pickle`)
|
|
135
|
+
4. Start chatting
|
|
136
|
+
|
|
137
|
+
No account, no API key, no OAuth. Run `/toggle-opencode` to switch between free and paid OpenCode models.
|
|
138
|
+
|
|
139
|
+
### Kilo (free models, more after login)
|
|
140
|
+
|
|
141
|
+
Kilo shows free models immediately. To unlock all models, authenticate with Kilo's free OAuth:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
/login kilo
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This command will:
|
|
148
|
+
1. Open your browser to Kilo's authorization page
|
|
149
|
+
2. Show a device code in Pi's UI
|
|
150
|
+
3. Wait for you to authorize in the browser
|
|
151
|
+
4. Automatically complete login once approved
|
|
152
|
+
|
|
153
|
+
- No credit card required
|
|
154
|
+
- Free tier: 200 requests/hour
|
|
155
|
+
- After login, run `/toggle-kilo` to switch between free-only and all models
|
|
156
|
+
|
|
157
|
+
### Cline (free account)
|
|
158
|
+
|
|
159
|
+
Cline models appear immediately in the model picker. To use them, authenticate with Cline's free account:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
/login cline
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
This command will:
|
|
166
|
+
1. Open your browser to Cline's sign-in page
|
|
167
|
+
2. Wait for you to complete sign-in
|
|
168
|
+
3. Automatically complete login once approved
|
|
169
|
+
|
|
170
|
+
- Free account required (no credit card)
|
|
171
|
+
- Uses local ports 48801-48811 for OAuth callback
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Providers That Need Authentication
|
|
176
|
+
|
|
177
|
+
Some providers require a free account or API key to access their free tiers.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
### 🆓 Free Providers
|
|
182
|
+
|
|
183
|
+
### OpenRouter (free models available)
|
|
184
|
+
|
|
185
|
+
Get a free API key at [openrouter.ai/keys](https://openrouter.ai/keys), then either:
|
|
186
|
+
|
|
187
|
+
**Option A: Environment variable**
|
|
188
|
+
```bash
|
|
189
|
+
export OPENROUTER_API_KEY="sk-or-v1-..."
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Option B: Config file** (`~/.pi/free.json`)
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"openrouter_api_key": "sk-or-v1-..."
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Then use `/toggle-openrouter` to switch between free-only and all models.
|
|
200
|
+
|
|
201
|
+
### NVIDIA NIM (Free Credits System)
|
|
202
|
+
|
|
203
|
+
NVIDIA provides **free monthly credits** (1000 requests/month) at [build.nvidia.com](https://build.nvidia.com).
|
|
204
|
+
|
|
205
|
+
**Important:** Models have different "costs" per token:
|
|
206
|
+
- **Zero-cost models**: Don't consume your credit balance (shown by default)
|
|
207
|
+
- **Credit-costing models**: Consume credits faster (hidden by default)
|
|
208
|
+
|
|
209
|
+
Get your API key and optionally enable all models:
|
|
210
|
+
|
|
211
|
+
**Option A: Show only free models (default)**
|
|
212
|
+
```bash
|
|
213
|
+
export NVIDIA_API_KEY="nvapi-..."
|
|
214
|
+
```
|
|
215
|
+
Uses only zero-cost models → your 1000 credits last the full month
|
|
216
|
+
|
|
217
|
+
**Option B: Show all models (uses credits faster)**
|
|
218
|
+
```bash
|
|
219
|
+
export NVIDIA_API_KEY="nvapi-..."
|
|
220
|
+
export NVIDIA_SHOW_PAID=true
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Or in `~/.pi/free.json`:
|
|
224
|
+
```json
|
|
225
|
+
{
|
|
226
|
+
"nvidia_api_key": "nvapi-...",
|
|
227
|
+
"nvidia_show_paid": true
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Toggle anytime with `/toggle-nvidia`
|
|
232
|
+
|
|
233
|
+
### Cloudflare Workers AI (10K Neurons/day Free Tier)
|
|
234
|
+
|
|
235
|
+
Cloudflare provides **50+ open-source AI models** with a generous free tier:
|
|
236
|
+
- **10,000 Neurons per day FREE** (resets daily at 00:00 UTC)
|
|
237
|
+
- **$0.011 per 1,000 Neurons** beyond the free allocation
|
|
238
|
+
|
|
239
|
+
Get your API token at [dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens):
|
|
240
|
+
1. Create a token with "Cloudflare AI" → "Read" permission
|
|
241
|
+
2. Or use "My Account" → "Read" for broader access
|
|
242
|
+
|
|
243
|
+
**Setup:**
|
|
244
|
+
```bash
|
|
245
|
+
export CLOUDFLARE_API_TOKEN="your_token_here"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
The account ID is automatically derived from your token. Optionally, you can also set:
|
|
249
|
+
```bash
|
|
250
|
+
export CLOUDFLARE_ACCOUNT_ID="your_account_id" # Optional
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Models available:** Llama 4, Mistral Small 3.1, DeepSeek R1, Gemma 4, Kimi K2.5/2.6, and more.
|
|
254
|
+
|
|
255
|
+
Toggle with `/toggle-cloudflare`
|
|
256
|
+
|
|
257
|
+
### Modal (GLM-5.1 FP8 — free promotional period until April 30, 2026)
|
|
258
|
+
|
|
259
|
+
Modal hosts GLM-5.1 FP8 with a free promotional period. Get an API key at [modal.com](https://modal.com), then:
|
|
260
|
+
|
|
261
|
+
**Option A: Environment variable**
|
|
262
|
+
```bash
|
|
263
|
+
export MODAL_API_KEY="sk-modal-..."
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**Option B: Config file** (`~/.pi/free.json`)
|
|
267
|
+
```json
|
|
268
|
+
{
|
|
269
|
+
"modal_api_key": "sk-modal-..."
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Then select a `modal/` model in the model picker.
|
|
274
|
+
|
|
275
|
+
**Details:**
|
|
276
|
+
- Free promotional period until April 30, 2026
|
|
277
|
+
- Model: GLM-5.1 FP8 (128k context, 16k max output)
|
|
278
|
+
- No credit card required during the promotional period
|
|
279
|
+
|
|
280
|
+
### Ollama Cloud
|
|
281
|
+
|
|
282
|
+
Get an API key from [ollama.com/settings/keys](https://ollama.com/settings/keys), then:
|
|
283
|
+
|
|
284
|
+
**Option A: Environment variable**
|
|
285
|
+
```bash
|
|
286
|
+
export OLLAMA_API_KEY="..."
|
|
287
|
+
export OLLAMA_SHOW_PAID=true
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**Option B: Config file** (`~/.pi/free.json`)
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"ollama_api_key": "YOUR_KEY",
|
|
294
|
+
"ollama_show_paid": true
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
**Note:** Ollama requires `OLLAMA_SHOW_PAID=true` because they have usage limits on their cloud API.
|
|
299
|
+
|
|
300
|
+
Free tier resets every 5 hours + 7 days.
|
|
301
|
+
|
|
302
|
+
### Mistral (free API key)
|
|
303
|
+
|
|
304
|
+
Add API key to `~/.pi/free.json` or environment variables:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
export MISTRAL_API_KEY="..."
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Slash Commands
|
|
313
|
+
|
|
314
|
+
Each provider has toggle commands to switch between free and all models:
|
|
315
|
+
|
|
316
|
+
| Command | Action |
|
|
317
|
+
|---------|--------|
|
|
318
|
+
| `/toggle-opencode` | Toggle between free/all OpenCode models |
|
|
319
|
+
| `/toggle-kilo` | Toggle between free/all Kilo models |
|
|
320
|
+
| `/toggle-openrouter` | Toggle between free/all OpenRouter models |
|
|
321
|
+
| `/toggle-cline` | Toggle between free/all Cline models |
|
|
322
|
+
| `/toggle-nvidia` | Toggle between free/all NVIDIA models |
|
|
323
|
+
| `/toggle-cloudflare` | Toggle between free/all Cloudflare models |
|
|
324
|
+
| `/toggle-ollama` | Toggle between free/all Ollama Cloud models |
|
|
325
|
+
| `/toggle-mistral` | Toggle between free/all Mistral models (🔧 dynamic) |
|
|
326
|
+
| `/toggle-groq` | Toggle between free/all Groq models (🔧 dynamic) |
|
|
327
|
+
| `/toggle-cerebras` | Toggle between free/all Cerebras models (🔧 dynamic) |
|
|
328
|
+
|
|
329
|
+
**The toggle command:**
|
|
330
|
+
- **For ✅ free providers**: Switches between showing only free models vs. all available models (including paid)
|
|
331
|
+
- **For 🔄 freemium providers**: Shows all models by default; toggle switches between filtered and full list
|
|
332
|
+
- **For 🔧 dynamic API providers**: Filters the model list when you have an API key configured
|
|
333
|
+
- **Persists your preference** to `~/.pi/free.json` for next startup
|
|
334
|
+
- Shows a notification: "opencode: showing free models" or "opencode: showing all models"
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## Configuration
|
|
339
|
+
|
|
340
|
+
Create `~/.pi/free.json` in your home directory:
|
|
341
|
+
|
|
342
|
+
```json
|
|
343
|
+
{
|
|
344
|
+
"openrouter_api_key": "YOUR_OPENROUTER_KEY",
|
|
345
|
+
"nvidia_api_key": "YOUR_NVIDIA_KEY",
|
|
346
|
+
"mistral_api_key": "YOUR_MISTRAL_KEY",
|
|
347
|
+
"opencode_api_key": "YOUR_OPENCODE_KEY",
|
|
348
|
+
"ollama_api_key": "YOUR_OLLAMA_KEY",
|
|
349
|
+
"ollama_show_paid": true,
|
|
350
|
+
"modal_api_key": "YOUR_MODAL_KEY",
|
|
351
|
+
"hidden_models": ["model-id-to-hide"]
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
Or use environment variables (same names, uppercase):
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
export OPENROUTER_API_KEY="..."
|
|
359
|
+
export NVIDIA_API_KEY="..."
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Logging & Debugging
|
|
365
|
+
|
|
366
|
+
pi-free now writes extension logs to:
|
|
367
|
+
|
|
368
|
+
- **Windows:** `%USERPROFILE%\.pi\free.log`
|
|
369
|
+
- **Linux/macOS:** `~/.pi/free.log`
|
|
370
|
+
|
|
371
|
+
Useful env vars:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
# Console log verbosity (default: error)
|
|
375
|
+
LOG_LEVEL=debug
|
|
376
|
+
|
|
377
|
+
# File log verbosity (default: debug)
|
|
378
|
+
PI_FREE_LOG_LEVEL=debug
|
|
379
|
+
|
|
380
|
+
# Custom log path (optional)
|
|
381
|
+
PI_FREE_LOG_PATH=/tmp/pi-free.log
|
|
382
|
+
|
|
383
|
+
# Disable file logging
|
|
384
|
+
PI_FREE_FILE_LOG=false
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## License
|
|
390
|
+
|
|
391
|
+
MIT — See [LICENSE](LICENSE)
|
|
392
|
+
|
|
393
|
+
**Questions?** [Open an issue](https://github.com/apmantza/pi-free/issues)
|