Deploy personal-llm-gateway
Personal LiteLLM gateway with CLIProxyAPI accounts and virtual keys.
Just deployed
/var/lib/postgresql/data
Just deployed
/data
Just deployed
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:
- Open the
cliproxyapigenerated domain at/management.htmland sign in withCLIPROXY_MANAGEMENT_KEYfrom that service's Variables page. - Authorize each Claude, Antigravity, Codex, Kimi, Qwen, or other account separately.
- Open the
litellmgenerated domain at/uiand sign in withUI_USERNAMEandUI_PASSWORDfrom its Variables page. - Create a virtual key, select its allowed model IDs, and give that key to one client.
- 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
.envfile. - 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.0ghcr.io/aaronabuusama/personal-llm-gateway-cliproxyapi:v7.2.137ghcr.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
