Tutorials

Pi × Vivgrid

How to use Vivgrid with gpt-5.6-sol, deepseek-v4-pro and claude-opus-5 in Pi

Pi

Pi is a minimal terminal coding harness. It ships with read, bash, edit and write tools, then gets out of your way — you extend it with TypeScript extensions, skills, prompt templates and themes instead of forking it.

Key features include:

  • Provider-agnostic by design
    Any OpenAI-, Anthropic- or Google-compatible endpoint becomes a first-class provider through a single JSON file.
  • Four run modes
    Interactive TUI, --print for one-shot prompts, JSON/RPC for process integration, and an SDK for embedding.
  • Sessions you can branch
    Continue, resume, fork or export any session; compaction keeps long runs inside the context window.
  • Extend it yourself
    Extensions are plain TypeScript files, shareable as npm or git packages.

Install Pi

npm install -g --ignore-scripts @earendil-works/pi-coding-agent

Or use the installer script:

curl -fsSL https://pi.dev/install.sh | sh

Configure Pi to Use Vivgrid

Grab your API key from the Vivgrid Console, then add Vivgrid as a provider in ~/.pi/agent/models.json:

{
  "providers": {
    "vivgrid": {
      "baseUrl": "https://api.vivgrid.com/v1",
      "apiKey": "viv-xxxxxxxxxxxxx",
      "api": "openai-completions",
      "models": [
        {
          "id": "deepseek-v4-pro",
          "reasoning": true,
          "contextWindow": 1000000,
          "maxTokens": 128000
        },
        {
          "id": "claude-opus-5",
          "reasoning": true,
          "contextWindow": 1000000,
          "maxTokens": 128000
        },
        {
          "id": "gpt-5.6-sol",
          "api": "openai-responses",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 1050000,
          "maxTokens": 128000
        },
        {
          "id": "gemini-3.7-flash",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 1000000,
          "maxTokens": 65536
        },
        {
          "id": "glm-5.3-flash",
          "reasoning": true,
          "compat": {
            "supportsDeveloperRole": false
          },
          "contextWindow": 1000000,
          "maxTokens": 128000
        }
      ]
    }
  }
}

Three things worth noting:

  • One key, one baseUrl — every Vivgrid model in the list is reachable through the same OpenAI-compatible endpoint.
  • gpt-5.6-sol overrides api at the model level to openai-responses, because Vivgrid serves the GPT-5.6 family through the Responses API. The rest stay on openai-completions.
  • glm-5.3-flash sets compat.supportsDeveloperRole to false, so Pi sends the system prompt as a system message instead of a developer one.

models.json is re-read every time you open /model. Add a model mid-session and it shows up immediately — no restart needed.

Add more models from the Vivgrid catalog by appending entries to the same list.

Make Vivgrid the Default

Set the provider, model and thinking level Pi starts with in ~/.pi/agent/settings.json:

{
  "defaultProvider": "vivgrid",
  "defaultModel": "deepseek-v4-pro",
  "defaultThinkingLevel": "high",
  "theme": "dark",
  "tuiMode": "regular"
}

defaultThinkingLevel accepts off, minimal, low, medium, high, xhigh and max.

Verify

List everything Pi resolved for the provider:

pi --list-models vivgrid
provider  model              context  max-out  thinking  images
vivgrid   deepseek-v4-flash  1M       128K     yes       no
vivgrid   deepseek-v4-pro    1M       128K     yes       no
vivgrid   gemini-3.7-flash   1M       65.5K    yes       yes
vivgrid   glm-5.3            1M       128K     yes       no
vivgrid   glm-5.3-flash      1M       128K     yes       no
vivgrid   gpt-5.6-luna       1.1M     128K     yes       yes

Start Using Pi with Vivgrid

pi

Press /model to switch models, or Ctrl+P to cycle through them. You can also pick a model per run:

pi --provider vivgrid --model gpt-5.6-sol --thinking high

Or run a one-shot prompt without entering the TUI:

pi -p "explain the auth flow in this repo" --model vivgrid/deepseek-v4-pro

Summary

Pi keeps credentials and model definitions in one small JSON file, which makes Vivgrid a drop-in backend: point baseUrl at https://api.vivgrid.com/v1, paste one key, and the whole catalog — GPT-5.6, DeepSeek-V4, Gemini 3.7, GLM-5.3 — becomes selectable from /model with geo-distributed acceleration behind it.

On this page