Docker
Use Letta Code with a Letta server running in Docker
Letta Code can connect to a Letta server running in Docker by setting LETTA_BASE_URL.
Prerequisites
Section titled “Prerequisites”Before connecting Letta Code, you need to have a Letta server running in Docker. See the Docker setup guide for detailed instructions.
This example command configures a Letta server with an OpenAI API key, an Anthropic API key (for Claude models), and an Ollama URL (assumes that Ollama is running on localhost:11434):
docker run \ -v ~/.letta/.persist/pgdata:/var/lib/postgresql/data \ -p 8283:8283 \ -e OPENAI_API_KEY="your_openai_api_key" \ -e ANTHROPIC_API_KEY="your_anthropic_api_key" \ -e OLLAMA_BASE_URL="http://host.docker.internal:11434/v1" \ letta/letta:latestConnecting Letta Code
Section titled “Connecting Letta Code”Set the LETTA_BASE_URL environment variable to point to your server:
export LETTA_BASE_URL="http://localhost:8283"Then run Letta Code normally:
lettaYou can also set it inline:
LETTA_BASE_URL="http://localhost:8283" lettaModels available on the Letta server running in Docker will be shown in /model.