Skip to main content

Overview

LiteLLM is an OpenAI-compatible LLM gateway and proxy: a single endpoint in front of 100+ model providers, with virtual API keys, per-key and per-team spend tracking and budgets, rate limiting, and routing with fallbacks. This template deploys the stateless LiteLLM proxy tier backed by PostgreSQL (virtual keys, spend, teams, budgets) and Redis (shared rate-limit counters and response cache). Clients call it exactly as they would call OpenAI — point any OpenAI SDK at the endpoint and swap in a LiteLLM key.

Architecture

  • LiteLLM proxy — A stateless standard workload serving the OpenAI-compatible API and Admin UI on port 4000. Runs a single replica by default; set litellm.replicas to 2 or more for an always-on tier with zero-downtime rolling restarts. All state lives in PostgreSQL and Redis, so replicas are independent — no clustering.
  • PostgreSQL (postgres subchart) — The durable store for virtual keys, spend, teams, and budgets. The DB-bundled proxy image runs its Prisma migrations automatically on boot.
  • Redis + Sentinel (redis subchart, optional via redis.enabled) — Shared rate-limit / budget counters and response cache across proxy replicas.

What Gets Created

  • Standard LiteLLM Workload — One or more stateless replicas serving the API and Admin UI on port 4000.
  • Stateful PostgreSQL Workload — Single-replica Postgres with a persistent volume set for keys and spend.
  • Redis Workloads (optional) — A Redis master-replica set with Redis Sentinel for rate limits and cache.
  • Config Secret — The model/provider list mounted into the proxy as config.yaml.
  • DB-credentials Secret — Assembles the proxy’s DATABASE_URL.
  • Identity & Policy — An identity bound to the proxy with least-privilege reveal on exactly its own secrets and your prerequisite secret.
This template does not create a GVC. You must deploy it into an existing GVC.

Prerequisites

You must create a dictionary secret before installing. The proxy references it by name (secrets.name, default my-litellm-secrets) and will not become healthy until it exists — a missing secret wedges the deployment and makes it look broken. Create it first, in the same GVC, as a dictionary secret containing:
  • LITELLM_MASTER_KEY — the admin key (format sk-...); gates the Admin API/UI and mints virtual keys.
  • LITELLM_SALT_KEY — encrypts provider keys stored in PostgreSQL. Write-once — never rotate it (rotating corrupts every stored provider key).
  • one key per name in litellm.providerEnv (default: OPENAI_API_KEY) — the actual provider API key.
Create it with the CLI (add one entry per provider key you use):
Install the template using your preferred method:

UI

Browse, install, and manage templates visually

CLI

Manage templates from your terminal

Terraform

Declare templates in your Terraform configurations

Pulumi

Declare templates in your Pulumi programs

Configuration

The default values.yaml for this template:

LiteLLM proxy

  • litellm.image — The DB-bundled LiteLLM proxy image (litellm-database), which runs Prisma migrations on boot. Pin a concrete tag.
  • litellm.replicas — Number of stateless proxy replicas. 1 is the proven single-replica shape; 2 or more gives an always-on tier where rolling restarts cycle one replica at a time with no downtime. Keep Redis enabled at 2+ so rate limits are shared across replicas.
  • litellm.resources — CPU and memory per replica.
  • litellm.storeModelInDb — When true, models added through the Admin UI/API are persisted in PostgreSQL alongside the static modelList.
  • litellm.modelList — The model/provider list seeded into the mounted config.yaml. Each entry’s api_key references an environment variable name (os.environ/OPENAI_API_KEY) — never a literal key.
  • litellm.providerEnv — The environment-variable names exposed to the proxy from the prerequisite secret. Every name here must exist as a key in that dictionary secret.

Prerequisite secret

  • secrets.name — Name of the user-created dictionary secret holding LITELLM_MASTER_KEY, LITELLM_SALT_KEY, and every providerEnv key. It must exist before install — see Prerequisites.

Access

  • publicAccess.enabled — Serve the API and Admin UI on the canonical *.cpln.app HTTPS endpoint (default). The endpoint is key-gated — a valid master or virtual key is always required. Set to false for an internal-only instance.
  • internalAccess.type — Internal firewall scope of the proxy workload:

PostgreSQL

  • postgres.config.password — The bundled database password. Change it before installing.
  • postgres.volumeset.capacity — Initial volume size in GiB (minimum 10).
PostgreSQL stores all virtual keys, spend, teams, and budgets.

Redis

  • redis.enabled — When true (default), deploys Redis + Sentinel for shared rate-limit counters and response cache. When false, no Redis is created and each proxy replica rate-limits in-memory (not shared across replicas).
  • redis.redis.auth.password.enabled — When false (default), Redis runs authless with the same-GVC firewall as the boundary. Set to true to require AUTH; the master password is then wired into the proxy’s cache config. Both paths are tested end to end, including Sentinel monitoring the auth-protected master.
  • redis.redis.replicas / redis.sentinel.replicas — Redis and Sentinel replica counts.

Connecting

The canonical *.cpln.app hostname appears under status.canonicalEndpoint (cpln workload get {release}-litellm -o yaml). Point any OpenAI SDK at this base URL and pass a LiteLLM key.

Managing Virtual Keys

Rather than handing out the master key, mint scoped virtual keys — each with its own budget and rate limits — and give those to your applications and teams. Spend is tracked per key in PostgreSQL.
The response includes a new sk-... key usable on /chat/completions and /v1/models. Manage keys, teams, and budgets visually in the Admin UI at /ui.

Important Notes

  • The prerequisite secret must exist before install. secrets.name is a dictionary secret with LITELLM_MASTER_KEY, LITELLM_SALT_KEY, and every providerEnv key. A missing secret wedges the deployment.
  • LITELLM_SALT_KEY is write-once — never rotate it. It encrypts stored provider keys; changing it corrupts every stored key. The master key may be rotated.
  • The endpoint is key-gated, not open. Public access still requires a valid master or virtual key — hand out virtual keys with budgets and limits rather than the master key.
  • Keep Redis enabled for replicas ≥ 2. Without it, each replica rate-limits in-memory, so the effective limit becomes N× the configured value.
  • Redis ships authless by default (same-GVC firewall is the boundary). Set redis.redis.auth.password.enabled: true to require AUTH; the master password is then wired into the proxy’s cache config.
  • PostgreSQL data survives reinstalls of the proxy — to reset virtual keys and spend you must also reinstall the database (which deletes its volume set).
  • First install self-heals a brief DB-timing gap. On a cold install the proxy can start before PostgreSQL accepts connections and log a P1001 error with one restart; it recovers automatically once the database is ready (about 1.5–2 minutes to healthy). No action needed.

External References

LiteLLM Documentation

Official LiteLLM documentation

Proxy Deployment

LiteLLM proxy deployment reference

Virtual Keys

Create and manage virtual keys, budgets, and rate limits

Config Reference

Full proxy config.yaml settings reference

LiteLLM Template

View the source files, default values, and chart definition