LiteLLM + Open WebUI

LiteLLM is one OpenAI-style gateway with virtual keys and spend tracking; Open WebUI talks only to it. Add or swap providers in LiteLLM and the chat UI never changes.

Run it

  1. Save the compose file

    curl -fsSL https://archestack.com/stacks/litellm-open-webui/compose.yaml -o compose.yaml
  2. Write a .env with fresh values for POSTGRES_PASSWORD, LITELLM_MASTER_KEY, WEBUI_SECRET_KEY

    printf 'POSTGRES_PASSWORD=%s\nLITELLM_MASTER_KEY=%s\nWEBUI_SECRET_KEY=%s\n' "$(openssl rand -hex 16)" "sk-$(openssl rand -hex 16)" "$(openssl rand -hex 32)" > .env
  3. Start it

    docker compose up -d
  4. Open http://127.0.0.1:4000: LiteLLM admin at /ui (Open WebUI on 3000). First: add a model in the LiteLLM UI, then pick it in Open WebUI.

Needs Docker Compose v2 (started here with v5.6). Every port is bound to 127.0.0.1, so nothing is reachable from your network until you put a reverse proxy in front on purpose. For a GPU, add the GPU reservation to the ollama service. The file itself.

What each part does

Why these together: Both projects document the other as an OpenAI-compatible endpoint. Source ↗ (opens in a new tab)

Pinned images

  • postgres:17-alpine
  • ghcr.io/berriai/litellm:v1.110.1
  • ghcr.io/open-webui/open-webui:v0.13.4

A weekly job checks that each tag still exists and flags a pin two or more major versions behind its project’s latest release. A newer release is not tested here: change a tag on purpose, not by latest.

What we checked

Started on ubuntu-lan (x86-64, CPU only, Docker 29.9.2, Compose v5.6.1) on from this exact file, with fresh volumes. Every container came up healthy and each check below passed. The box already runs its own services on ports 3000 and 4000, so the run shifted the host ports by 10000; nothing else differed. No model was pulled, so no chat or document upload was tried.

  • LiteLLM is alive on 4000
  • LiteLLM accepts the master key
  • Open WebUI answers on 3000

Get it set up (opens in a new tab)Opens Archestack Studio with LiteLLM named. Our own paid service; it never changes a rank.