What it is
Pi works a lot like Claude Code, but it's open source and can talk to any model provider. CAIL Pi is a small Pi package that adds the Lab's gateway as a provider and lets you sign in with CUNY Login, so whatever you do in Pi comes out of your monthly allowance. Pi asks the gateway which models are available every time it starts, so you never have to update a model list. On Windows, CAIL Pi also turns on Pi's PowerShell tool so Pi runs commands in PowerShell, and it backs up Pi's settings file before changing it.
Before you start
- Lab model access. If you don't have it yet, request access.
- A terminal, such as Terminal on macOS or PowerShell on Windows. You don't need to install Node.js or Git first, because Pi's installer adds what it needs.
Install
First, install Pi with Pi's own installer. Open a terminal and run the command for your system.
macOS or Linux
curl -fsSL https://pi.dev/install.sh | shWindows PowerShell
irm https://pi.dev/install.ps1 | iexPress Enter to accept Pi's suggestions. It installs Node.js too if your computer needs it. When it asks "Start pi now?", type n, because you'll run the next command in the terminal. If it says your shell isn't using the new install yet, open a new terminal window.
Then add CUNY AI Lab to Pi. The command is the same on every system.
pi install npm:@cuny-ai-lab/cail-piSign in
Go to the folder you want to work in and start Pi.
piInside Pi, type /login cail and choose Sign in with CUNY AI Lab. Your browser opens the Lab's sign-in page. Sign in with CUNY Login, click Connect Pi, and go back to Pi.
Pi then shows a message ending in "no default model is configured for provider "cail"". You can ignore it. Send your first message, and Pi answers with DeepSeek V4 Flash.
If you're working on another computer over SSH, Pi shows a link instead of opening a browser. Open the link on any computer, click Connect Pi, and paste the code it shows into Pi.
To use an API key instead, choose Sign in with an API key and paste a personal key from your dashboard. The API key guide shows how to create one.
Pick a model
Type /model to see the CUNY AI Lab models and choose one. To make your choice the default for new sessions, press Ctrl+S in that list. Every request counts against your monthly allowance, and your dashboard shows how much is left.
Add web search (optional)
Two community packages, separate from CAIL Pi, let Pi search the web and ask you questions. If you already have them, skip this step. Otherwise, quit Pi by typing /quit and run:
pi install npm:pi-web-access
pi install npm:pi-ask-userpi-web-access lets Pi search the web and read pages. Searches go through Exa's free service and need no key. If a whole room searches at the same moment, some searches can be refused briefly, and Pi can try again. pi-ask-user lets Pi stop and ask you to choose between options before it goes ahead.
Coming from the earlier setup
The fall workshops set up Pi with npx @cuny-ai-lab/cail-pi, which also ran LazyPi. That command no longer works. If you set up Pi that way, close any window where Pi is running and update instead:
pi update --allThat updates Pi and all of your Pi packages, CAIL Pi included. Your saved key, your settings, and the packages LazyPi installed, including web search, stay as they are. On Windows, if PowerShell blocks pi, type pi.cmd update --all.
If you still have the older pi-workshop package, remove it so the CUNY AI Lab provider isn't loaded twice: pi remove npm:@cuny-ai-lab/pi-workshop.
Troubleshooting
For most problems, start by typing /cail inside Pi to run the health check. It shows whether the gateway answers, whether your key is saved and accepted, how many CUNY AI Lab models you can use, and which model is active. On Windows it also checks that Pi's PowerShell tool is on. It never shows your key.
- "No API key found for the selected model"
- Type
/login cailand sign in. - "Your CUNY AI Lab sign-in has expired"
- A sign-in lasts 180 days. Type
/login cailand sign in again. - "Your CUNY AI Lab access is not active yet"
- Signing in works only for accounts with Lab model access. Your dashboard shows how to request it.
- "That API key was not accepted"
- Look for missing or extra characters and paste it again with
/login cail. Keys are personal, so make sure it's the one issued to you. - No CUNY AI Lab models in /model
- Pi lists them once you're signed in. If
/cailsays your key is fine but the list stays empty, restart Pi. - Pi takes over the whole terminal window
- Pi runs full screen by default. To keep your terminal's normal scrollback, add
"tuiMode": "regular"to Pi's settings file (~/.pi/agent/settings.json, or%USERPROFILE%\.pi\agent\settings.jsonon Windows), or start Pi withpi --tui-mode regular. - Windows: "running scripts is disabled on this system"
- Pi's installer works around this, so
pinormally works. If the policy changed after you installed, typepi.cmdinstead ofpi. You don't need to change the execution policy.
Updating and removing
To update Pi and all of your Pi packages, close Pi and run pi update --all. To update CAIL Pi by itself:
pi update npm:@cuny-ai-lab/cail-piTo remove CAIL Pi:
pi remove npm:@cuny-ai-lab/cail-piYour key stays in Pi until you type /logout inside Pi. Logging out doesn't cancel the key. If you no longer need it, revoke it in your dashboard.
Privacy and security
Signing in creates a personal key for this computer, named "Pi on" and the computer's name, that expires after 180 days. It appears in your dashboard, where you can revoke it. Signing in again from the same computer replaces it, but a key you pasted yourself is never replaced.
Pi saves the key on your computer in ~/.pi/agent/auth.json, which only you can read on macOS and Linux. CAIL Pi sends the key only to the Lab's gateway, with each model request and when /cail checks it. It never shows the key in messages or the health check.
If you add pi-web-access, your searches go to Exa and pages are fetched directly from your computer.
If you prefer, you can set the AILAB_API_KEY environment variable instead of signing in. Pi uses it only when no key is saved.