Knowledge Base Sections ▾

Navigation

▸ Start here By roles

Categories

Tools 52
Glossary 12

Tools

Pi + JoinGonka Gateway — terminal agent on cheap inference

Pi is a minimalist terminal coding agent, one of the fastest-growing open harnesses of 2026. Providers are described declaratively in ~/.pi/agent/models.json, and any endpoint that speaks OpenAI Completions or Anthropic Messages will work — meaning JoinGonka Gateway connects via both paths. Models in the decentralized Gonka network cost hundreds of times less than vendor card prices, and the initial 3M tokens are free.

Pi itself is installed via npm: npm install -g --ignore-scripts @earendil-works/pi-coding-agent. The package name is new: the project has moved to the earendil-works/pi repository, and the former package @mariozechner/pi-coding-agent is deprecated and no longer updated. If you have Pi installed under the old name, please reinstall it; the configuration directory ~/.pi/agent remains the same after the migration.

Fast path: installer

The shortest option is our installer:

npx @joingonka/setup --tool pi

It will configure the provider with current network models in ~/.pi/agent/models.json, set the default model in ~/.pi/agent/settings.json (it does not override the model you have selected yourself — that can only be changed by the explicit --model minimax|deepseek|glm flag), and perform a live request to verify that the gateway accepts the key and model. If the configuration directory is migrated using the PI_CODING_AGENT_DIR variable, the installer writes to the same location. The key is stored as a literal in the config with 0600 permissions — there is no need to export an environment variable.

Manual configuration: provider in models.json

Get a jg-… key when you register and add the provider to ~/.pi/agent/models.json:

baseUrlhttps://gate.joingonka.ai/v1
apiopenai-completions
apiKeyyour jg-… key as a literal. Pi also understands $VAR/${VAR} references and !command, but a literal works without an exported variable — keep the file at 0600 permissions
modelsarray: id, name, contextWindow, maxTokens

Correct values for the network's models: deepseek-ai/DeepSeek-V4-Flash-0731 — contextWindow 380000, maxTokens 32768; MiniMaxAI/MiniMax-M2.7 — contextWindow 200000, maxTokens 8192; zai-org/GLM-5.3-Flash — contextWindow 390000, maxTokens 8192. Pi's defaults (128000/16384) don't match the network's actual limits, so set both fields explicitly. The default model lives in a DIFFERENT file — ~/.pi/agent/settings.json, in the defaultProvider and defaultModel fields. To verify: pi --list-models should show the models you added.

Anthropic path as an alternative

The gateway also provides Anthropic Messages: a provider with api: "anthropic-messages" and baseUrl: "https://gate.joingonka.ai" — without the /v1/messages path, the client will append it itself. For daily work, the OpenAI path is sufficient; the Anthropic option is useful if your Pi extensions are tuned for the Messages format.

Safety disclaimer

Pi does not have a full permission layer by default: the agent executes commands in the terminal without the step-by-step confirmation found in heavier harnesses. Run it in a sandbox — a container or a separate user account — especially for autonomous multi-step tasks. This is a property of Pi itself, not the gateway.

Which model to choose and pricing

All three network models support tool calling and streaming. For long sessions and large repositories, use DeepSeek V4 Flash (one of the longest context windows in the network and output up to 32768). MiniMax M2.7 is a universal option, while GLM-5.3 Flash is a reasoning model with the longest network context (390K): it reasons before answering, so do not lower its maxTokens. The tariff is unified, and real-time prices are available in the gateway pricing list.

If Pi's minimalism isn't enough, take a look at its fork omp (Oh My Pi): it follows the same idea of declarative providers but adds model roles, language servers, and subagents. Their configs are different, so omp is set up separately.

Pi connects to JoinGonka Gateway with a single entry in ~/.pi/agent/models.json: baseUrl gate.joingonka.ai/v1, api openai-completions, key as a literal, and models with honest contextWindow/maxTokens. Even faster — use npx @joingonka/setup --tool pi. Launch the agent in the sandbox and start with free initial tokens.

Want to learn more?

Explore other sections or start earning GNK right now.

Get free tokens →