Deploy LiteLLM AI Gateway
Pinned LiteLLM gateway + Postgres + Redis: 100+ LLMs, keys, budgets
LiteLLM
Just deployed
Postgres
Just deployed
/var/lib/postgresql
Redis
Just deployed
Deploy and Host LiteLLM AI Gateway on Railway
LiteLLM is an open-source AI gateway: one OpenAI-compatible API in front of 100+ LLM providers (OpenAI, Anthropic, OpenRouter, Gemini, Bedrock, Ollama...), with virtual keys, per-key budgets, rate limits and spend tracking.
About Hosting LiteLLM AI Gateway
This template runs the official LiteLLM proxy image pinned by digest (v1.108.13, after the 2026 supply-chain incidents that hit floating tags), with Postgres for keys, models and spend logs and Redis for rate-limit/budget coordination. It deploys with zero inputs: all secrets are generated for you.
Common Use Cases
- One API key per app/team with budgets, instead of sharing provider keys
- Switch or load-balance between OpenAI, Anthropic, OpenRouter and others without code changes
- Track and cap LLM spend per key, user or team
Dependencies for LiteLLM AI Gateway Hosting
- Postgres 17 (included, private network)
- Redis 8 (included, private network, 64 MB cap)
Deployment Dependencies
- Upstream project: https://github.com/BerriAI/litellm
- Template repo with docs, upgrade and backup guide: https://github.com/TalhaRamzan/railway-litellm-gateway
Implementation Details
- Admin UI at
/ui: usernameadmin, password in LiteLLM → Variables →UI_PASSWORD(separate from the master key). LITELLM_SALT_KEYencrypts stored provider keys: back it up and never change it.- Swagger is hidden and the root URL opens the login page. Lean defaults: 1 worker. Expect roughly $9–14/month on Railway at light traffic.
- Any default (workers, log level, docs) can be overridden by adding the variable to the
LiteLLMservice.
Why Deploy LiteLLM AI Gateway on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying LiteLLM AI Gateway on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Unofficial community template, not affiliated with BerriAI. LiteLLM is MIT-licensed.
Template Content

