Installation and configuration of the Pi AI agent for use with the immers.cloud API on Windows and Ubuntu

Pi is a command-line AI coding agent. This guide covers the installation of Pi on Windows and Ubuntu, as well as the configuration for connecting to the public API endpoints of immers.cloud. Upon completion, you will have a fully functional terminal assistant capable of generating and editing code directly within your project.

Installation

Before proceeding with the installation, it is highly recommended to use a VPS for a more secure agent workflow.

By definition, the agent requires system-level access: it executes shell commands, edits files, and interacts with the network. Consequently, your project data and environment variables become part of its operational context. An isolated environment is significantly safer. A dedicated server hosts only your project, containing no personal correspondence, payment details, or credentials for other work services. Furthermore, if anything goes wrong, the environment can be completely redeployed in a matter of minutes.

Additionally, a remote server runs 24/7 without draining your local laptop's resources, allowing you to experiment freely. If a configuration breaks, only the isolated environment is affected, making it trivial to tear down and recreate. Therefore, a highly convenient option is to provision a dedicated server directly through the immers.cloud platform.

 

To get started, it is sufficient to provision a budget-friendly CPU server with a modest amount of RAM, for example, using the cpu.2.8.40 configuration and the Ubuntu 24.04 (Jul 2026) [UEFI] pre-installed image. Navigate to the server creation page, configure the parameters to suit your task, and wait until the server status changes to Active.

Once your server is created, connect to it via SSH to begin the installation. The installation process is detailed in the official documentation; execute the following commands to start:

Windows

powershell -c "irm https://pi.dev/install.ps1 | iex"

Ubuntu

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

Node.js version 22.19 or higher and npm are required. The installer will prompt you to install them during the first step if they are missing.

After installation, restart your terminal and verify that the installation was successful by running:

1

After installation, restart your terminal and verify that the installation was successful by running:

pi --version

Pre-Launch Configuration: Connecting to immers.cloud Endpoints

To configure Pi to work with immers.cloud endpoints, you must create a models.json file located at:

Windows

%USERPROFILE%\.pi\agent\models.json

Ubuntu

~\.pi\agent\models.json

Perform the following steps:

Create and open the file in the nano editor:

 nano ~/.pi/agent/models.json

Paste your JSON config, then save the file:

Press Ctrl + O, then Enter (to save).

Press Ctrl + X (to exit the editor).

Verify that the file is in place and contains no syntax errors:

cat ~/.pi/agent/models.json

Contents:

{

  "$schema": "https://pi.dev/schemas/models.schema.json",

  "providers": {

    "immers.cloud": {

      "baseUrl": "https://chat.immers.cloud/v1/endpoints/generate",

      "api": "openai-completions",

      "apiKey": "your-immers.cloud-token",

      "models": [

        { "id": "qwen3.8-27b", "reasoning": true, "contextWindow": 100000, "maxTokens": 32000}

      ]

    }

  }

}

Understanding the Configuration Fields:

  • apiKey: Enter your immers.cloud API token. You can generate this token on the Token Management page after completing registration and account verification.
  • models: The example specifies the qwen3.8-27b model, but you can select any other model available through the public endpoints. You can view the complete list by navigating to the Model Catalog page and filtering by the "Available for Trial" tag.
  • Private Endpoints: If you have deployed a private endpoint, specify the exact value from the Model Name field on your private endpoint's dashboard page in the models array.
  • Routing Warning: If your private endpoint hosts a model that is also available on a public endpoint, using the default URL (https://chat.immers.cloud/v1/endpoints/generate) does not currently guarantee that inference will be routed specifically to your private instance rather than the public one. To ensure your requests are routed exclusively to your private endpoint, update the baseUrl field in your models.json file to the exact URL provided in the API Access field on your private endpoint's dashboard.
  • contextWindow and maxTokens: These parameters limit the total maximum number of tokens (input prompts + dialogue history + response) and the number of generated tokens per step, respectively.
  • Reasoning Levels: Pi supports toggling reasoning levels only for models where the configuration includes "reasoning": true. You can toggle the reasoning level in an active session using the Shift + Tab key combination. You can hide or expand reasoning blocks using Ctrl + T.

The agent is now fully operational and ready for use.

Working with Pi

To launch the agent, navigate to your project directory and start Pi using the following commands:

cd path_to_your_project

pi

To verify functionality, you can enter a simple prompt and observe the resulting changes in your development environment. For more details on how to work with Pi, refer to the official documentation.

2

Current information on actual token consumption and charges under connected plans can be viewed on the Token Consumption page.

Using a Different immers.cloud Endpoint

If you decide to try a different endpoint and the baseUrl is set to (https://chat.immers.cloud/v1/endpoints/generate), add another entry with the model name (and other parameters, if necessary) to the models array in your models.json file:

"models": [

   { "id": "qwen3.8-27b" },

   { "id": "model_name" }

]

You can find the exact model_name in the Public Endpoint section on the model's catalog page, or in the Model Name field on your private endpoint's dashboard.

Afterward, restart your terminal and Pi. To select the model for future use, enter the command:

/model

3

Updated Date 04.12.2026
We use cookies and web analytics services to ensure the proper functioning of the website, analyze web-site traffic, and improve the quality of our services.
By continuing to use the website, you consent to the Privacy Policy and consent to the processing of cookie files and technical data.