Railway

Deploy litellm-source-20260617

LiteLLM AI gateway with Postgres keys, Redis cache, and spend controls.

Deploy litellm-source-20260617

Just deployed

postgres

postgres:17

Just deployed

/var/lib/postgresql/data

redis

redis:7

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 port 4000
  • postgres: private app database for virtual keys, teams, provider config, and spend logs
  • redis: 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 with sk-.
  • LITELLM_SALT_KEY: generated encryption salt. Do not change it after adding provider keys.
  • DATABASE_URL: private Postgres connection string.
  • REDIS_HOST, REDIS_PORT, and REDIS_PASSWORD: private Redis settings.
  • STORE_MODEL_IN_DB=True: allows model/provider config to be managed through LiteLLM.

After Deploy

  1. Open the LiteLLM public URL.
  2. Use the generated LITELLM_MASTER_KEY for admin/API access.
  3. Add provider keys through the UI or admin API.
  4. Generate virtual keys for apps and teams.
  5. 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

postgres

postgres:17

redis

redis:7

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
[Jun'26] Self-improving AI agent with memory, skills, and web dashboard 🤖

codestorm
View Template
EchoDeck
Generate a mp4 from powerpoint with TTS

Fixed Scope