Pi
Route Pi through sference: one command, a sference provider in ~/.pi/agent/models.json, and a model picker scoped to the sference catalog.
Pi
Pi reads providers from ~/.pi/agent/models.json. The sference launcher writes a sference provider block there and starts Pi with it selected.
Launch
curl -fsSL https://raw.githubusercontent.com/s-ference/sference/main/install.sh | sh
sference auth login --api-key 'sk_...'
sference launch piPi starts with sference as the active provider and the full catalog in the model picker.
What the launcher writes
A sference provider in ~/.pi/agent/models.json, using Pi's openai-responses API against sference's /v1/responses:
{
"providers": {
"sference": {
"api": "openai-responses",
"baseUrl": "https://api.sference.com/v1",
"apiKey": "sk_...",
"models": [
{ "id": "zai-org/GLM-5.3", "name": "GLM 5.3", "reasoning": true, "input": ["text"] },
{ "id": "moonshotai/Kimi-K3", "name": "Kimi K3", "reasoning": true, "input": ["text", "image"] }
]
}
}
}The model list is fetched live from GET /v1/models, so the picker mirrors your catalog exactly — including vision capability and context window per model.
Options
| Flag | Effect |
|---|---|
--model zai-org/GLM-5.3 | Select the active model (default: zai-org/GLM-5.2 or SFERENCE_MODEL) |
--base-url <url> | Point at a different API base (default https://api.sference.com) |
--dry-run | Print the provider config and command without launching |
sference launch pi -- /path/to/project | Forward arguments after -- to Pi |
The launcher scopes Pi's picker to sference models by default (--models sference/**), so other providers you have configured stay hidden until you widen it. ** is required because sference model ids contain a slash.
Choosing a model
| Model | Input / output per 1M | Use for |
|---|---|---|
zai-org/GLM-5.3-Flash | 0.20 / 0.60 | Fast edits, formatting, small refactors |
zai-org/GLM-5.3 | 1.20 / 4.20 | General coding turns |
deepseek-ai/DeepSeek-V4.1-Flash | 0.50 / 1.50 | Long-context work at low cost |
moonshotai/Kimi-K3 | 3.00 / 15.00 | Hard planning turns |
Cost control
- Prefix caching. Pi resends the system prompt and tool definitions every turn. Keep them stable and first so they bill at the cached rate — see Prompt caching.
- Cheap default, strong escalation. Set
GLM-5.3-Flashas the active model and switch toKimi-K3for planning turns. - Per-engineer attribution. Each engineer's key shows up separately in
GET /control/v1/usage/by-key. See Usage & analytics.
It is a compatibility layer
Open models plan differently and call tools less reliably than frontier closed models on long repo work. Validate on your own repository before committing a workflow. See SferenceCode for what to expect.