Custom Models
Add custom model providers via ~/.pi/agent/models.json. This file defines providers, their API endpoints, authentication, and available models.
Minimal Example
A local Ollama provider with one model:
Full Example
A provider definition with all available fields:
Supported APIs
Provider Configuration
Fields
Value Resolution
The apiKey and headers values support three formats:
Custom Headers Example
Model Configuration
Fields
Cost Object
Overriding Built-in Providers
You can override built-in providers to route traffic through a proxy or modify defaults. The custom configuration is merged with the built-in definition:
This keeps all built-in Anthropic models but routes requests through your proxy. Only the fields you specify are overridden; everything else retains its default value.
Per-Model Overrides
Use modelOverrides to adjust specific models within a provider without redefining them entirely:
OpenAI Compatibility
Many providers offer OpenAI-compatible APIs with slight differences. Use the compat field to handle these: