Deploy Antirion

Single-binary AI gateway: routing, virtual keys, spend, console

Deploy Antirion

Just deployed

/var/lib/antirion

Deploy and Host self hosted Antirion (AI Gateway) on Railway

This template runs the official Antirion 0.1.1 release as one Railway service with a persistent volume, giving you a single domain that serves the admin console and the OpenAI, Anthropic and Gemini compatible API.

About Hosting Antirion open-source software on Railway (self hosted Antirion template)

Antirion is open-source software under the Apache-2.0 license, so the code, the gateway and the console are yours to run.

Why Deploy Antirion, the open-source AI gateway on Railway (Railway Free Trial)

Antirion on Railway gives you a self-hosted gateway for your own API keys without running a server, and the free trial lets you test it before you commit.

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 Antirion 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 Antirion self hosting

Antirion needs a persistent volume and a public domain, so the choice is about how much setup you want to own.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanA template with the console, data plane, volume and HTTPS domain already wired.A Linux droplet where you install Docker, set up a reverse proxy and manage the volume.
AWSA service with a volume and generated admin token, with no IAM or load balancer to set up first.Deep networking and scaling control, but you assemble EC2, EBS and security groups before Antirion is reachable.
HetznerManaged deployment with no server to patch, back up or secure.Low-cost servers with generous bandwidth, where you handle the OS, Docker and data backups.

Choose Railway for the fastest path to a running gateway, and a VPS when you need full host control.

Common Use Cases for hosted Antirion

  • One endpoint for many providers: Point apps at a single OpenAI, Anthropic or Gemini compatible URL on your own domain, and Antirion routes to OpenAI, Azure, Anthropic, Bedrock, Gemini, Mistral and others. Changing models means changing a route, not every service.
  • Virtual keys per app or team: Give each service or team its own key with rate limits and a dollar or token budget. A runaway script exhausts its own allowance, not your shared provider key.
  • Fallback and least-latency routing: A failing or rate-limited provider hands the request to the next in a fallback chain, or traffic goes to the fastest backend. Every routing decision appears in the request log.
  • Cost ledger and request log: See what each key, team and model costs, with alerts before a budget runs out. Finance gets the month-end view without rebuilding spend from provider invoices.
  • Guardrails for PII and secrets: Screen prompts and responses for personal data and API keys, redacting them while keeping the request format intact so clients keep working.

Dependencies for Antirion Docker hosted on Railway

Antirion runs as one service built from ghcr.io/onepush-dev/antirion:0.1.1, a slim Debian image with the official release binary and Caddy.

Deployment Dependencies for Managed Antirion Service (a single Antirion service with a volume)

The template creates one Antirion service on PORT 8080 with a volume at /var/lib/antirion.

VariablePurpose
ANTIRION_BOOTSTRAP_TOKENGenerated admin token, pasted into the console.
ANTIRION_PUBLIC_ORIGINPublic origin, defaulted to your Railway domain.
ANTIRION_DATA_PLANE_URLData plane URL, defaulted to your Railway domain.

Implementation Details for Antirion (Using the onepush-dev image that copies the official 0.1.1 release binary and fronts both planes with Caddy on one domain)

Antirion serves the data plane on 8080 and the admin plane on 8081.

How does Antirion compare against other tools

Antirion vs LiteLLM (LiteLLM Alternative)

  • Packaging: Antirion ships as one Rust binary with the admin console built in, so there is no separate UI service to deploy next to the gateway.
  • Performance focus: Antirion is built around low per-request overhead on a single machine, which matters most when you push high request rates through one gateway.
  • Where LiteLLM wins: LiteLLM has a larger and longer-running open-source community, a broad Python ecosystem, and more third-party examples to borrow from.

Antirion vs Bifrost (Bifrost Alternative)

  • Footprint: Antirion aims for a small memory and CPU footprint, with one binary, one data thread per CPU and no interpreter or garbage collector to tune.
  • Feature surface: Both cover routing, virtual keys and budgets, so the choice often comes down to which console, provider list and config style fits your team.
  • Where Bifrost wins: Bifrost is a mature, widely used self-hosted gateway with a long track record in production, which may matter more than raw numbers for a risk-averse team.

