
Deploy Bifrost
Fast Go LLM gateway with dashboard, virtual keys, budgets and fallbacks
Bifrost
Just deployed
Deploy and Host Bifrost on Railway
Bifrost is an open-source LLM gateway written in Go. It puts one OpenAI-compatible endpoint in front of OpenAI, Anthropic, Bedrock, Vertex, Azure, Mistral, Groq, Ollama and more, with a built-in dashboard for providers, virtual keys, budgets, fallbacks, semantic caching, MCP tools, and request logs.
About Hosting Bifrost
Hosting Bifrost is a single container. This template uses the official maximhq/bifrost:v2.1.1 image with a Railway volume mounted at /app/data, which is where Bifrost keeps its SQLite configuration store and request logs, the same layout as the upstream Docker Compose example. PORT and APP_PORT are pinned to 8080 so Railway's healthcheck hits /health on the right port, APP_HOST is :: so other Railway services can reach it over IPv6 private networking, and RAILWAY_RUN_UID=0 works around the image's non-root user against Railway's root-owned volumes. An encryption key and a one-time setup token are generated for you.
Common Use Cases
- Unified LLM API: one base URL for every provider, with
provider/modelnaming - Drop-in SDK replacement: point the OpenAI, Anthropic, or GenAI SDK at
/openai,/anthropic, or/genai - Virtual keys and budgets: per-team or per-app keys with spend and rate limits
- Fallbacks and load balancing: retry across keys, models, and providers
- Observability: request logs in the dashboard, Prometheus
/metrics, OTel export - Private gateway for other Railway services: keep provider keys off your app containers
Dependencies for Bifrost Hosting
- Railway volume at
/app/data(included) - Provider API keys: optional at boot;
OPENAI_API_KEY/ANTHROPIC_API_KEYare auto-registered on first boot, or add any provider in the dashboard - No database service required: SQLite is the OSS default. PostgreSQL 16+ is an optional alternative
Deployment Dependencies
- Bifrost deployment requirements
- Bifrost on Railway (upstream guide)
- Setting up auth
- Bifrost GitHub repository
Implementation Details
The image entrypoint runs /app/main -app-dir "$APP_DIR" -port "$APP_PORT" -host "$APP_HOST", so no custom start command is needed. Key variables:
PORT=8080
APP_PORT=8080
APP_HOST=::
APP_DIR=/app/data
RAILWAY_RUN_UID=0
BIFROST_ENCRYPTION_KEY=${{secret(64,"abcdef0123456789")}}
BIFROST_SETUP_TOKEN=${{secret(32)}}
First steps after deploy
- Wait for
/healthto return{"status":"ok"}. - Open the dashboard at your Railway domain.
- Go to Workspace → Config → Security, turn on Password protect the dashboard, set a username and password, and paste the
BIFROST_SETUP_TOKENvalue into Setup token. Until you do this the dashboard is open to anyone with the URL. - Add a provider and create a virtual key, then send requests with the
x-bf-vkheader.
Never rotate BIFROST_ENCRYPTION_KEY after first boot; stored secrets become unreadable. Keep one replica: SQLite is single-process and Railway volumes do not support replicas.
Why Deploy Bifrost 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 Bifrost on Railway, you get a pinned, health-checked LLM gateway with persistent storage, generated secrets, managed SSL, and private networking to the rest of your Railway project.
Template Content
Bifrost
maximhq/bifrost:v2.1.1