Amp
Configure Sourcegraph's Amp coding agent to route through LLMAI using CLIProxyAPI for unified model access and billing.
What This Does
Amp is Sourcegraph's frontier coding agent for the terminal and editor. It supports multiple agent modes — smart, rush, and deep — and integrates with IDEs like VS Code, JetBrains, and Zed. By routing Amp through LLMAI via CLIProxyAPI, you can use any supported model while consolidating your AI spend under a single LLMAI account.
Amp's native BYOK (Isolated Mode) has been removed. To use LLMAI with Amp, you need CLIProxyAPI — a lightweight proxy server that intercepts Amp's API calls and routes them through your LLMAI endpoint.
Setup
Step 1: Install Amp
curl -fsSL https://ampcode.com/install.sh | bashOr via npm:
npm install -g @anthropic-ai/ampStep 2: Install CLIProxyAPI
CLIProxyAPI is a proxy server that wraps Amp's API calls to route through custom providers:
docker pull eceasy/cliproxyapiOr install from source:
git clone https://github.com/router-for-me/CLIProxyAPI.git
cd CLIProxyAPIStep 3: Configure CLIProxyAPI
Create a config.yaml for CLIProxyAPI:
server:
port: 3456
upstream-url: "https://ampcode.com"
upstream-api-key: "YOUR_AMP_API_KEY"
restrict-management-to-localhost: true
model-mappings:
claude-opus-4-6: "gpt-5.4"
claude-sonnet-4-6: "gpt-5.3-codex"
claude-haiku-4-6: "glm-5-turbo"
force-model-mappings: true
custom-providers:
- name: "llmai"
base-url: "https://api.llmai.dev/v1"
api-key: "YOUR_LLMAI_API_KEY"
models:
- "gpt-5.4"
- "gpt-5.3-codex"
- "gpt-5.2"
- "gemini-3.1-pro"
- "glm-5-turbo"
- "glm-5"Replace YOUR_AMP_API_KEY with your Amp key from ampcode.com/settings and YOUR_LLMAI_API_KEY with your LLMAI key from console.llmai.dev/keys.
Step 4: Start CLIProxyAPI
docker run -d \
--name cliproxyapi \
-p 3456:3456 \
-v ./config.yaml:/CLIProxyAPI/config.yaml \
eceasy/cliproxyapiStep 5: Configure Amp to Use the Proxy
Point Amp to the local proxy by setting environment variables:
export ANTHROPIC_BASE_URL="http://localhost:3456"
export ANTHROPIC_API_KEY="YOUR_LLMAI_API_KEY"Add these to your ~/.zshrc or ~/.bashrc to persist across sessions.
Step 6: Verify the Connection
Run Amp and start a conversation:
ampTry a simple prompt to confirm the proxy is routing requests through LLMAI.
Recommended Models for Amp
| Amp Mode | Mapped Model | Why |
|---|---|---|
| Smart (complex tasks) | gpt-5.4 | Highest reasoning capability |
| Rush (quick tasks) | glm-5-turbo | Fast, low latency |
| Deep (extended thinking) | gpt-5.3-codex | Optimized for code reasoning |
| Large codebase analysis | gemini-3.1-pro | 1M+ token context |
IDE Integrations
Amp also works with IDEs. After configuring CLIProxyAPI, connect Amp to your editor:
| IDE | Setup |
|---|---|
| VS Code / Cursor / Windsurf | Install Amp CLI, ensure editor is running, then run amp |
| JetBrains | Install Amp CLI, then run amp --jetbrains |
| Zed | Install Amp CLI, ensure Zed is running, then run amp |
| Neovim | Install Amp CLI and the Amp Neovim plugin, then run amp |
Use the command palette (Ctrl+O) and select ide connect to link Amp with your editor.
Troubleshooting
Proxy not starting
- Verify Docker is running:
docker ps - Check CLIProxyAPI logs:
docker logs cliproxyapi - Ensure port 3456 is not in use:
lsof -i :3456
Amp connection errors
- Confirm the proxy is running at
http://localhost:3456 - Verify
ANTHROPIC_BASE_URLis set correctly - Test the proxy directly:
curl http://localhost:3456/health
Model mapping not working
- Check that
force-model-mappings: trueis set in your CLIProxyAPI config - Verify the model names in
model-mappingsmatch what Amp requests - Review CLIProxyAPI logs for unmapped model requests
Authentication errors
- Ensure your LLMAI API key is valid at console.llmai.dev/keys
- Check that the
custom-providerssection has the correctapi-key
Notes
- Amp's native Isolated Mode (BYOK) has been removed — CLIProxyAPI is the recommended way to use custom providers
- The
model-mappingssection translates Amp's default model names to LLMAI models - All token consumption routed through LLMAI appears in your dashboard in real-time
- Amp uses AGENTS.md files for project-specific guidance — these work independently of the proxy setup