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
standardworkload serving the OpenAI-compatible API and Admin UI on port4000. Runs a single replica by default; setlitellm.replicasto2or 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
revealon 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 (formatsk-...); 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.
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 defaultvalues.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.1is the proven single-replica shape;2or more gives an always-on tier where rolling restarts cycle one replica at a time with no downtime. Keep Redis enabled at2+ so rate limits are shared across replicas.litellm.resources— CPU and memory per replica.litellm.storeModelInDb— Whentrue, models added through the Admin UI/API are persisted in PostgreSQL alongside the staticmodelList.litellm.modelList— The model/provider list seeded into the mountedconfig.yaml. Each entry’sapi_keyreferences 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 holdingLITELLM_MASTER_KEY,LITELLM_SALT_KEY, and everyproviderEnvkey. It must exist before install — see Prerequisites.
Access
publicAccess.enabled— Serve the API and Admin UI on the canonical*.cpln.appHTTPS endpoint (default). The endpoint is key-gated — a valid master or virtual key is always required. Set tofalsefor 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).
Redis
redis.enabled— Whentrue(default), deploys Redis + Sentinel for shared rate-limit counters and response cache. Whenfalse, no Redis is created and each proxy replica rate-limits in-memory (not shared across replicas).redis.redis.auth.password.enabled— Whenfalse(default), Redis runs authless with the same-GVC firewall as the boundary. Set totrueto 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.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.nameis a dictionary secret withLITELLM_MASTER_KEY,LITELLM_SALT_KEY, and everyproviderEnvkey. A missing secret wedges the deployment. LITELLM_SALT_KEYis 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: trueto 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
P1001error 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