$ cat ~/map/pi-thirdparty-model-settings.md
pi-thirdparty-model-settings
Configure pi's third-party providers in a local browser page; models appear in /model immediately.
extensions✓ Oct 22
Facts
- GitHub Stars
- ★ 2
- Forks
- 0
- license
- MIT
- npm / mo
- —
- last push
- Oct 21, 2026
install
pi install npm:pi-thirdparty-model-settings (recommended), or pi install git:github.com/aehyok/pi-thirdparty-model-settings; for a one-off trial without saving, pi -e npm:pi-thirdparty-model-settings## TL;DR
A pi extension whose /dsf-config command opens a local browser page for configuring third-party API providers — base URL, API key, and models over OpenAI-compatible, OpenAI Responses, Anthropic, or Gemini protocols — and writes the result into models.json so /model shows the new models immediately.
## Key points
- $/dsf-config starts a local service and opens the configuration page in the browser, and /dsf-config stop closes the service.
- $Provider fields cover base URL, API key, and models across four protocols: OpenAI-compatible, OpenAI Responses, Anthropic, and Gemini; model lists can be pulled from the endpoint's own models route and added by selection.
- $Each model can set a display name, a context window, max output (supporting 128k and 1M notation), reasoning, and image input; the page ships light, dark, and follow-system themes.
- $Settings are written to ~/.pi/agent/models.json (or the directory PI_CODING_AGENT_DIR points at), backed up as models.json.bak first, and the write is refused when the original file is not valid JSON.
- $After saving, only the changed provider is refreshed, so other providers' network refresh timeouts are not in the way, and new models appear in /model without a restart.
- $The local service listens only on the loopback interface, carries a random token in its URL, and shuts down after 15 minutes without interaction.
- $API keys are stored in plaintext in models.json by default; entering an environment-variable name in the key field (for example $ENV_NAME) makes pi read the variable at request time instead.
- $Requires pi (@earendil-works/pi-coding-agent) 1.3.0 or above.
## FAQ
Q Do I need to restart pi after saving a provider?
No. Saving refreshes only the changed provider, and the new models appear in /model immediately.
Q Where do the settings go, and can the extension clobber a broken file?
Into ~/.pi/agent/models.json (or the PI_CODING_AGENT_DIR directory), with a models.json.bak backup taken before writing; if the original file is not valid JSON, the write is refused.
Q Is my API key stored safely?
By default it is written in plaintext into models.json. To avoid that, enter an environment-variable name such as $ENV_NAME in the key field, and pi reads the variable when making requests.
Q Which pi version does it need?
pi (@earendil-works/pi-coding-agent) 1.3.0 or above.
Q Why is the command called /dsf-config?
dsf abbreviates the pinyin initials of the Chinese word for third-party (disanfang), the providers the page configures.
## References
## Related entries
$ pi-conversation-timer
Statusline timer that counts only active task seconds, frozen while pi waits, with a /chat-time stats popup.
$ pi-custom-model
A keyless fallback chain for pi: configured tiers answer in order, and the first to stream a token wins.
$ pi-reddit
Reddit tools for the pi agent: the audited reddit-mcp-server bridged over local stdio, with confirmation-gated writes.
## Guides
Last updated: Oct 21, 2026