piagent_
← ~/map

$ cat ~/map/pi-custom-model.md

pi-custom-model

A keyless fallback chain for pi: configured tiers answer in order, and the first to stream a token wins.

extensions✓ Nov 2

Facts

repository
github.com/ederevx/pi-custom-model ↗
GitHub Stars
★ 0
Forks
0
license
MIT
npm / mo
—
last push
Nov 1, 2026

install

pi install git:github.com/ederevx/pi-custom-model@v0.2.0, then pick custom-model/fallback via /model or set defaultProvider custom-model and defaultModel fallback in settings.json.

## TL;DR

A pi extension that registers a custom-model/fallback model routing every request through a chain of up to three tiers — primary, secondary, tertiary — where the first tier to produce a first token within the timeout answers the whole request and a tier that errors or stalls is skipped.

## Key points

## FAQ

Q Does the fallback chain need its own API key?

No — the wrapper is a keyless delegating provider that never calls an API itself; each tier streams through its own provider's existing credentials.

Q What happens when every tier fails or stalls?

The request ends with a timeout error naming how many tiers were tried. A tier that errors before its first token advances the chain; an error after the first token is forwarded, because the answer is already committed.

Q Can I edit the chain outside the settings dock?

Yes — the piCustomModel section of settings.json holds the tiers and timeout, and routing re-reads settings on every request, so hand edits take effect on the next request; dock edits write only the key they change.

Q What context window does pi see for the wrapper model?

The smallest context window and max-token limit among the currently resolved tiers (0 for both when nothing is configured), so pi's compaction never plans past what the chain can serve.

Q Which tier shows up in usage and cost records?

The tier that actually answers — usage and cost always reflect it, while the message itself is attributed to custom-model/fallback.

## References

## Related entries

## Guides

Last updated: Nov 1, 2026