@cloudflare/aig-pi-extension
Cloudflare AI Gateway Smart Router support and routing diagnostics for Pi
Package details
Install @cloudflare/aig-pi-extension from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@cloudflare/aig-pi-extension- Package
@cloudflare/aig-pi-extension- Version
2026.11.9- Published
- Nov 5, 2026
- Downloads
- 333/mo · 86/wk
- Author
- cf-ci-write
- License
- unknown
- Types
- extension
- Size
- 4.2 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
Cloudflare AI Gateway extension for Pi
Adds the cloudflare/auto Smart Router model to Pi through Cloudflare's internal AI gateway. It records routing diagnostics silently and shows the latest decision on demand through /aig-show, without occupying persistent UI space. It registers an isolated provider without replacing Pi's built-in provider or model catalog.
Prerequisites
cloudflared- Cloudflare Access entitlement to
opencode.cloudflare.dev - Pi 0.84.4
Authentication uses the same pinned cloudflared access login flow as pi-cf-internal-gateway. Tokens remain in memory and are not written to Pi's credential store.
Install
pi install ./packages/aig-pi-extension
Select cloudflare-auto/cloudflare/auto with /model or start Pi with:
pi --model cloudflare-auto/cloudflare/auto
Pi estimates cost using the internal catalog's cloudflare/auto rate. AI Gateway billing and logs report the concrete routed model and actual cost.