TheDocumentation Index
Fetch the complete documentation index at: https://docs.litellm-agent-platform.ai/llms.txt
Use this file to discover all available pages before exploring further.
lap CLI gives you a local terminal that connects directly to a running sandbox pod. Once attached, your terminal becomes the sandbox’s PTY — real Claude Code, real ANSI rendering, streamed over a WebSocket from the cluster. The experience feels like ssh: your iTerm, tmux, or Wezterm setup stays exactly where it is.
Prerequisites
- Node 18 or newer on your local machine
- A running LiteLLM Agent Platform deployment with at least one agent on the
claude-codeharness - The platform’s base URL and master key
Install from source
Authenticate
Runlap login once to save your credentials:
0600. To remove it, run lap logout.
Open a sandbox
What happens when you open a sandbox
When you runlap <agent-name>, the CLI performs these steps in order:
Resolve the agent name
GET /api/v1/managed_agents/agents looks up the name and returns the agent ID.Open the WebSocket
The CLI connects to
ws://<sandbox_url>/tty and sends the tty_token as an Authorization: Bearer <token> header on the WebSocket upgrade handshake. Using a header rather than a query parameter keeps the token out of access logs that record the request line.What’s running in the sandbox
- The actual
claudeCLI running undernode-pty - Working tree at
/work/repo, optionally cloned at boot fromREPO_URL - Stub credentials in the pod’s environment — the vault sidecar swaps them for real values on every outbound TLS connection, so the agent process cannot read the real tokens even with
echo $GITHUB_TOKEN
Detach and reconnect
Press Ctrl-D to detach from the sandbox. The remote session stays alive — the platform reaps it after 24 hours of message inactivity. To reconnect, runlap <agent-name> again.
A dedicated
lap attach <session-id> command for reconnecting to a specific session is planned but not yet available.Environment variable overrides
| Variable | Purpose |
|---|---|
LAP_TTY_TOKEN | Override the bearer token (normally read from session.tty_token) |
LAP_TTY_FALLBACK | Fallback WebSocket URL when sandbox_url is an in-cluster DNS name your laptop cannot reach |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
✗ no agent named '…' | Wrong agent name | Run lap config to confirm which platform you’re authenticated against; check agent names in the platform UI |
✗ session create failed: 401 | Master key is incorrect | Re-run lap login |
✗ session is in-cluster — no LAP_TTY_FALLBACK set | Platform is deployed in-cluster and has not exposed a public WebSocket URL | Export LAP_TTY_FALLBACK=ws://host:port/tty (provided by your platform operator) or contact your platform administrator |
[ws closed] immediately after attach | Harness pod was reaped or bearer token is wrong | Check lap config, then restart the session |
| Upgrade rejected with 401 from the harness | tty_token is missing or the harness authentication token is misconfigured | Contact your platform administrator to verify the harness authentication token is correctly set on the platform |