App template
LiteLLM
One proxy for many LLM providers, with keys, models and spend kept in PostgreSQL.
- Memory when idle
- about 640 MiB
- CI measures it once the app is ready and before any traffic. Leave room for more.
- Tested on
- x86 servers
Introduction
LiteLLM is a proxy that gives you one OpenAI-compatible API in front of many LLM providers. It also has an admin page where you manage models, keys and spend.
This template runs LiteLLM behind your domain, with models, keys and spend stored in PostgreSQL.
Values you provide
You don’t fill in anything when you deploy.
Made for you
These values are generated at deploy and kept in a Kubernetes Secret, shown as Secret/key.
- litellm-secrets/master-key
- litellm-secrets/salt-key
Getting started
-
In Zeabur OSS, open the
litellmservice. When Overview shows its replica as ready, the service is up. Its domain is on the Networking tab under Public domains, for examplelitellm.example.com. The admin page is at/uion that domain. -
Get the master key. Open Variables, click
litellm-secretsunder From config files and secrets, and click the eye icon next tomaster-key. Without Zeabur OSS, read Secretlitellm-secrets, keymaster-key, with kubectl:kubectl -n <namespace> get secret litellm-secrets -o jsonpath='{.data.master-key}' | base64 -dThe key you use is
sk-followed by this value. -
Sign in as
admin. The password issk-followed by the value you just read. -
The same
sk-key is the admin API key for requests tohttps://litellm.example.com. Add models and client keys in the admin page.
The key salt-key in litellm-secrets encrypts the provider credentials in the database. Never change it after you add a model.
Configuration
Add a model
In the admin page, open Models + Endpoints and add the model with your provider and its API key. Models you add in the page are stored in the database, so you do not need to edit files or restart. See Model Management.
Create a key for a client
Do not give the master key to applications. Create a virtual key for each client in the admin page, then point the client at https://litellm.example.com/v1 and use that key. See Virtual Keys and Langchain, OpenAI SDK and other clients.
Back up the data
LiteLLM keeps models, keys and spend in the litellm-db database. It keeps nothing on a volume. In the project, open litellm-db. Under Backups, set up S3 backups. To get a file instead, click More → Export. Keep the Secret litellm-secrets with the backup, because salt-key decrypts the provider credentials in the database. See Create, back up, and restore databases and Download a database dump in the Zeabur OSS docs.
Troubleshooting
The page shows 502 or does not load
Open the litellm service in Zeabur OSS. Check that Overview shows its replica as ready, then read the Logs tab. If the replica is not ready, open Deployments and switch to Events. If Events show OOMKilled, the service ran out of memory. Raise Maximum memory under Settings → Compute. If the domain or the certificate stays pending, see Troubleshooting on the domains page.
Without Zeabur OSS, read the logs with kubectl -n <namespace> logs deployment/litellm and the events with kubectl -n <namespace> get events --sort-by=.lastTimestamp.
See Adjust replicas, resources, and health checks and View logs, events, and usage, and open a terminal in the Zeabur OSS docs.
Requests fail with a provider error
Read the Logs tab of the litellm service first. Then, in the admin page, open Models + Endpoints and check the model that fails. The model name must be the one your provider expects. The API key and the endpoint of that model must be valid. And your account must not be over its rate limit or quota at the provider. See AI Providers in the LiteLLM docs.
Resources
Each service is guaranteed the first amount and can use up to the second.
litellm
Ports
4000
CPU
0.2 cores to 2 cores
Memory
512 MiB to 2 GiB
litellm-db
Ports
5432
CPU
0.1 cores to 1 core
Memory
256 MiB to 1 GiB
Technical details
This release
- Version
- v1.106.3
- Licence
- MIT AND LicenseRef-LiteLLM-Enterprise AND PostgreSQL AND Apache-2.0
- Homepage
- litellm.ai
- Source file
- templates/litellm/template.yaml @ v0.6.3
Tested in CI
CI installs these exact files on a new cluster, waits until they are ready, then records the idle memory.
| Distribution | Platform | Kubernetes | Passed | Idle memory |
|---|---|---|---|---|
| kind | linux/amd64 | v1.37.0 | 641 MiB |
Security
LiteLLM runs as UID 65534 with a read-only root filesystem, no service-account token and all extra capabilities dropped. Outbound traffic is not limited. Every API call needs the master key or a key that the master key issued.
Known risks
Risk
The master key gives full access to the proxy, to its keys and to the provider credentials it stores.
How it is handled
Keep the master key for administration only. Give applications virtual keys with budgets and model limits.
Risk
Enterprise features need a license from BerriAI.
How it is handled
No LITELLM_LICENSE is set, so enterprise features stay off. Because the enterprise code ships in the image, the person who installs the template must accept the enterprise license.
Risk
The CloudNativePG database instances call the Kubernetes API with an identity that the operator creates.
How it is handled
The cloudnative-pg component creates the RBAC permissions for each cluster. The LiteLLM Pod has no token.
What the cluster needs
Zeabur OSS suggests the components a cluster is missing. Without it, install them first.