Supported Providers
Pi supports the following providers out of the box:Cloud APIs
Anthropic (Claude), OpenAI, Google Gemini, OpenRouter, Groq, xAI (Grok), Mistral, GitHub Copilot, Amazon Bedrock, Vertex AI (Claude on Google Cloud), Azure OpenAI
Local / Self-Hosted
Ollama, LM Studio, vLLM, SGLang — any OpenAI-compatible endpoint also works via custom configuration in
~/.gsd/agent/models.json/gsd config inside a session, or export the relevant environment variable before starting Pi. See the Provider Setup guide for per-provider credential instructions.
Per-Phase Model Configuration
Pi executes different types of work at each phase of the auto-mode loop. Configure which model handles each phase in.gsd/PREFERENCES.md:
Omit any phase key to use whichever model is currently active as the default.
Token Profiles
Token profiles provide a quick way to balance cost, quality, and speed across the whole workflow:models.* entries override the profile for specific phases.
Dynamic Model Routing
Dynamic routing automatically selects a cheaper model for simple work and reserves your more capable models for complex tasks. It classifies each unit of work into a complexity tier — light, standard, or heavy — and routes accordingly. Enable it in.gsd/PREFERENCES.md:
Complexity Tiers
The router uses downgrade-only semantics — your configured model is always the ceiling. Dynamic routing never upgrades beyond what you’ve explicitly configured.
Full Configuration
Capability-Aware Scoring
Whencapability_routing: true is set (the default), Pi scores eligible models within the selected tier against the task’s requirements before choosing. Scores are computed across seven dimensions:
Different unit types weight these dimensions differently. For example,
execute-task weights coding and instruction heavily, while research-* units weight research and longContext.
Budget Pressure
Whenbudget_pressure: true is enabled, Pi progressively downgrades model selection as you approach your spending ceiling:
Fallback Chains
Configure a list of fallback models for any phase. Pi tries each in order if the primary model fails — useful for rate limits, provider outages, or quota exhaustion:fallbacks list. No manual intervention required.
Selecting a Model in Session
Switch models interactively from inside a GSD session:Using Multiple Providers
Pi can route different phases to different providers. Use theprovider/model format to target a specific provider:
provider field:
Cross-Provider Routing
Whencross_provider: true is enabled in dynamic routing, Pi uses its built-in cost table to find the cheapest model at each tier across all configured providers. This can significantly reduce costs when you have multiple providers available.
Cross-provider routing requires each target provider to be configured with valid credentials. Pi will not attempt to use a provider that isn’t set up.
Custom and Local Models
For providers not built into Pi (Ollama, LM Studio, vLLM, SGLang, or any OpenAI-compatible endpoint), define them in~/.gsd/agent/models.json:
models.json file reloads each time you open /model — no restart required to pick up changes.
Once defined, reference local models in your per-phase configuration the same way as any cloud model:
