Skip to main content
badlogic /

Pi

A lightweight AI coding agent CLI for interactive code editing and development workflows.

Coding Agents
Versionlatest
GPUOptional
Securely deploy Pi on Laboratory OS.

Pi

Laboratory OS Installation Details

Environment

Working Directory/workspace/pi-mono

Environment Variables

APP_DIRECTORY
/workspace/pi-mono
PI_BASE_URLOptional base URL for a custom OpenAI-compatible API endpoint. Leave blank to use built-in providers.
PI_API_KEYOptional API key for the custom provider. Only used when Provider Base URL is set.
PI_CODING_AGENT_DIR
${APP_DIRECTORY}
PI_MODELModel ID served by your custom endpoint.

Install & Run

install-and-run.sh
#!/bin/bash
set -e

export PATH="/opt/conda/bin:/root/.local/bin:$PATH"

# Create the directory if it doesn't exist
mkdir -p "/workspace/pi-mono"
  
# Change to the app directory
cd "/workspace/pi-mono"


# Environment setup complete
echo "Environment setup complete!"

npm install -g @mariozechner/pi-coding-agent
mkdir -p "$APP_DIRECTORY"

CLI Command

cli.sh
# Pi
if [ -n "$PI_BASE_URL" ]; then
  cat > $APP_DIRECTORY/models.json << MODELS_EOF
{
  "providers": {
    "custom": {
      "api": "openai-completions",
      "baseUrl": "$PI_BASE_URL",
      "apiKey": "$PI_API_KEY",
      "models": [{ "id": "$PI_MODEL", "name": "Custom Model", "input": ["text"], "output": "text" }]
    }
  }
}
MODELS_EOF
fi
exec pi