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 pi

Pi 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

FlagEffect
--model zai-org/GLM-5.3Select 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-runPrint the provider config and command without launching
sference launch pi -- /path/to/projectForward 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

ModelInput / output per 1MUse for
zai-org/GLM-5.3-Flash0.20 / 0.60Fast edits, formatting, small refactors
zai-org/GLM-5.31.20 / 4.20General coding turns
deepseek-ai/DeepSeek-V4.1-Flash0.50 / 1.50Long-context work at low cost
moonshotai/Kimi-K33.00 / 15.00Hard 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-Flash as the active model and switch to Kimi-K3 for 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.