Railway

Deploy LiteLLM

Unified LLM gateway — route to 100+ providers through one OpenAI-compatible

Deploy LiteLLM

Just deployed

Just deployed

Deploy and Host LiteLLM on Railway

LiteLLM is a unified API gateway that provides OpenAI-compatible endpoints for over 100 LLM providers, including OpenAI, Anthropic, Azure, Cohere, Mistral, Google Gemini, and AWS Bedrock. It includes spend tracking, rate limiting, and an admin dashboard.

About Hosting LiteLLM

LiteLLM runs as an API proxy that translates OpenAI-format requests to provider-specific formats behind the scenes. This template deploys the LiteLLM proxy alongside PostgreSQL for storing API keys, spend logs, and model configurations, and Redis for response caching and rate limiting. All three services are wired together automatically. The master key and salt key are auto-generated. Once deployed, you add your LLM provider API keys through the admin UI or API, create virtual keys with per-key budgets and rate limits, then point your applications at the LiteLLM endpoint as a drop-in replacement for any OpenAI SDK.

Common Use Cases

  • Routing LLM requests across multiple providers through a single OpenAI-compatible endpoint so you can switch models without code changes
  • Tracking and limiting LLM spend across teams and projects with per-key budgets and usage analytics
  • Load balancing requests across model deployments with automatic fallback to alternative providers on failure

Dependencies for LiteLLM Hosting

  • PostgreSQL (included in this template)
  • Redis (included in this template)

Deployment Dependencies

Implementation Details

Models can be added three ways: through the admin UI at your deployment URL, via the /model/new API endpoint, or by editing config.yaml in the repo. When STORE_MODEL_IN_DB=True (the default), model configurations added through the UI or API persist in PostgreSQL and survive redeployments without repo changes.

Resource Usage

This template deploys 3 services (LiteLLM proxy, PostgreSQL, Redis) with persistent volumes. Resource usage scales with API request volume and caching activity — expect moderate baseline costs from running three services.

Why Deploy LiteLLM 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 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.


Template Content

More templates in this category

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

okisdev
View Template
openui
Deploy OpenUI: AI-powered UI generation with GitHub OAuth and OpenAI API.

zexd
View Template
firecrawl
firecrawl api server + worker without auth, works with dify

Rama