Before you begin
Make sure you have:Configure a Pi provider
To register Modular Cloud as a provider in Pi:-
Open (or create) the
~/.pi/agent/models.jsonconfiguration file. - Choose the model that you want from our list of shared endpoints or use a dedicated deployment if applicable.
-
Add Modular Cloud as a provider:
Modular Cloud supports the OpenAI chat completions API, so setmodels.json
apitoopenai-completions. Modular Cloud doesn’t support the OpenAI responses API.
models.json file, run /model in Pi and select the Modular
Cloud model to use.
The example above demonstrates a basic provider and model configuration. To see
the complete list of configuration options, see the Pi documentation on Custom
Models.
Retry rate-limited requests
Shared endpoints can return a 429 error when you hit a rate limit or when the endpoint is at capacity. To have Pi pause and retry failed requests, add this to~/.pi/agent/settings.json:
settings.json
maxRetriessets how many times Pi retries a failed request from the model provider before it stops trying.maxRetryDelayMssets the maximum server-requested delay in milliseconds. The default is60000(1 minute).