
Deploy 9Router Continue
Point the Continue extension at your own AI router
9router
Just deployed
/app/data
Deploy and Host self hosted 9Router Continue (Self-Hosted AI Router for Continue in VS Code and JetBrains) on Railway
This template runs your own 9Router on Railway, giving Continue in VS Code and JetBrains one OpenAI-compatible URL. Deploy once, then point config.yaml at it.
About Hosting 9Router Continue open-source software on Railway (self hosted 9Router for the Continue extension template)
This template runs one 9Router container from the official decolua/9router image, pinned to a specific digest, with a Railway volume mounted at /app/data.
Why Deploy 9Router Continue, the OpenRouter alternative on Railway (Railway Free Trial)
OpenRouter bills per token on top of the providers and keeps the routing in its hands.
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 9Router Continue 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 9Router Continue self hosting
Running this self-hosted 9Router on Railway trades some monthly savings for less setup than a plain VPS.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | One-click deploy, a persistent volume for SQLite at /app/data, and a public HTTPS domain. | A cheap droplet where you manage Docker, TLS, and backups yourself. |
| AWS | Managed networking with no VPC or security group setup. | Deep control over instances and IAM, with far more moving parts than one container needs. |
| Hetzner | Volume and secrets already wired, with no SSH or reverse proxy work. | Some of the lowest raw prices for RAM and storage, if you run your own server. |
Railway suits a router that only needs to serve your own Continue clients.
Common Use Cases for hosted 9Router Continue
- One endpoint for chat and edit: Point the chat and edit roles at the same https://your-domain/v1 base URL, so every Continue request in VS Code or JetBrains uses one router and one key.
- Autocomplete on a cheap fast model: Autocomplete fires on every pause in typing, so give it a small, fast model and keep your heavier model for chat.
- Fallback when a subscription hits limits: Put a 9Router combo name in the model field, and Continue keeps working on the next provider when one is rate limited.
- A shared router for a team: Run one instance for everyone, give each person their own key from the dashboard, and configure Continue the same way in JetBrains or VS Code.
- Usage tracking per key: Separate keys show which teammate drove which requests, which helps you see where provider quota is going.
Dependencies for 9Router Continue Docker hosted on Railway
The whole stack is one service, which keeps the operator side small.
Deployment Dependencies for Managed 9Router Continue Service (AI Router)
- Image: decolua/9router pinned to version 0.5.95 by digest, so a rebuild doesn't pull in a surprise upgrade.
- Port: 20128, with the health check at /api/health. The dashboard lives at /dashboard and the OpenAI-compatible API at /v1.
- Volume: mount at /app/data. SQLite lives at $DATA_DIR/db/data.sqlite and backups land in $DATA_DIR/db/backups/. Lose this volume and you lose your providers, combos and API keys.
- Generated secrets: INITIAL_PASSWORD, JWT_SECRET, API_KEY_SECRET and MACHINE_ID_SALT.
Implementation Details for 9Router Continue (Using 9Router official docker image)
The fixed variables are PORT=20128, HOSTNAME=0.0.0.0, DATA_DIR=/app/data, plus BASE_URL and NEXT_PUBLIC_BASE_URL set to your public domain.
How does 9Router Continue compare against other ways to power the Continue extension
9Router vs OpenRouter (Hosted AI Router Alternative)
- Where OpenRouter wins: It is hosted, so there is nothing to deploy, and one key covers a large model catalog. For a quick start it is faster.
- Where 9Router wins: The router, your provider keys and usage history run on your own Railway service. Combos chain your own subscriptions and free tiers with automatic fallback.
- Trade-off: OpenRouter adds its own per-token markup, while 9Router is free software and you pay your providers directly. You handle uptime and upgrades yourself.
9Router vs LiteLLM (Open Source Python Proxy Alternative)
- Where LiteLLM wins: It is mature and offers deep enterprise routing, spend limits and logging. If your team already runs it, keep it.
- Where 9Router wins: It ships as one container with a SQLite file and a dashboard, so a Continue config only needs an apiBase and an apiKey.
- Trade-off: LiteLLM gives finer control over routing rules at the cost of more setup. 9Router trades some depth for a quicker working setup.
9Router vs Ollama for Continue (Local Model Alternative)
- Where Ollama wins: Everything runs locally, so code never leaves your machine and there are no provider costs. It suits offline or privacy-bound work.
- Where 9Router wins: You get frontier cloud models in Continue chat and edit, plus fallback when one provider is rate limited.
- Trade-off: Local models need real hardware, and laptop autocomplete can feel slow. Many people pair Ollama for autocomplete with 9Router for chat and edit.
9Router vs Continue Hub models (Hosted Continue Model Configs)
- Where Continue Hub wins: It is Continue's own hosted model config, so setup happens inside the extension with less YAML.
- Where 9Router wins: You choose which providers sit behind the endpoint and can share one router across a team with a key per person.
- Trade-off: A self-hosted router is one more service to keep running. If you work alone and the hub defaults suit you, it may be less work.
How to use 9Router Continue (the OSS AI model router)?
- Open https://your-domain/dashboard and log in with your INITIAL_PASSWORD.
- Connect your providers on the providers page.
- For fallback, create a combo listing two or three models in order.
- Create an API key and copy it.
- Open Continue's config.yaml from the Continue settings in VS Code or JetBrains.
- Add a model with provider openai, your combo or model id, apiBase, and apiKey.
- Reload Continue and send a short chat to confirm it answers.
name: 9Router Continue
version: 1.0.0
schema: v1
models:
- name: 9Router Chat
provider: openai
model: your-combo-or-model-id
apiBase: https://your-domain/v1
apiKey: your-9router-api-key
roles:
- chat
- edit
- name: 9Router Autocomplete
provider: openai
model: a-small-fast-model-id
apiBase: https://your-domain/v1
apiKey: your-9router-api-key
roles:
- autocomplete
Keep autocomplete on a small, fast model, since it fires on every pause while you type.
How to self host 9Router Continue on other VPS Services (9Router self hosting guide)
Clone the Repository
Clone the 9Router source and check out the tag the template uses.
git clone https://github.com/decolua/9router.git
cd 9router
git checkout v0.5.95
Install Dependencies
Install the packages and build. Skip this if you run the official Docker image instead.
npm install
npm run build
Configure Environment Variables
Create a .env file matching the Railway template. Use long random secrets and set your public domain so the dashboard and Continue's apiBase line up.
PORT=20128
HOSTNAME=0.0.0.0
DATA_DIR=/app/data
BASE_URL=https://your-domain
NEXT_PUBLIC_BASE_URL=https://your-domain
REQUIRE_API_KEY=true
INITIAL_PASSWORD=change-me-now
JWT_SECRET=your-long-random-secret
API_KEY_SECRET=your-long-random-secret
MACHINE_ID_SALT=your-long-random-salt
Start the 9Router Continue Application
Start the server and check the health endpoint.
npm run start
curl https://your-domain/api/health
Railway handles HTTPS, the persistent volume for your SQLite data, and restarts, which is most of the work you would otherwise do by hand on a VPS.
Official Pricing of 9Router Continue (9Router pricing)
9Router itself is free and open source under the MIT license, so there is no paid 9Router plan to buy. Continue is also free to install in VS Code or JetBrains.
9Router Continue cloud vs self hosted comparison (Pricing, features, costs, and more)
Self hosting 9Router Continue means you pay for the server and your model providers, and nothing more. A hosted router adds a platform fee on top of token costs.
Monthly cost of self hosting 9Router Continue on Railway
Railway usage for this template runs roughly $3-8 per month for one user, and the $5 trial covers the first stretch.
System Requirements for Hosting 9Router Continue on a VPS
One user runs comfortably on about 512 MB of RAM, plus a small persistent volume at /app/data for the SQLite database and backups.
Frequently Asked Questions (FAQs)
Which provider value do I use in config.yaml?
Use provider: openai for 9Router, since it speaks the OpenAI-compatible API.
Why is autocomplete so slow?
Autocomplete fires on every pause in typing, so a large model will feel sluggish.
Can I use this in JetBrains as well as VS Code?
Yes.
Where does the config.yaml file live?
It sits in your Continue config directory, usually ~/.continue/config.yaml. You can also open it from the Continue extension settings inside your IDE.
Does Continue send my code to the router?
Continue sends the prompt context it builds for each request to whichever model you configure, and that now goes through your own 9Router instance.
What happens if I use a wrong model id?
The request fails because 9Router can't find a matching model or combo.
Template Content
9router
decolua/9router:0.5.95
