@b.neil/pi-extension-cloudflare-workers-ai
v1.0.0
Published
An extension for pi to use cloudflare workers ai
Readme
pi-cloudflare-workers-ai
Cloudflare Workers AI provider plugin for pi.
Setup
- Create a Cloudflare API token with Workers AI permissions at dash.cloudflare.com
- Add credentials to
~/.pi/agent/auth.json:
{
"cloudflare-ai": {
"access": "your_api_token",
"account_id": "your_account_id"
}
}Or set environment variables: CF_API_TOKEN, CF_ACCOUNT_ID
Usage
pi -e ./pi-cloudflare-workers-aiThen select a model with /model (e.g., cloudflare-ai/llama-3.3-70b).
Models
Includes frontier models (Kimi K2.5, Llama 4 Scout, Gemma 4, Qwen3, Nemotron 3) and existing favorites (Llama 3.x, DeepSeek R1, Mistral, Gemma).
Customizing Models
Create ~/.pi/cloudflare-models.json to add, override, or remove models:
[
{ "id": "@cf/xxx/new-model", "name": "New Model", "reasoning": false, "input": ["text"], "cost": { "input": 0.1, "output": 0.1, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 32000, "maxTokens": 4096 }
]- Add models: Include a new model not in defaults
- Override models: Same
idreplaces the default - Remove models: Set
"_remove": trueto delete from defaults
[
{ "id": "@cf/meta/llama-3.1-405b-instruct", "_remove": true }
]