Deploy LiteLLM, the OpenAI-compatible LLM gateway, on Render with the official Docker image and managed PostgreSQL. Add models in the Admin UI; call the proxy from any OpenAI SDK.
Live Admin UI: litellm-l9il.onrender.com/ui (user admin, password is the master key). Chat playground against that proxy: litellm-tester.onrender.com.
This repo wraps BerriAI's official monolithic image as a one-click Render Blueprint. It matches the upstream docker-compose quickstart: one proxy process plus Postgres. Redis is not included, because LiteLLM only requires it when you run more than one instance.
| Piece | Role |
|---|---|
| LiteLLM | OpenAI-compatible gateway, virtual keys, spend logs, Admin UI |
| litellm/litellm:v1.99.1 | Official image with Prisma migrations bundled |
| Render Web Service | Pulls the image on a Pro instance (4 GB) |
| Render PostgreSQL | Keys, teams, models, and spend logs |
Provider keys (OpenAI, Anthropic, and the rest) are added in the UI after login. Render does not offer an LLM gateway primitive; this template runs LiteLLM's own proxy.
flowchart LR
apps["Apps / OpenAI SDKs"] --> web["litellm<br/>litellm/litellm:v1.99.1"]
browser["Browser /ui"] --> web
web --> db[("litellm-db")]
web -.-> providers["Your LLM providers"]
- Click Deploy to Render. Render forks this template into your GitHub account and applies
render.yaml. - On Apply, paste
LITELLM_MASTER_KEYandLITELLM_SALT_KEY. Both must start withsk-.OPENAI_API_KEYcan be left blank. - Render pulls
docker.io/litellm/litellm:v1.99.1, wiresDATABASE_URL, and starts one Uvicorn worker on port4000. - Open
https://<service>.onrender.com/ui. Username isadmin. Password is the master key. - Add a model, create a virtual key, then call
/v1/chat/completions.
| Resource | Type | Plan | Notes |
|---|---|---|---|
litellm |
Web (runtime: image) |
pro | Health check /health/liveliness. Auto-deploy off. |
litellm-db |
PostgreSQL 16 | basic-256mb | Internal URL only (ipAllowList: []). |
Default region: oregon. The proxy is stateless; all durable state lives in Postgres. Horizontal scale needs a Render Key Value instance for Redis, which this Blueprint does not create.
- A Render account
- Two secrets that start with
sk-(master key and salt key) - An LLM provider key when you are ready to add a model (not required at Apply)
Generate the two LiteLLM secrets:
echo "sk-$(openssl rand -hex 24)"
echo "sk-$(openssl rand -hex 24)"Keep the salt key. Changing it after you add models makes stored provider credentials unreadable.
-
Click Deploy to Render above and fork into your GitHub account.
-
On Apply, set
LITELLM_MASTER_KEYandLITELLM_SALT_KEY. LeaveOPENAI_API_KEYempty unless you want it available asos.environ/OPENAI_API_KEYin the UI. -
Wait until the web service is Live (~4–10 minutes; first image pull and Prisma migrate can take longer).
-
Open
/ui, sign in asadminwith the master key, and add a model. -
Create a virtual key and send a test completion.
curl --fail --silent "https://<your-service>.onrender.com/health/liveliness"
curl "https://<your-service>.onrender.com/v1/chat/completions" \
-H "Authorization: Bearer <virtual-key>" \
-H "Content-Type: application/json" \
-d '{"model":"<your-model>","messages":[{"role":"user","content":"Say hello in five words."}]}'| Feature | Description |
|---|---|
| Official image | Pinned litellm/litellm:v1.99.1 (also published at ghcr.io/berriai/litellm) |
| Admin UI | Models, virtual keys, spend, and playground at /ui |
| OpenAI-compatible API | Point any OpenAI SDK at the service URL |
| Postgres-backed keys | Virtual keys, budgets, and spend logs survive deploys |
| UI model catalog | STORE_MODEL_IN_DB=True so you do not need a config file |
| Single worker | NUM_WORKERS=1 matches LiteLLM's Kubernetes guidance |
| Variable | Source | Description |
|---|---|---|
PORT |
Blueprint | 4000 (image listen port) |
HOST |
Blueprint | 0.0.0.0 |
NUM_WORKERS |
Blueprint | 1 |
LITELLM_MODE |
Blueprint | PRODUCTION (disables load_dotenv) |
LITELLM_LOG |
Blueprint | ERROR |
STORE_MODEL_IN_DB |
Blueprint | True: manage models from the UI |
DATABASE_URL |
Wired | Internal connection string from litellm-db |
LITELLM_MASTER_KEY |
Required (sync: false) |
Admin API key and UI password. Must start with sk- |
LITELLM_SALT_KEY |
Required (sync: false) |
Encrypts provider keys in Postgres. Set once |
OPENAI_API_KEY |
Optional (sync: false) |
Leave blank to add keys in the UI instead |
Other provider keys (ANTHROPIC_API_KEY, Azure, Bedrock, and so on) can be added later in the Dashboard or as os.environ/... references in the model form. Full list: LiteLLM docs.
# render.yaml
image:
url: docker.io/litellm/litellm:v1.99.1autoDeployTrigger: off so tag edits do not redeploy until you choose Manual Deploy.
Approximate monthly compute from Render pricing (Hobby workspace, Oregon):
| Resource | Approx. monthly |
|---|---|
| Web service (Pro, 4 GB) | $85 |
| PostgreSQL (Basic 256 MB) | $6 |
| Total | ~$91 |
LLM tokens are billed by your providers. Pro is the floor. LiteLLM documents 1 vCPU and 4 GiB per worker because Prisma's query engine holds a high-water memory mark. Downgrading to Standard (2 GB) typically OOMs and Render reports "No open ports detected."
Spend logs can grow. If Postgres disk fills, raise the database plan. Adding Redis later (for multiple instances) is about $10/month on Key Value Starter.
| Problem | Solution |
|---|---|
| Health check fails / no open ports | Keep Pro. Confirm PORT=4000 and HOST=0.0.0.0. First boot runs Prisma migrate; wait and retry. |
Reached heap limit / OOMKill |
Undersized instance. Do not use Starter or Standard. |
| Image pull failures | Confirm docker.io/litellm/litellm:v1.99.1 exists, then retry the deploy. |
| UI login fails | Username is admin. Password is LITELLM_MASTER_KEY and must start with sk-. |
Prisma / self-signed certificate |
Internal DATABASE_URL should not require TLS. If you pasted an external URL, switch back to the Blueprint fromDatabase value. |
| Models unreadable after a restart | You rotated LITELLM_SALT_KEY. Restore the original salt; there is no in-place rotation. |
render.yaml Render Blueprint (image + Postgres)
README.md This file
LICENSE MIT (template wrapper)
.env.example Optional env overrides
assets/ Hero / logo
Render:
LiteLLM:
MIT for this template wrapper.
Upstream LiteLLM is MIT for the open-source tree. The enterprise/ directory in that repo has a separate license and is not part of this image wrapper.
