Warning: database migrations are not officially support with SQLite!

When you install Letta with pip, the default database backend is SQLite (you can still use an external postgres service with your pip install of Letta by setting LETTA_PG_URI).

We do not officially support migrations between Letta versions with SQLite backends, only postgres. If you would like to keep your agent data across multiple Letta versions we highly recommend using the Docker install method which is the easiest way to use postgres with Letta.

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.

1

Install using pip

To install Letta using pip, run:

pip install -U letta
2

Configure model providers

Set environment variables to enable model providers, e.g. OpenAI:

1# To use OpenAI
2export OPENAI_API_KEY=...
3
4# To use Anthropic
5export ANTHROPIC_API_KEY=...
6
7# To use with Ollama
8export OLLAMA_BASE_URL=...
9
10# To use with Google AI
11export GEMINI_API_KEY=...
12
13# To use with Azure
14export AZURE_API_KEY=...
15export AZURE_BASE_URL=...
16
17# To use with vLLM
18export VLLM_API_BASE=...

If you have a PostgreSQL instance running, you can set the LETTA_PG_URI environment variable to connect to it:

$export LETTA_PG_URI=...
3

Run the Letta server

To run the Letta Server, run:

$letta server

You can now access the Letta server at http://localhost:8283.

Built with