The P31 CLI reads configuration from ~/.p31/config.yaml.
# ~/.p31/config.yaml
# All fields are optional; defaults shown.
# AI Router Proxy
proxy_url: http://localhost:4001/v1
proxy_model: flash # flash, premium, scavenger
# Local Ollama (legacy, falls back if proxy unavailable)
ollama_url: http://localhost:11434
# P31 Services
k4_cage_url: https://k4-cage.trimtab-signal.workers.dev
phos_url: https://phos.p31ca.org
Environment variables override config file values:
| Variable | Purpose |
|---|---|
| P31_PROXY_URL | Override proxy endpoint |
| P31_PROXY_MODEL | Override default model |
| P31_OLLAMA_URL | Override Ollama endpoint |
| P31_K4_CAGE_URL | Override K4 Cage URL |
p31 chat --model premium # Override model for this session
p31 --verbose # Enable debug logging
p31 --config /path/to/config.yaml # Use a custom config file
| Model | Use Case | Cost |
|---|---|---|
| scavenger | Simple tasks, low spoons | $0 (Gemini 2.5 Flash) |
| flash | Most reasoning tasks | $0.14/1M input |
| premium | Complex architecture, high spoons | $2.19/1M input |
MCP servers are configured in the Go source (cmd/chat.go, initMCP()). In the future, this will move to a config file.