Run Letta with pip
Installing and Running the Letta Server
Section titled “Installing and Running the Letta Server”When using Letta via Docker you don’t need to install Letta, instead you simply download the Docker image (done automatically for you when you run docker run).
When using Letta via pip, running the Letta server requires you first install Letta (via pip install).
After installing, you can then run the Letta server with the letta server command.
-
Install using pip
To install Letta using
pip, run:pip install -U letta -
Configure model providers
Set environment variables to enable model providers, e.g. OpenAI:
Terminal window # To use OpenAIexport OPENAI_API_KEY=...# To use Anthropicexport ANTHROPIC_API_KEY=...# To use with Ollamaexport OLLAMA_BASE_URL=...# To use with Google AIexport GEMINI_API_KEY=...# To use with Azureexport AZURE_API_KEY=...export AZURE_BASE_URL=...# To use with vLLMexport VLLM_API_BASE=...If you have a PostgreSQL instance running, you can set the
LETTA_PG_URIenvironment variable to connect to it:Terminal window export LETTA_PG_URI=... -
Run the Letta server
To run the Letta server, run:
Terminal window letta serverYou can now access the Letta server at
http://localhost:8283.