Antirion vs OpenRouter (OpenRouter Alternative)

  • Hosting model: OpenRouter is a hosted router you sign up for, while Antirion runs in your own infrastructure, so your keys and request logs stay under your control.
  • Cost model: Antirion is Apache-2.0 software you run yourself, so you pay for hosting and the model providers you connect, with no separate router fee.
  • Where OpenRouter wins: OpenRouter needs no servers, no volume and no upkeep, and gives you one account to reach many models right away.

Antirion with Docker vs Antirion on Railway (Railway Deployment Comparison)

  • Setup effort: Running the upstream Docker image means you pick ports, a data volume and the admin token yourself, while the Railway template wires these for you.
  • Domain handling: On Railway one public domain fronts both the console and the API, with Caddy routing the paths, so you do not manage two listeners by hand.
  • Where Docker wins: A plain Docker host gives you full control over networking, reverse proxies and placement, which suits teams with an existing platform.

How to use Antirion on Railway?

  1. Wait for the Antirion service to turn green in your Railway project. The first boot generates the encryption key on the volume.
  2. Open your public domain with /ui/ added, for example https://your-domain/ui/. This is the admin console.
  3. Paste the value of ANTIRION_BOOTSTRAP_TOKEN from the Variables tab into the "Admin token" field and sign in.
  4. Add a provider and paste your LLM API key. The console stores it encrypted on the volume.
  5. Add a model that points at that provider.
  6. Create a virtual key for the app or team that will call the gateway.
  7. Send requests to your domain: /v1/chat/completions for OpenAI-style clients, /v1/messages for Anthropic, or /v1beta for Gemini.

Check that the service is up with one health call:

curl https://your-domain/healthz

A healthy instance returns a JSON body with a ready status and the running version.

How to self host Antirion on other VPS Services (Antirion self hosting guide)

Clone the Repository

Pull the upstream source if you want to read or build the code.

git clone https://github.com/eliasbiondo/antirion.git
cd antirion

Install Dependencies

You need Docker on the VPS. Open ports 8080 and 8081 in your firewall, or put a reverse proxy in front of them.

Configure Environment Variables

Antirion runs on its defaults, so you can start without setting anything.

docker volume create antirion-data

Start the Antirion Application

Run the container with both ports and the volume mounted.

docker run -p 8080:8080 -p 8081:8081 -v antirion-data:/var/lib/antirion eliasbiondo/antirion

Open the console at http://your-domain:8081/ui/ and send API traffic to http://your-domain:8080/v1.

Official Pricing of Antirion (Antirion pricing)

Antirion is open-source software released under the Apache-2.0 license, so there is no paid Antirion plan to buy and it is free to self-host.

Antirion hosted vs self hosted comparison (Pricing, features, costs, and more)

Antirion is free, Apache-2.0 open-source software with no hosted plan to compare against. Features are identical either way.

Monthly cost of self hosting Antirion on Railway

Your monthly cost depends on the memory and CPU the Antirion service uses, the size of the attached volume, and how many other services you add.

System Requirements for Hosting Antirion on a VPS

Run Antirion on a small Linux VPS with Docker installed, enough disk for the data volume, and enough memory for connections under load.

Frequently Asked Questions (FAQs)

Where do I find the admin token?

Railway generates it as the ANTIRION_BOOTSTRAP_TOKEN variable on the service, so you can copy it from the Variables tab.

Why is everything served from one domain?

Railway gives each service a single public domain and port, so Caddy routes /ui, /admin and /scim to the admin plane and sends the rest to the data plane.

How do my apps authenticate?

Apps authenticate with virtual keys that you create in the console and attach to a team or project with budgets and rate limits.

Does Antirion send email?

Only if you configure SMTP through the ANTIRION_SMTP_* settings. Without it, invites and password resets will not be delivered.

What must I back up?

Back up the volume mounted at /var/lib/antirion, because it holds the data store and the auto-generated encryption key.

Which client APIs are supported?

Clients can call the OpenAI-compatible /v1/chat/completions endpoint, the Anthropic-compatible /v1/messages endpoint, or the Gemini-style /v1beta endpoint.


Template Content

More templates in this category

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

okisdev
117
View Template
NEW
Weaviate
Vector database with hybrid search and an API key-protected API

zer0person
1
View Template
Möbius v0.1 Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1