To use the Pi Coding Agent from pi.dev with the L&S on-premises LLM service, you'll need to install pi and create one configuration file by hand. With commercial providers, pi's /login command sets this up for you, but because we're pointing pi at UCSB CIT infrastructure directly, the provider configuration has to be written manually.
More information: API Access
There are two installation methods documented on the pi.dev website:
The installer is adequate for most users.
Linux / macOS:
curl -fsSL https://pi.dev/install.sh | sh
Windows:
powershell -c "irm https://pi.dev/install.ps1 | iex"
Skip this step if you already have Node.js. If you don't, we recommend installing it with nvm (Node Version Manager); fnm is a good alternative. Refer to the official Node.js documentation for details. A typical setup looks like this:
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
# Load nvm into the current shell session
\. "$HOME/.nvm/nvm.sh"
# Download and install Node.js (v24 recommended):
nvm install 24
# Verify the Node.js version:
node -v # Should print "v24.x.x"
# Verify npm version:
npm -v
Refer to pi.dev for official installation instructions. For most users, it is as simple as:
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
--ignore-scripts disables dependency lifecycle scripts during install. Pi does not require install scripts for normal npm installs.
Loading nvm in your shell profile can add about two seconds to every new terminal window. To avoid this, load nvm only when it is first used. For example, in ~/.zprofile on macOS with Homebrew, replace the standard nvm loader:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
with lazy-loading wrapper functions:
export NVM_DIR="$HOME/.nvm"
# Lazy load nvm to prevent shell startup lag
nvm() {
unset -f nvm node npm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm "$@"
}
node() {
unset -f nvm node npm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
node "$@"
}
npm() {
unset -f nvm node npm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
npm "$@"
}
The same approach works in ~/.bashrc.
Create the configuration directory and the models.json file:
mkdir -p ~/.pi/agent/
touch ~/.pi/agent/models.json
pi also generates ~/.pi/agent/settings.json automatically; advanced users can adjust it.
~/.pi/agent/models.jsonThis file tells pi where the server is and which models are available. Open it in your text editor and replace sk-YOURKEYHERE with your actual API key.
{
"providers": {
"CIT-AI": {
"name": "UCSB CIT AI.COLLEGE",
"api": "openai-completions",
"baseUrl": "https://api.ai.college.ucsb.edu/v1",
"apiKey": "sk-YOURKEYHERE",
"models": [
{
"id": "qwen3.8-27b",
"name": "Qwen3.8 27B",
"contextWindow": 262144,
"supportsTools": true,
"toolPattern": "manual"
},
{
"id": "gpt-oss-120b",
"name": "GPT-OSS 120B",
"contextWindow": 131072,
"supportsTools": true,
"toolPattern": "manual"
},
{
"id": "gemma-4-26b-a4b-it",
"name": "Gemma 4 26B A4B",
"contextWindow": 262144,
"supportsTools": true,
"supportsDeveloperRole": true
}
]
}
}
}
| Model ID | Description | Context |
|---|---|---|
qwen3.8-27b |
Code, STEM, and long documents | 256k |
gpt-oss-120b |
Complex reasoning and planning | 128k |
gemma-4-26b-a4b-it |
Fast general-purpose model | 256k |
For a real-time list of available models, log in to the API gateway with your API key at https://api.ai.college.ucsb.edu/, or see API Access.
~/.pi/agent/settings.json includes a "compaction": { "enabled": true } block. Compaction manages conversation history by condensing older parts of the session, which lets you keep working without quickly hitting the model's context limit or slowing responses. The recommended way to change it is with pi's built-in /settings command.
In models.json, contextWindow tells pi how many tokens the model can handle at once. Set it to the model's actual limit (see the table above); setting it higher can cause request errors.
contextWindow is correct for the model, review your compaction settings, and consider an extension or notes file to manage longer-term memory.This configuration has been tested with Python 3.13. As of June 2026, tests with Python 3.14 showed inconsistent behavior with pi. We recommend Python 3.13 or earlier.
Depending on your system (especially macOS or Linux), it may be easier or necessary to use a Python virtual environment (venv) to avoid conflicts with system-level packages:
python3.13 -m venv pivenv
source pivenv/bin/activate
pi