Model Routing and Multi-Provider Configuration in GSD Pi
GSD Pi supports 15+ LLM providers with per-phase model configuration, dynamic complexity routing, token profiles, and fallback chains.
GSD Pi works with a wide range of LLM providers and gives you precise control over which model runs at each phase of the development workflow. You can set a different model for research, planning, implementation, and simpler tasks — letting you optimize for quality where it matters and cost where it doesn’t.
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
Configure your provider credentials with /gsd config inside a session, or export the relevant environment variable before starting Pi. See the Provider Setup guide for per-provider credential instructions.
Token profiles provide a quick way to balance cost, quality, and speed across the whole workflow:
Profile
Behavior
budget
Skips research and reassessment phases; uses lighter models
balanced
All phases run with standard model selection (default)
quality
All phases run; prefers higher-capability models
token_profile: balanced
Token profiles work alongside per-phase model settings. The profile sets the baseline behavior; explicit models.* entries override the profile for specific phases.
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:
The router uses downgrade-only semantics — your configured model is always the ceiling. Dynamic routing never upgrades beyond what you’ve explicitly configured.
When capability_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:
Dimension
What it measures
coding
Code generation and implementation accuracy
debugging
Diagnosing and fixing errors
research
Synthesizing information and exploring topics
reasoning
Multi-step logical reasoning
speed
Latency and throughput
longContext
Handling large codebases and long documents
instruction
Following structured instructions precisely
Different unit types weight these dimensions differently. For example, execute-task weights coding and instruction heavily, while research-* units weight research and longContext.
When two models score within 2 points of each other, Pi picks the cheaper one. Cost ties break alphabetically by model ID for deterministic behavior.
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:
Switch models interactively from inside a GSD session:
/model
This opens a model picker showing all models from your configured providers. Select a model to switch immediately for the current session. Preferences-file settings take effect on the next auto-mode dispatch.
When cross_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.
The 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: