Deploy litellm-source-20260617
LiteLLM AI gateway with Postgres keys, Redis cache, and spend controls.
litellm
Just deployed
postgres
Just deployed
/var/lib/postgresql/data
redis
Just deployed
/data
Deploy and Host LiteLLM Gateway on Railway
Run LiteLLM Proxy as a production-shaped OpenAI-compatible AI gateway with Postgres persistence, Redis coordination, generated admin credentials, and provider-key setup left to the deployer.
About Hosting LiteLLM on Railway
litellm: public LiteLLM proxy/API/admin service on port4000postgres: private app database for virtual keys, teams, provider config, and spend logsredis: private cache/routing coordination service- Generated
LITELLM_MASTER_KEY,LITELLM_SALT_KEY, Postgres password, and Redis password - No provider API keys are included in the template
Why Deploy LiteLLM on Railway
LiteLLM gives teams one OpenAI-compatible gateway across OpenAI, Anthropic, Gemini, Bedrock, Azure, OpenRouter, local OpenAI-compatible endpoints, and many other providers. Postgres keeps admin state and spend logs durable, while Redis supports production cache/routing patterns recommended by LiteLLM's own deployment guidance.
Common Use Cases
- Central AI gateway for apps and agents
- OpenAI-compatible API facade for multiple providers
- Virtual keys with budgets and spend tracking
- Provider-key management without baking provider secrets into app code
- Backend for Open WebUI or internal agent platforms
Dependencies for LiteLLM Hosting
LiteLLM can run as a single container, but this template includes Postgres and Redis because key management, spend tracking, and production routing/cache behavior depend on durable shared services.
Deployment Dependencies
LITELLM_MASTER_KEY: generated admin/master key. It starts withsk-.LITELLM_SALT_KEY: generated encryption salt. Do not change it after adding provider keys.DATABASE_URL: private Postgres connection string.REDIS_HOST,REDIS_PORT, andREDIS_PASSWORD: private Redis settings.STORE_MODEL_IN_DB=True: allows model/provider config to be managed through LiteLLM.
After Deploy
- Open the LiteLLM public URL.
- Use the generated
LITELLM_MASTER_KEYfor admin/API access. - Add provider keys through the UI or admin API.
- Generate virtual keys for apps and teams.
- Send OpenAI-compatible requests to the Railway URL.
Support Checklist
If a deploy fails, include all service deployment IDs, /health/liveliness, /health/readiness, /ui, and logs mentioning Postgres migrations, Redis connection, DATABASE_URL, LITELLM_MASTER_KEY, or LITELLM_SALT_KEY.
Template Content
PORT
REDIS_HOST
REDIS_PORT
DATABASE_URL
LITELLM_MODE
REDIS_PASSWORD
LITELLM_SALT_KEY
STORE_MODEL_IN_DB
LITELLM_MASTER_KEY
USE_PRISMA_MIGRATE
postgres
postgres:17PGDATA
POSTGRES_DB
POSTGRES_USER
POSTGRES_PASSWORD
redis
redis:7REDIS_PASSWORD
RAILWAY_RUN_UID
