
Deploy Deploy Yolorouter LLM Gateway
Self-hosted OpenAI-compatible LLM gateway with failover and keys
Yolorouter
Just deployed
/yolorouter
Deploy and Host self hosted Yolorouter (LLM Gateway) on Railway
This template deploys Yolorouter, an open-source LLM gateway, as a single Go service with an admin console on Railway.
About Hosting Yolorouter open-source software on Railway (self hosted Yolorouter template)
This template runs the Yolorouter v0.2.9 image as one Go application, with a persistent volume at /yolorouter holding the generated config and the SQLite database.
You still choose your upstream provider keys, the models you expose, and the client keys you issue. Back up the volume, because deleting the service does not keep a copy of that data.
Why Deploy Yolorouter, the open-source LLM gateway on Railway (Railway Free Trial)
Yolorouter on Railway runs as one Go service with SQLite and your config on a single volume, and you keep your own upstream keys.
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 Yolorouter 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.
Railway vs Other Hosting Providers and VPS for Yolorouter self hosting
The choice depends on how much server work you want to own.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | Managed deploy, admin password generated, volume attached. | A Droplet you provision and maintain yourself. |
| AWS | A single service and volume set up for you. | Broad networking and storage control, configured by hand. |
| Hetzner | A quick hosted deploy. | Low-level access on a VPS you manage. |
For a predictable single-node setup with little upkeep, managed is simpler.
Common Use Cases for hosted Yolorouter
- OpenAI and Anthropic clients: Point an OpenAI SDK at the /v1 base URL, or an Anthropic client at the bare origin, and both keep working against the same deployment. It translates between the wire protocols, so one gateway serves both.
- Provider failover: Map a public model name to an ordered list of provider candidates. If the first one fails, requests move to the next, and callers keep using the same model name.
- Upstream key pools: Load several upstream keys under one provider so traffic spreads across them. A rate-limited key is set aside for its retry window while healthier keys take the load.
- Per-key budgets: Issue separate client keys with their own model allowlists, rate limits, and cumulative spending caps. Revoke any key instantly without touching the others.
- Multi-user model access: Give team members access to the models they need through their own accounts. Admins control available models, and each member manages their own keys and sees only their usage.
Dependencies for Yolorouter Docker hosted on Railway
This template runs the community-maintained onepush-dev/yolorouter:0.2.9 image, which wraps the unmodified upstream Yolorouter image with a small admin bootstrap on a private port.
Deployment Dependencies for Managed Yolorouter Service (one Go application with SQLite and config on /yolorouter volume)
The console is embedded in the Go app, with no separate frontend. SQLite and config share the /yolorouter volume.
Implementation Details for Yolorouter (onepush-dev/yolorouter:0.2.9 wraps unmodified upstream image with private-port admin bootstrap)
The wrapper starts the unchanged upstream binary and applies your admin password on first boot, with no setup screen.
How does Yolorouter compare against other tools
Yolorouter vs LiteLLM (Open-Source LLM Gateway Alternative)
- Packaging: Yolorouter ships as a single Go binary with the console embedded and SQLite by default. LiteLLM is a Python project that often needs a separate database.
- Routing: Yolorouter maps one public model name to an ordered list of provider candidates, with failover and an upstream key pool per provider.
- Admin: Yolorouter includes a multi-user console with per-key budgets and model allowlists.
Yolorouter vs OpenRouter (Hosted Model Router Alternative)
- Hosting: OpenRouter is a hosted service you sign up for, while Yolorouter is software you run yourself. OpenRouter wins if you want no servers to operate.
- Keys: With Yolorouter you bring your own upstream provider keys and keep them in your own deployment. OpenRouter bills usage through its hosted service. With Yolorouter, your upstream providers bill you directly, and those usage charges are separate from any hosting costs.
Yolorouter vs Bifrost (Open-Source LLM Gateway Alternative)
- Language: Yolorouter is a Go binary with the console embedded. Compare Bifrost on features that matter to your team.
- Protocols: Yolorouter accepts OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, and Gemini generateContent ingress, and can translate between them.
- Deployment: Yolorouter runs on Docker, as a system service, or on Railway with one mounted volume for config and the database. Keep one replica for local persistent state.
Yolorouter with Docker vs Railway
- Control: Running the Docker image yourself gives full control over the host, networking, and backups. Railway handles the hosting layer, so there is less to operate.
- Persistence: On both paths your config and SQLite database live in the mounted volume, so back that location up wherever you deploy.
- Cost: Railway usage is metered by resources consumed, while Docker on your own host is billed by the server you rent. Model providers bill usage separately in both cases.
How to use Yolorouter on Railway?
After the deploy finishes, work through these steps.
- Open your Railway public domain and sign in as
adminwith the password you set inYOLOROUTER_ADMIN_PASSWORD. Change it in the console once you are in. - Add a provider and paste in your own upstream API key. Yolorouter does not include any model credits, so you bring your own account.
- Import the models you want from the provider's catalogue. Each one is verified against the real upstream in the background and enabled automatically when the check passes.
- Issue an
sk-yr-client key for your application. Use this key in your apps, not the admin password. - Point clients at your gateway. For OpenAI-compatible SDKs use base URL
https://your-domain/v1. For Anthropic-style clients use the bare originhttps://your-domain.
Confirm the service is healthy with a request to the health endpoint:
curl https://your-domain/healthz
How to self host Yolorouter on other VPS Services (Yolorouter self hosting guide)
Clone the Repository
Start from the upstream project to read the code and pin a release. This guide targets v0.2.9.
git clone https://github.com/yolorouter/yolorouter.git
cd yolorouter
git checkout v0.2.9
Install Dependencies
The simplest path is the upstream Docker image, so you need Docker and Docker Compose on your VPS. Pull the image rather than building from source.
docker pull ghcr.io/yolorouter/yolorouter:v0.2.9
Configure Environment Variables
Keep the config and database in a persistent folder mounted at /yolorouter so they survive container replacement.
Start the Yolorouter Application
Run the container with the persistent mount, bound to localhost only. Create the admin account privately before exposing the service through any public proxy, then add provider keys.
docker run -d --name yolorouter --restart unless-stopped \
-p 127.0.0.1:8080:8080 -v "$PWD/yolorouter:/yolorouter" \
ghcr.io/yolorouter/yolorouter:v0.2.9
Railway handles the container runtime, volume, and HTTPS, so this manual setup is only for your own VPS.
Official Pricing of Yolorouter (Yolorouter pricing)
Yolorouter is Apache-2.0 open-source software, free to self-host. Check Railway usage after week one for a real baseline.
Yolorouter hosted vs self hosted comparison (Pricing, features, costs, and more)
The upstream project offers a hosted option, but this template covers only self-hosting.
Monthly cost of self hosting Yolorouter on Railway
Railway bills by usage: RAM and CPU, volume size, and any other attached services.
System Requirements for Hosting Yolorouter on a VPS
Yolorouter ships as one Go binary with SQLite and config in one mounted folder, so it needs no database server or Node runtime.
Frequently Asked Questions (FAQs)
Where do I find the admin password?
The template generates a password for the admin account (username admin) on first boot and exposes it as the YOLOROUTER_ADMIN_PASSWORD variable, so read it from the service variables in Railway. The password initializes the admin account on first boot; treat it as a startup credential and change it in the console after signing in.
Is the admin password the same as a client API key?
No. Keep them apart so a leaked client key never exposes the admin account.
Does the deploy include model credits?
No. Nothing is pre-funded on your behalf.
Why should I keep config.yaml on the volume?
The generated config.yaml holds the master key that encrypts your upstream provider keys, so losing it means losing access to those stored keys.
Can I use a custom domain?
Yes. Set the optional YOLOROUTER_EXTERNAL_URL variable to the full HTTPS origin of your custom domain (for example https://gateway.example.com) so OAuth callbacks and generated URLs use it. This variable is not exposed as a template prompt, so add it manually in the service variables.
Can I scale to multiple replicas?
Not safely with the default setup, since state lives in a local SQLite database on one volume. Keep a single replica so only one process writes to it.
Template Content
Yolorouter
ghcr.io/onepush-dev/yolorouter:0.2.9
