---
title: "Deploy personal-llm-gateway"
description: "Personal LiteLLM gateway with CLIProxyAPI accounts and virtual keys."
category: "AI/ML"
url: https://railway.com/deploy/personal-llm-gateway
---

# Deploy personal-llm-gateway

Personal LiteLLM gateway with CLIProxyAPI accounts and virtual keys.

**[Deploy personal-llm-gateway on Railway](https://railway.com/template/personal-llm-gateway)**

- **Creator:** Aaron Abu Usama's Projects
- **Category:** AI/ML
- **Total deploys:** 1

## Template content

### postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### cliproxyapi

- **Image:** ghcr.io/aaronabuusama/personal-llm-gateway-cliproxyapi:v7.2.137@sha256:a1ea03be9493717bae0c55438707fcc70896118fd8bfbaf7cc5508f136124851
- **Health check:** /management.html
- **Public domain:** Yes

### litellm

- **Image:** ghcr.io/aaronabuusama/personal-llm-gateway-litellm:v1.97.0@sha256:c8a7241be92ceac5f4b712a6752859c9e4e884c626d08b5c47037705fa1a042b
- **Health check:** /health/liveliness
- **Public domain:** Yes

## Documentation

# Deploy and Host Personal LLM Gateway on Railway

Deploy a three-service personal LLM gateway with a public LiteLLM endpoint, a CLIProxyAPI provider-account broker, PostgreSQL-backed virtual keys, and persistent OAuth state.

## About Hosting Personal LLM Gateway

The template creates `litellm`, `cliproxyapi`, and `postgres`. LiteLLM is the client-facing OpenAI-compatible gateway and virtual-key manager. CLIProxyAPI authenticates coding subscriptions and stores their credentials in a `/data` volume. PostgreSQL stores LiteLLM users, keys, budgets, and usage state. All service secrets are generated automatically and the app-to-app request path uses Railway private networking.

Provider credentials are not bundled. After deployment, sign in to the generated CLIProxyAPI `/management.html` page and complete each provider OAuth flow.

After deployment:

1. Open the `cliproxyapi` generated domain at `/management.html` and sign in with `CLIPROXY_MANAGEMENT_KEY` from that service's Variables page.
2. Authorize each Claude, Antigravity, Codex, Kimi, Qwen, or other account separately.
3. Open the `litellm` generated domain at `/ui` and sign in with `UI_USERNAME` and `UI_PASSWORD` from its Variables page.
4. Create a virtual key, select its allowed model IDs, and give that key to one client.
5. Configure the client with `https:///v1`; never give it the LiteLLM master key or CLIProxyAPI key.

## Why Deploy Personal LLM Gateway on Railway?

- Deploy all three services and both persistent stores together.
- Keep the provider broker private from normal client traffic.
- Generate deployment-specific secrets without committing an `.env` file.
- Retain CLIProxyAPI accounts and LiteLLM virtual keys across restarts.
- Attach a custom domain to the one client-facing LiteLLM endpoint.

## Common Use Cases

- Give several coding tools one OpenAI-compatible base URL.
- Issue a separate model-scoped key to each laptop, agent, or automation.
- Share traffic across several eligible coding-subscription accounts.
- Revoke a client key without re-authenticating provider accounts.
- Keep provider administration separate from client-key administration.

## Dependencies for Personal LLM Gateway Hosting

The template uses public, multi-architecture GHCR images pinned by digest. It does not require access to the private source repository.

### Deployment Dependencies

- Railway account and workspace
- `ghcr.io/aaronabuusama/personal-llm-gateway-litellm:v1.97.0`
- `ghcr.io/aaronabuusama/personal-llm-gateway-cliproxyapi:v7.2.137`
- `ghcr.io/railwayapp-templates/postgres-ssl:18`
- Provider accounts to authorize after deployment

CLIProxyAPI selects an eligible account for the requested model. It does not silently replace one model with another. Repository collaborators can find complete backup, rotation, upgrade, migration, and smoke-test instructions in `docs/operations-guide.md`.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/personal-llm-gateway
