Deploy OmniRoute — AI Gateway
Unified AI proxy. Route any LLM through one endpoint.
Redis
Just deployed
/data
Omniroute
Just deployed
/app/data
Deploy and Host OmniRoute on Railway
OmniRoute is a self-hosted LLM gateway that routes multiple AI providers through a single OpenAI-compatible endpoint. Connect providers such as OpenAI, Anthropic, Gemini, OpenRouter, Ollama, and other compatible APIs, then manage routing, fallback, API keys, usage, and model configuration from one dashboard.
About Hosting OmniRoute
This template deploys OmniRoute with Redis and persistent storage.
OmniRoute acts as a unified control layer between your applications and LLM providers. Instead of configuring different API endpoints and provider credentials in every application, clients connect to a single /v1 endpoint while OmniRoute handles provider selection, routing rules, failover, API keys, analytics, and optional prompt compression.
Application configuration is stored persistently under /app/data, while Redis provides a shared backend for rate limiting and runtime state.
Included Architecture
| Service | Purpose |
|---|---|
| OmniRoute | LLM gateway, dashboard, routing engine, and OpenAI-compatible API |
| Redis | Shared rate-limit and runtime state |
| OmniRoute Volume | Persistent providers, routing configuration, API keys, and SQLite data |
| Redis Volume | Persistent Redis data |
| Health Check | Verifies gateway availability |
Applications / AI Tools
│
│ OpenAI-compatible API
▼
┌────────────────────┐
│ OmniRoute │
│ │
│ Routing / Fallback │
│ Keys / Analytics │
│ Dashboard │
└─────────┬──────────┘
│
┌─────────┴─────────┐
│ │
▼ ▼
Persistent Volume Redis
/app/data Rate Limit State
│
▼
SQLite / Config
│
▼
LLM Providers
Common Use Cases
- Route multiple LLM providers through one endpoint
- Use one OpenAI-compatible API across different AI models
- Centralize provider credentials
- Configure automatic provider fallback
- Create gateway API keys for applications or users
- Route coding tools through a self-hosted gateway
- Monitor AI usage and provider performance
- Apply rate limits across gateway clients
- Create stable model aliases independent of providers
- Reduce provider lock-in
- Add prompt compression to selected routes
- Keep LLM credentials on infrastructure you control
OmniRoute vs Direct Provider Integration
| Feature | OmniRoute | Direct Integration |
|---|---|---|
| Unified endpoint | ✅ Yes | ❌ Separate endpoints |
| Multiple providers | ✅ Yes | ⚠️ Integrate manually |
| OpenAI-compatible API | ✅ Yes | ⚠️ Provider dependent |
| Automatic fallback | ✅ Yes | ❌ Build manually |
| Central API keys | ✅ Yes | ❌ Provider-specific |
| Routing rules | ✅ Yes | ❌ Application logic |
| Usage analytics | ✅ Centralized | ⚠️ Provider-specific |
| Shared rate limiting | ✅ Redis-backed | ❌ Build separately |
OmniRoute is especially useful when several tools or applications need access to different models without carrying provider-specific configuration everywhere.
OpenAI-Compatible Gateway
Applications connect to OmniRoute using:
https:///v1
This allows many tools that already support an OpenAI-compatible base URL to use OmniRoute without requiring a custom integration.
Typical clients include:
- OpenAI SDK-compatible applications
- AI agents
- Automation workflows
- Coding assistants
- Internal applications
- Development tools
After deployment, create a gateway API key from the OmniRoute dashboard and configure that key in your client.
Persistent Storage
OmniRoute stores its application state under:
/app/data
The persistent volume keeps important data across restarts and redeployments, including:
- Provider connections
- Provider credentials
- Generated API keys
- Routing rules
- Model aliases
- Gateway configuration
- Usage information
- SQLite application data
The /app/data mount is important because OmniRoute's state is SQLite-backed. A volume mounted somewhere else will not persist this data correctly.
Redis
Redis is included as a shared backend for gateway rate limiting and runtime state.
OmniRoute can operate without Redis using process-local rate limiting, but this template includes Redis to provide a dedicated shared state layer and a stronger foundation for future scaling.
Redis communicates with OmniRoute through Railway private networking and does not need to be publicly exposed.
Getting Started
- Deploy the template.
- Wait until OmniRoute and Redis are online.
- Open the public Railway URL assigned to OmniRoute.
- Open the OmniRoute service Variables page.
- Copy the generated:
INITIAL_PASSWORD
- Sign in to the OmniRoute dashboard.
- Change the initial password if desired.
- Add one or more LLM providers.
- Configure models, aliases, or routing rules.
- Generate a gateway API key.
- Configure your application to use:
https:///v1
OmniRoute ships without provider credentials, so you need to add your own provider API keys before requests can be routed.
Provider Routing and Fallback
OmniRoute can place multiple providers behind the same gateway.
For example:
Application
│
▼
model: coding
│
▼
OmniRoute
│
├── Primary → Anthropic
├── Fallback → OpenAI
└── Fallback → Gemini
This allows applications to use stable gateway-side model definitions while provider selection can be changed centrally.
Depending on your configuration, OmniRoute can also provide automatic fallback when a provider becomes unavailable or rate-limited.
Prompt Compression
OmniRoute supports optional prompt-compression workflows that can reduce the context sent to selected models.
This can be useful for:
- Large coding contexts
- Long conversations
- Agent workflows
- Reducing token usage
- Cost optimization
Compression is optional and can be configured from OmniRoute rather than being required by this template.
Health Check
The template can monitor OmniRoute using:
/api/monitoring/health
This endpoint is used by existing OmniRoute Railway deployments as the application health endpoint.
Railway uses deployment health checks to verify that a new deployment responds successfully before making it active.
Security Considerations
OmniRoute stores credentials that can provide access to external AI providers.
For production environments:
- Keep provider API keys private.
- Require gateway API keys for
/v1requests. - Do not expose Redis publicly.
- Keep JWT and API-key secrets persistent across deployments.
- Use dedicated gateway keys for applications instead of sharing provider credentials.
- Protect access to the OmniRoute dashboard.
- Back up important persistent data before major upgrades.
Changing secrets used to protect existing stored credentials may invalidate sessions or previously encrypted application data.
Dependencies for OmniRoute Hosting
- OmniRoute — unified LLM gateway and administration dashboard
- Redis — shared rate-limit and runtime backend
- Persistent Volume — stores OmniRoute SQLite data and configuration
- Railway Private Networking — internal OmniRoute-to-Redis communication
- Railway Public Networking — HTTPS access to the dashboard and
/v1API - LLM Provider Credentials — supplied by the user after deployment
Deployment Dependencies
- OmniRoute GitHub: https://github.com/diegosouzapw/OmniRoute
- OmniRoute Docker Image: https://hub.docker.com/r/diegosouzapw/omniroute
- Railway Redis: https://docs.railway.com/databases/redis
- Railway Networking: https://docs.railway.com/networking
- Railway Volumes: https://docs.railway.com/volumes
Why Deploy OmniRoute 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 OmniRoute on Railway, you get a self-hosted LLM gateway with persistent configuration, Redis-backed runtime state, provider routing, fallback, API-key management, health monitoring, and one OpenAI-compatible endpoint for your AI applications.
Template Content
Redis
redis:8.2Omniroute
diegosouzapw/omniroute:latest