Skip to main content

Use InferNode from Pi

Pi is a terminal coding agent. It can read files, run tools, and work on your project using InferNode models. It connects directly through the Chat Completions API; it does not need a local router.

This guide was tested with Pi 0.73.1. It uses Saptiva Turbo, Saptiva Omni, and Saptiva Cortex as three independent options. Your administrator can change the model behind each alias without changing your configuration.

Before you start​

You need an InferNode key, your installation URL, Node.js 22 or later, and jq to query the catalog. Environment commands use Bash; run bash if your terminal uses another shell. Replace the example domain with the one your administrator provides.

npm install -g @mariozechner/pi-coding-agent@0.73.1
pi --version

The tested version is distributed as @mariozechner/pi-coding-agent. npm displays a rename notice pointing to @earendil-works/pi-coding-agent; this recipe pins the tested version and does not assume another version uses the same configuration.

1. Check your access​

Load the key in your terminal without writing it to shell history. Input is hidden when you paste it:

export INFERNODE_BASE_URL='https://api.<tu-dominio>/infernode/v1'
read -r -s -p 'InferNode API key: ' INFERNODE_API_KEY
printf '\n'
export INFERNODE_API_KEY
curl --fail-with-body -sS "$INFERNODE_BASE_URL/me" \
-H "Authorization: Bearer $INFERNODE_API_KEY"

The response should identify your user and organization. Variables last only in that terminal; load them again when you open another one. Do not put the key in your repository or model file.

Query the aliases available to your key:

curl --fail-with-body -sS "$INFERNODE_BASE_URL/models/aliases" \
-H "Authorization: Bearer $INFERNODE_API_KEY" \
| jq '.data[] | {alias, model: .model.id, context: .model.context_window}'

Use the exact names from that response, including capitalization and spaces. If any of the three aliases is missing, omit it from the configuration or ask your administrator for access. Do not add embedding or guard models as conversation models.

2. Add the provider and models​

Create ~/.pi/agent/models.json. If it already exists, add the infernode provider under providers and keep the others. Set baseUrl to the URL you just tested:

~/.pi/agent/models.json
{
"providers": {
"infernode": {
"baseUrl": "https://api.<tu-dominio>/infernode/v1",
"api": "openai-completions",
"apiKey": "INFERNODE_API_KEY",
"compat": {
"supportsStore": false,
"supportsDeveloperRole": false,
"supportsReasoningEffort": false,
"supportsStrictMode": false,
"maxTokensField": "max_tokens"
},
"models": [
{
"id": "Saptiva Turbo",
"name": "Saptiva Turbo",
"reasoning": true,
"input": [
"text",
"image"
],
"contextWindow": 262144,
"maxTokens": 8192
},
{
"id": "Saptiva Omni",
"name": "Saptiva Omni",
"reasoning": true,
"input": [
"text",
"image"
],
"contextWindow": 131072,
"maxTokens": 8192
},
{
"id": "Saptiva Cortex",
"name": "Saptiva Cortex",
"reasoning": true,
"input": [
"text",
"image"
],
"contextWindow": 131072,
"maxTokens": 8192
}
]
}
}
}

apiKey contains the variable name, not the secret. openai-completions selects Chat Completions. The compat settings avoid sending fields this integration does not need; supportsReasoningEffort: false does not disable model reasoning.

The contextWindow values are a tested example, not a permanent alias property. Adjust them to your installation's catalog. maxTokens: 8192 reserves output within that window: input and output must fit together (Context exceeded). This recipe does not configure prices in Pi; check actual usage in InferNode.

3. Open Pi in your project​

From your project directory, run one of these options:

pi --provider infernode --model 'Saptiva Turbo'
pi --provider infernode --model 'Saptiva Omni'
pi --provider infernode --model 'Saptiva Cortex'

Inside Pi, /model lets you choose among the three. The quoted names are the aliases sent to InferNode, not mappings to Claude model names. The pi-saptiva command is not part of Pi: it exists only if someone installed a custom launcher on your machine.

To check the connection with a short request:

pi --provider infernode --model 'Saptiva Turbo' \
--print --no-session --no-tools 'Responde solamente OK.'

Then test a tool in the interactive session: ask it to read a small existing file, using its exact path, and summarize it without modifying it. A greeting response checks generation; a file read followed by a response also checks tool use.

Common errors​

SymptomWhat to check
pi: command not foundThe npm binary directory must be on your PATH.
401 or UnauthorizedLoad INFERNODE_API_KEY in the same terminal. If you already used /login for infernode, Pi may be using a saved key; update it or use /logout to return to the variable.
model_not_foundCompare the id with GET /v1/models/aliases; preserve spaces and capitalization.
The response is empty or cut offReasoning may consume the available output. Check maxTokens and try Saptiva Turbo.
A tool cannot find a fileCheck the directory where you opened Pi and provide an exact path.
The model claims to be Claude or another modelThat statement does not verify the provider. Check the model field in the InferNode response and usage records; Claude Code shows how to distinguish identity from routing.

Next step​