# Purpose: the settings compose.yaml, litellm-config.yaml, llama-swap.yaml and the native # start script all read. Copy this file to `.env` beside compose.yaml and fill in # the lines that are empty. Nothing here is a secret except the two keys, which # you generate rather than copy. # Platform: all # Minimum memory: 8 GB # Assumes: `cp env-example.txt .env` and then an editor. Docker Compose reads `.env` # automatically from the directory you run it in; the native start script reads # it with `set -a; . ./.env; set +a`. # ---------------------------------------------------------------- where things listen # The gateway is the only thing anything else talks to. Keep it on the loopback address # until Part 23 puts authentication and TLS in front of it properly. GATEWAY_HOST=127.0.0.1 GATEWAY_PORT=4000 # llama-swap's own port. Nothing outside this stack should need it; it is published only # so you can look at its web page while you are setting the gateway up. SWAP_HOST=127.0.0.1 SWAP_PORT=9292 # ------------------------------------------------------------------------ your models # Absolute path to the model library you built in Part 4. llama-swap reads GGUF files # from here; the container path mounts it read-only. MODELS_DIR= # Absolute path to the llama-server binary, for the native path only. The container image # brings its own. Leave it empty if you are using Compose. LLAMA_BIN= # ------------------------------------------------------------------------------- keys # Generate with: openssl rand -hex 24 # The proxy admin key. It must begin with sk-, so write it as sk-. # It is the key that creates other keys; it is not the key your applications should use. LITELLM_MASTER_KEY= # Generate with: openssl rand -hex 24 # Used to encrypt stored credentials. Changing it invalidates what is already stored. LITELLM_SALT_KEY= # The key the gateway presents to llama-swap, if you set one there. Leave it empty when # llama-swap is only reachable from inside the stack, which is the default here. LOCAL_API_KEY= # ------------------------------------------------------------------- the spend database # Virtual keys and usage records need a database. These values are read only by the # container path; the native path runs without a database and the page says what you # lose. Generate the password with: openssl rand -hex 16 GATEWAY_DB_USER=gateway GATEWAY_DB_PASSWORD= GATEWAY_DB_NAME=gateway # ---------------------------------------------------------------------------- images # llama-swap publishes one image with several tags. Pick the one for your accelerator: # unified-cuda13 multi-architecture, NVIDIA Ampere through Blackwell (Tracks S and N) # unified-cuda amd64 only, older NVIDIA Pascal through Ada (Track N) # unified-vulkan amd64, AMD and other Vulkan-capable GPUs (Track X) LLAMA_SWAP_IMAGE=ghcr.io/mostlygeek/llama-swap:unified-cuda13 # LiteLLM's deployment page says to pin a version tag rather than a moving one so that # rollbacks are deterministic. This course pins LiteLLM 1.100.0; confirm the tag exists # on the registry before your first run, and change it here rather than in compose.yaml. LITELLM_IMAGE=ghcr.io/berriai/litellm:v1.100.0 POSTGRES_IMAGE=postgres:17-alpine