How to connect Pi Coding Agent to another AI API

The Reddit post shares a setup for connecting Pi Coding Agent to an outside AI API such as Atlas Cloud. It says Pi reads custom provider settings from `~/.pi/agent/models.json`. The example adds an OpenAI-compatible provider with a model ID, API key, token limits, and compatibility options. The post says to run it with `pi --provider atlascloud --model deepseek-ai/deepseek-v4-pro`.

Key points

  • The install command shown is `npm install -g --ignore-scripts @earendil-works/pi-coding-agent`.
  • The installed command is `pi`, not `pi-coding-agent`.
  • Pi reads custom provider settings from `~/.pi/agent/models.json` on macOS/Linux.
  • The example registers an Atlas Cloud DeepSeek model as an OpenAI-compatible provider.
  • The config includes `baseUrl`, `apiKey`, `contextWindow`, `maxTokens`, and compatibility options.

Quick term guide

coding agent
An AI tool that writes or edits code from a person’s instructions.
custom provider
A user-added connection to an AI model service that is not built in by default.
OpenAI-compatible
It uses an API shape similar to OpenAI’s, so tools can connect with fewer changes.
token limits
Token limits are the maximum amount of text an AI model can handle at one time.
DeepSeek-V4
An open-source large language model that can be run on a personal computer without paying for cloud API access.
contextWindow
The maximum amount of text the AI can read and use at one time.
token usage
Token usage is a count of how much text an AI tool processes.
coding-agent
An AI tool that can help write, edit, and reason about code across a task.
Read original