Your machines run the models. The cloud only fills the gaps. Call every model through one OpenAI format — self-hosted, and yours to own.
LLMrPro is a self-hosted LLM router. It exposes one OpenAI-compatible API and serves each request from a pool of machines you own — desktops, workstations, servers — running local inference engines. When no local worker can serve a request, it transparently falls back to the cloud provider you configured for that tier. One endpoint, one request format, your hardware first, your keys, your data.
Every backend behind that API — provider, model, endpoint, API surface — is a field you change in the admin UI while the server runs. Requests are translated into each provider's native dialect on the way out and normalised back to OpenAI on the way in, so swapping the model behind a tier never reaches your callers.
What it does
- One OpenAI-compatible API for everything. Point any OpenAI client or SDK at your LLMrPro
server —
POST /{extreme,frontier,mini,nano}/v1/chat/completionswith a standard Chat Completions body, plusPOST /embeddings/v1/embeddingsfor the embeddings lane. Swap models and providers behind it without changing a line of caller code. - Any model, any provider, changed at runtime. A tier's provider, API surface, endpoint and model are fields in the admin UI, not lines in a config file — save, and the next request goes the new way. A built-in model-family table knows how each model expects to be spoken to and translates for it; family rules are editable live too. See Any model, any provider.
- Pools your own machines as inference workers. A lightweight desktop agent runs on each machine, connects outbound over a websocket (no inbound ports, no firewall changes), and pulls inference jobs. Each worker runs a full model on a local engine — LM Studio, Ollama, vLLM, llama.cpp, or the bundled MLX engine on macOS.
- Automatic cloud fallback, up a tier ladder. Four tiers —
nano,mini,frontier,extreme— each with its own cloud backend (OpenAI, Azure, Anthropic, Google, OpenRouter). If the local pool can't serve a tier, the request falls back to that tier's cloud provider, with configurable retry/backoff. Tiers that aren't configured are skipped and the request climbs (nano → mini → frontier → extreme); so does a tier that answers twice with an empty reply. Other failures are terminal, not climbed. The ladder is a deliberate availability-over-cost choice — a failingfrontierrequest can land onextremepricing. - Single-tenant and self-hosted. One LLMrPro server per organization. Your keys, your data, your infrastructure — nothing leaves your control unless a request falls back to a cloud provider you configured.
- Live pool and backend management. A built-in admin UI — device pairing, agent revocation, LLM profiles and per-tier backends, model-family rules, dispatch log, and health — backed by real-time pub/sub.
- Security built in. Per-source rate limiting, an egress guard (SSRF protection), provider keys encrypted at rest, signed agent tokens with expiry, and a checksum-verified install path.
How it works
OpenAI-compatible ┌────────────────────────────────────┐
client / app ───────────▶ │ LLMrPro server │
(Bearer key) │ (router + admin UI) │
│ tier: nano / mini / frontier / │
│ extreme (+ embeddings) │
│ ── family table: translate ── │
└───────┬────────────────────┬───────┘
websocket │ dispatch │ fallback
(job pull) ▼ (local first) ▼ (tier, then climb)
┌───────────────────────┐ ┌───────────────────────┐
│ desktop agents │ │ cloud providers │
│ (your machines) │ │ OpenAI / Azure / │
│ MLX / Ollama / vLLM │ │ Anthropic / Google / │
│ LM Studio / llama.cpp│ │ OpenRouter │
└───────────────────────┘ └───────────────────────┘
- A client sends a standard OpenAI Chat Completions request to a tier endpoint with the bearer key.
- The server resolves the target model's family, re-encodes the request the way that model and that transport expect it, then picks an eligible paired agent and dispatches the job. The agent runs it on its local engine and streams the result back, normalised to OpenAI format.
- If no agent can serve the tier, the server calls that tier's configured cloud provider — same
translation step, that provider's native API — climbing to a higher tier if this one is
unconfigured or answers hollow.
X-LLMrPro-*response headers report who served the request and why.
Any model, any provider
The backend is a setting, not a deployment. Cloud backends do not live in a config file. They
live in an LLM profile in the database, edited from the admin UI: one profile is active at a
time and holds a config per tier. Per tier you set the provider (openai, azure,
openrouter, anthropic, google, lmstudio, ollama), the apiSurface
(chat-completions or responses), the endpoint, the deployment (the model name), the API
key, the advertised capabilities, and the routingMode:
routingMode |
Behaviour |
|---|---|
local-first-cloud-fallback |
Try the agent pool, fall back to cloud (default) |
cloud-only |
Skip the pool entirely |
strict-model-match |
Use an agent only if its model matches the tier's deployment or one of its modelAliases |
Save a change and it applies to the next request — the routing cache is invalidated on every mutation. No redeploy, no restart, no caller changes. Keep several profiles (say, an all-local one and an all-cloud one) and switch between them with a single activation.
Translation is what makes that safe. Models disagree about almost everything, so a model-family table maps each model to how it actually behaves and how its provider wants to be addressed:
- Reasoning effort —
minimal|low|medium|high, orlow|high|max, or an Anthropic token budget, or a Gemini budget/level, or Qwen's/thinksuffix, or a vLLM chat-template kwarg. Vocabularies are translated, not passed through blindly. - Sampling — temperature clamped to the family's real range, and dropped entirely for models
that reject it while reasoning;
top_p/top_k/ penalties defaulted per thinking mode. - Token windows —
max_tokensclamped to the family's floor and cap, under the field name that family's transport actually uses. - Structured output —
response_formatpassthrough, Responses-APItext.format, Gemini'sgenerationConfigschema, or a prompt-level fallback for models with no native support. - Thinking and tool calls on the way back — thinking blocks filtered or preserved, and tool
calls recovered from any of ten in-band formats (Hermes XML/JSON, Qwen XML, Kimi pipes, DeepSeek
pipes, Anthropic XML, Gemma call tags, and more) into standard OpenAI
tool_calls, for the models whose runtime doesn't parse them itself.
Responses come back normalised either way — streaming deltas, tool calls, usage and finish reasons in OpenAI shape, whether a Mac in the next room or Anthropic served them.
Transports covered: responses, chat-completions, anthropic, gemini, and
openai-compat:{mlxlm,lmstudio,ollama,vllm,llamacpp,other} for local engines. Seventeen families
ship in the built-in table (GPT-5 and GPT-4-class, Claude 3.x/4.x/4.7+, Gemini 2.5/3, Gemma 3/4,
Qwen 2.5/3/3.8, DeepSeek R1, Kimi K2/K3, plus vanilla and unknown fallbacks), and each row is
overridable live from the admin UI — a new model with an odd parameter vocabulary is a table
row you edit, not a release you wait for.
One honest limit: the server cannot tell a paired agent which model to load. The agent
advertises the model it is running and the server decides whether to use it — that is what
strict-model-match is for. Translation applies to locally served requests exactly as it does to
cloud ones, using the family detected from the model the agent advertised.
Why LLMrPro is different
Plenty of projects touch part of this; as of 2026 no single open-source project combines all of it.
| Compared to | What they do | What LLMrPro adds |
|---|---|---|
| Distributed inference (exo, Petals) | Split one model across devices via P2P / tensor parallelism | A job-dispatch worker pool (a full model per worker) plus per-tier cloud fallback, single-tenant |
| LLM gateways (LiteLLM, Bifrost) | Translate and fall back across static, pre-configured endpoints | A live pool of your own desktops that pair and pull jobs — no static config — a first-party end-user agent, and per-model translation rules the operator edits at runtime |
| GPU-fleet managers (GPUStack, Kalavai) | Worker/coordinator scheduling for owned GPUs | Consumer desktops over the internet (incl. macOS/MLX), a one-line agent installer, and tiered cloud fallback |
| Load balancer + agent tools (Paddler, HiveCore) | A router with self-registering pull workers | Per-tier cloud fallback and a desktop app built for non-technical users |
The distinctive combination — federate a fleet of end-user desktops via a first-party agent + tiered cloud fallback + single-tenant self-hosting, behind one OpenAI-compatible API — is what LLMrPro is for.
The desktop agent is distributed unsigned, with SHA-256 verification at install time as the integrity mechanism. That is a deliberate tradeoff, not an oversight — see SECURITY.md.
Repository layout
LLMrPro/
├── balancer/ # the LLMrPro server: Meteor + MongoDB + React admin UI + deploy script
├── agent/ # the desktop worker: Electron + React app + installer template
├── .github/ # CI: unsigned agent builds for macOS + Linux
├── DESIGN.md # full architecture, wire protocol, routing algorithm
├── SECURITY.md # security model + how to report a vulnerability
└── CONTRIBUTING.md
On the
balancer/directory name. The project was called Balancer before it was renamed to LLMrPro. The directory, the Meteor method namespace (balancer.*), the collection prefixes and theX-Balancer-*response headers still carry the old name — they are wire and on-disk contracts that existing deployments and API consumers depend on, so they were deliberately left alone. Everything a user or operator actually sees says LLMrPro.
Quick start
LLMrPro has two installable pieces: the server (you run one) and the agent (installed on each worker machine).
1. The server
Requirements: Node.js 22+, MongoDB 6+ (a replica set is required for Meteor 3 change-stream reactivity), Meteor 3.4+, and — in production — a TLS-terminating reverse proxy (nginx / Caddy / Traefik).
Local / development
git clone https://github.com/gysho/LLMrPro.git cd LLMrPro/balancer meteor npm install cp .env.production.example .env.production # then fill in the secrets (see below) npm run dev # inject-secrets + meteor run on :3500
Open the admin UI at http://localhost:3500/admin.
First run — configure a backend. The server starts with nothing configured. Under
/admin/settings → LLM profiles, create a profile, open it, fill in at least one tier
(provider, endpoint, model, API key), and activate it. Until a profile is active, tier
requests return 502 with reason no-active-profile — that is intentional, not a fault. The same
page holds LLM family rules, where a model's translation behaviour can be overridden live.
Production — host prerequisites. LLMrPro makes no assumption about your host or cloud provider and ships no provisioning script — a single VM with the following is sufficient, and setting it up is yours to do (or to automate in your own infrastructure repo):
- Node.js 22+ and a MongoDB 6+ replica set
- A reverse proxy terminating TLS and forwarding to the app port (default
3500) - A systemd unit —
balancer.serviceby default — whoseExecStartrunsnode <remote-root>/current/bundle/main.jswithROOT_URL,MONGO_URL,MONGO_OPLOG_URL,METEOR_SETTINGSandHTTP_FORWARDED_COUNTset <remote-root>/settings.runtime.jsonholding the real secrets (never overwritten by deploys)
The exact environment and remote layout are documented at the top of
balancer/scripts/deploy.sh.
Production — deploy a release (build → rsync → atomic symlink swap → restart):
cd balancer ./scripts/deploy.sh https://llmrpro.example.com deploy@your-host curl -i https://llmrpro.example.com/healthz # expect: 200 ok
Run ./scripts/deploy.sh --help for the full option list (--build-only, --restart-cmd,
--remote-root, --keep-releases).
Operator CLI. balancer/ exposes an llmrpro bin for admin actions over DDP — pairing codes,
agent listing and revocation, key rotation:
cd balancer && npx llmrpro --help
Secrets are never committed. settings.json holds ${VAR} placeholders; real values live in
.env.production and are injected into settings.runtime.json at boot by inject-secrets.sh.
You provide: a platform bearer key (stored only as a SHA-256 hash), an agent-token HMAC signing
key, the bootstrap admin credentials, and an operator CLI key. Cloud provider keys are not among
them — you enter those in the admin UI when configuring a tier, and they are encrypted at rest
(AES-256-GCM). The per-tier BALANCER_*_CLOUD_KEY variables still listed in
balancer/.env.production.example feed the legacy
settings-driven path and are not read at request time.
2. The desktop agent (workers)
Each worker machine runs the agent, which connects outbound to the server (no inbound ports, no firewall changes) and forwards jobs to a local inference engine.
End users — one-line install (serves the right artifact for the OS/arch and verifies its SHA-256):
curl -fsSL https://llmrpro.example.com/install.sh | shInspect it first with curl -fsSL https://llmrpro.example.com/install.sh.txt. On first launch
the agent opens a Pairing screen — paste the server URL and a pairing code (an admin
generates these in the admin UI), and the machine joins the pool.
Per platform — what the shipped build config actually produces:
- macOS 12+, Apple Silicon (arm64):
.dmg, or the curl installer. Ships a bundled MLX inference engine; you can also point it at LM Studio / Ollama. Intel Macs are not a current build target. - Linux x86_64:
.AppImage, or the curl installer. Requires a local engine (LM Studio / Ollama / vLLM / llama.cpp). .deb/.rpmand Linux arm64 are supported by the installer and the download endpoint but are not built today — the electron-builder Linux target is AppImage x64 only. Enable them inagent/electron-builder.ymlif you need them.- Manual downloads are listed at
https://llmrpro.example.com/agent/downloads, alongside the SHA-256 of each artifact.
Build, packaging and distribution details: agent/README.md.
Build the agent from source
cd agent npm install npm run build:linux # .AppImage (on a Linux host) npm run build:mac # .dmg + bundled MLX (on a macOS host)
The desktop agent is distributed unsigned — no Apple Developer ID, no notarization, no Windows EV certificate. Integrity rests on HTTPS plus the SHA-256 the installer verifies before running anything. First launch on macOS therefore needs right-click → Open to get past Gatekeeper. The reasoning is in SECURITY.md.
Using it (API)
curl https://llmrpro.example.com/frontier/v1/chat/completions \ -H "Authorization: Bearer <platform-key>" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5", "messages": [{ "role": "user", "content": "Hello" }] }'
- Endpoints:
POST /{extreme,frontier,mini,nano}/v1/chat/completions— the tier is the URL path — plusPOST /embeddings/v1/embeddings. - Body: standard OpenAI Chat Completions. Streaming, tools, reasoning effort and structured outputs are translated to whatever the chosen backend actually supports, rather than passed through and hoped for.
- Auth:
Authorization: Bearer <platform-key>(required on every lane). - The response is OpenAI-formatted whether served by a local agent or a cloud fallback.
Embeddings are a separate lane, not a tier: cloud-only, no agents and no tier climb, backed by
openai, azure or openrouter. The URL grammar matches the chat tiers, so an OpenAI SDK pointed
at {origin}/embeddings/v1 reaches it unmodified. Anthropic and Google are rejected when you save
the profile — one has no embeddings API, the other's is not OpenAI-compatible.
Routing-provenance response headers. Every tier response reports who served it:
| Header | Meaning |
|---|---|
X-LLMrPro-Tier |
The tier the request was routed as |
X-LLMrPro-Served-By |
agent or cloud |
X-LLMrPro-Reason |
Why that lane was chosen (e.g. no eligible agent) |
X-LLMrPro-Executing-Agent-Id / -Machine-Id |
Which worker ran it, when served locally |
X-LLMrPro-Cloud-Provider |
Which provider answered, when served by fallback |
X-LLMrPro-Pool-Size |
Eligible agents at dispatch time |
Every one of these is also emitted under the legacy X-Balancer- prefix (X-Balancer-Tier,
and so on) for consumers written before the rename. Both families carry identical values and will
continue to; prefer X-LLMrPro-* in new code. The optional request header
X-LLMrPro-Budget-Ms — a caller-declared deadline, clamped to the operator ceiling — likewise
accepts X-Balancer-Budget-Ms.
Configuration
Config lives in two places, and the split matters.
Model routing — the admin UI, database-backed and live. Which provider, model, endpoint and
API surface serve each tier, the routing mode, the embeddings lane, and the model-family rules are
stored in MongoDB as the active LLM profile plus family overrides, and are edited from the
admin UI. Changes apply to the next request. There is deliberately no settings.json
fallback for these: with no active profile a tier request fails loudly — 502 with reason
no-active-profile or no-tier-configured — rather than quietly serving a backend you didn't
choose. Details in Any model, any provider.
Process-level config — balancer/settings.json (template:
balancer/settings-example.json), read at boot:
publicHostname/urlSuffix— the public origin, and the reverse-proxy path prefix if any.rateLimits—completionsPerSecond,embeddingsPerSecond,pairAttemptsPerMinutePerIp.trustProxy— settruebehind a trusted reverse proxy to get per-client rate limiting.egressAllowlist— optional hostname allowlist for outbound cloud calls (SSRF hardening).cloudRetry— retryable statuses, max retries, backoff base/factor/cap, jitter, andRetry-Afterhandling.healthCheck—intervalMs,probeTimeoutMsfor the background backend probe.dispatchTimeoutMs,maxInflightPerAgent,agentPenaltyMs,pairingCodeTtlMs,agentReleaseDir.- Secrets:
platformApiKeyHash,agentTokenSigningKey,bootstrapAdmin.
Secrets in settings.json are ${VAR} placeholders resolved from the environment at boot —
never commit real values.
Legacy block.
private.balancer.tiers.*.cloudFallbackpredates the LLM-profile system. It is still accepted and validated if present, but is no longer read at request time — the active profile is the only source. Configure backends in the admin UI.
Documentation
- DESIGN.md — architecture, request flow, routing model, and the decisions behind them
- balancer/README.md — server layout, configuration, logging, running it locally
- agent/README.md — desktop agent: build, packaging, artefact distribution
- SECURITY.md — security model and how to report a vulnerability
- CONTRIBUTING.md — how to build, test, and submit a change
Security
The security model, the unsigned-agent distribution tradeoff, and how to report a vulnerability are in SECURITY.md. Provider keys are encrypted at rest, agent tokens are signed with expiry, and the server ships with rate limiting and SSRF egress protection.
Please do not open a public issue for a vulnerability — the disclosure process is in SECURITY.md.
Contributing
Contributions are welcome. CONTRIBUTING.md covers the dev setup, how to run the test suites, the conventions the codebase follows, and what a reviewable pull request looks like. Participation is governed by the Code of Conduct.
Quick version:
cd balancer && npm run test:unit # 249 tests, no services required cd agent && npm test # 142 tests
License
LLMrPro is released under the MIT License. © 2026 Gysho.