Use Confidential AI with Pi

Pi is a coding agent for the terminal that you extend yourself, usually run against models on your own machine. Adding Privatemode puts open-weight models behind it, far larger than a laptop can run, while your prompts stay encrypted in memory even during processing.

Pi coding agent logo
Introduction
screenshot of the pi-terminal

The challenge

Local models kept it private, but small

Many Pi users run it against local models through Ollama, LM Studio, or vLLM, because the model then sits on their own hardware. Larger models than that hardware can load have meant a conventional cloud provider, which processes source code in plaintext on its servers.

The solution

Added like a local model

Privatemode is added to Pi's models.json the same way as a local server, with the proxy on your machine as the endpoint. The proxy on your machine holds the key, verifies the service through remote attestation, and encrypts each request before it leaves.

Benefits

Why use Privatemode AI with Pi?

Set up like a local model

End-to-end confidentiality

Bigger than your own hardware

Free tier available

How to get started

Set up Pi to use Privatemode

Five steps take an existing Pi setup from conventional or local models to confidential cloud processing using Privatemode.

Install Pi

Install the Pi coding agent by following the official quickstart guide.

Privatemode sign-in screen

Get a Privatemode API key

Create a Privatemode account and generate an API key. You’ll pass it to the proxy in the next step.

Start the Privatemode proxy

Run the local Privatemode proxy with your API key. It encrypts every request before it leaves your machine and serves an OpenAI-compatible endpoint at http://localhost:8080/v1. For details visit the documentation.

Add Privatemode to your Pi models.json

Adjust the provider block in ~/.pi/agent/models.json and point it to the privatemode proxy. Pi reloads the file whenever you open /model, so there’s no need to restart your session.

Check mark

Start coding with Pi

Start pi in your project, run /model, and choose glm-latest or gpt-oss-120b. Every message is now protected end to end by confidential computing.

FAQ

Frequently asked questions about Pi with Privatemode

Privatemode offers a range of models running inside confidential computing environments, with your data encrypted in memory during processing. See the model overview.