Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up

Run Letta with pip

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:

    Terminal window
    # To use OpenAI
    export OPENAI_API_KEY=...
    # To use Anthropic
    export ANTHROPIC_API_KEY=...
    # To use with Ollama
    export OLLAMA_BASE_URL=...
    # To use with Google AI
    export GEMINI_API_KEY=...
    # To use with Azure
    export AZURE_API_KEY=...
    export AZURE_BASE_URL=...
    # To use with vLLM
    export VLLM_API_BASE=...

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

    Terminal window
    export LETTA_PG_URI=...
  3. Run the Letta server

    To run the Letta server, run:

    Terminal window
    letta server

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