Railway

Deploy personal-llm-gateway

Personal LiteLLM gateway with CLIProxyAPI accounts and virtual keys.

Deploy personal-llm-gateway

/var/lib/postgresql/data

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.


Template Content

More templates in this category

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

okisdev
116
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
3
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
62