
Deploy LiteLLM (Self-Hosted AI Gateway)
Self-hosted LLM proxy for any model, with keys, budgets, and usage logs.
postgres
Just deployed
/var/lib/postgresql/data
litellm
Just deployed
Deploy and Host LiteLLM on Railway
LiteLLM is an open-source AI gateway that puts 100+ LLM providers — OpenAI, Anthropic, Google, Azure, Bedrock, local models, and more — behind a single OpenAI-compatible API. Instead of wiring each app to a different provider SDK, you point everything at LiteLLM and manage virtual API keys, per-team budgets, rate limits, fallbacks, and full request logging from one dashboard. This template deploys the LiteLLM proxy backed by a managed PostgreSQL database, so keys, teams, models, and spend are stored durably and managed from the built-in Admin UI. It boots ready to use with no model pre-configuration required. [Updated August '26]
About Hosting LiteLLM
LiteLLM runs as a stateless proxy that stores all of its configuration — virtual keys, teams, models, and usage logs — in PostgreSQL. This template provisions the proxy plus a dedicated Postgres database, connected over Railway's private network, and runs the database migrations automatically on first boot. A master key and salt key are auto-generated, and the Admin UI is available at /ui immediately after deploy. You add your provider API keys and models through the UI — nothing needs to be configured before the first deploy.
Common Use Cases
- Running a single OpenAI-compatible endpoint in front of many LLM providers for all your apps
- Issuing scoped virtual API keys with per-team budgets, rate limits, and spend tracking
- Centralizing LLM request logging, fallbacks, and load balancing across models
Dependencies for LiteLLM Hosting
- A PostgreSQL database (included as a service in this template) for keys, teams, and logs
- At least one upstream LLM provider API key (OpenAI, Anthropic, etc.), added via the Admin UI after deploy
Why Deploy LiteLLM on Railway?
Railway provisions the LiteLLM proxy and its PostgreSQL database in one click, with private networking and a public domain already wired up. Prisma migrations run automatically on boot, and the master key, salt key, and admin password are generated for you — so you land on a working Admin UI instead of a config error. Add your provider keys, then scale the gateway up as your traffic grows, all from a single dashboard.
Template Content
postgres
postgres:16