llm-router

One OpenAI-compatible endpoint in front of several model servers

Get started GitHub ↗

What it does

Register the model servers you use — OpenAI, OpenRouter, Ollama, llama.cpp, vLLM, anything that speaks the OpenAI API — and group them into workspaces. A client pointed at a workspace sees one /v1 that lists every model its providers offer and sends each request to the right one. It is the model-server counterpart of mcp-router.

What it looks like

The Providers page: Ollama, OpenAI and OpenRouter, each with its base URL, how many models it lists and whether a key is set, above the connection details for the global endpoint
Providers. The model count next to each one shows the router can reach it.
A workspace page: a switch per provider, with OpenRouter limited to two models, and the five model ids the workspace serves
A workspace. Switch providers on, narrow one to the models you want, and copy the ids a client asks for.

Get started

With Docker:

git clone https://github.com/cubicecho/llm-router.git
cd llm-router
docker compose up --wait     # http://localhost:3000, with its own Postgres

Or from source, with Node 26 or newer:

npm install
cp .env.example .env
npm run db:up                # a local Postgres, in Docker
npm run dev                  # UI on http://localhost:3000

2.0 has no auth: anyone who can reach the port can use your providers and change them, so run it on a network you trust until #21 brings sign-in and API keys. Then:

  1. Providers → Add provider. A name (ollama), the base URL including the version path (http://localhost:11434/v1) and, if it needs one, an API key.
  2. Workspaces → New workspace. Switch on the providers it should serve.
  3. Copy the connection details from the workspace page.

Connect a client

Base URL http://<host>:3000/w/<slug>/v1 for a workspace, http://<host>:3000/v1 for every enabled provider
API key any value, such as unused: the router does not check it yet
Model <provider>/<model>, such as ollama/qwen3:32b
curl http://localhost:3000/w/research/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "ollama/qwen3:32b", "messages": [{"role": "user", "content": "Hello"}]}'
from openai import OpenAI

client = OpenAI(base_url="http://localhost:3000/w/research/v1", api_key="unused")
client.chat.completions.create(model="ollama/qwen3:32b", messages=[{"role": "user", "content": "Hello"}])