Personal-AI-Router / rules
Cursor rule1.5k starsChanged 2 months agoApache-2.0View on GitHub
Current PAIR runtime architecture, communication paths, modular services, and security boundaries
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about NVIDIA/Personal-AI-Router
- A Hacker News story“Nvidia Personal-AI-Router”Hacker News · Sep 10, 2026 · 3 points
- A Hacker News story“Nvidia Personal AI Router (Pair)”Hacker News · Sep 6, 2026 · 2 points
- @mint-echosphere.bsky.social“「遊んでるPCがデータセンターに」——そこ、ちょっと看板が先に走ります🌿 NVIDIA PAIR。家の中のマシンへ、独立した推論リクエストを振り分ける仮想ルーターです。 …”Bluesky · Sep 10, 2026 · 1 likes
- turnstonelabs/turnstone“Investigate NVIDIA PAIR and NeMo Switchyard as OpenAI-compatible backends”GitHub · Sep 26, 2026
- @camilleroux.com“PAIR (NVIDIA) : router qui distribue l'inférence entre les machines du réseau local, détecte les nœuds …”Bluesky · Sep 16, 2026
The biggest 5 of 10 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 10
Talked about on GitHub, Hacker News and Bluesky (10 times).
On GitHub · 6
- Sep 26, 2026Investigate NVIDIA PAIR and NeMo Switchyard as OpenAI-compatible backends — turnstonelabs/turnstone0 reactions · 1 comment
- Sep 15, 2026feat(AGENT-634): NVIDIA PAIR FORMAT fleet router + S25 node — IgorGanapolsky/trading0 reactions · 5 comments
- Sep 7, 2026[Package Request]: NVIDIA PAIR — pl4nty/winget-extras0 reactions
- Sep 6, 2026[Investigate] NVIDIA Pair support — appatalks/eva-agent0 reactions
- Sep 5, 2026Technology Radar — 2026-09-05 — carlosasantoss73-tech/AUREA0 reactions
1 more on GitHub
- Sep 5, 2026README and docs still link to the upstream NVIDIA repository — waynehoggett/Personal-AI-Router0 reactions · 1 comment
On Hacker News · 2
- Sep 10, 2026Nvidia Personal-AI-Router3 points
- Sep 6, 2026Nvidia Personal AI Router (Pair)2 points
On Bluesky · 2
- Sep 10, 2026「遊んでるPCがデータセンターに」——そこ、ちょっと看板が先に走ります🌿 NVIDIA PAIR。家の中のマシンへ、独立した推論リクエストを振り分ける仮想ルーターです。 https://x.com/so_sthbryan/status/2098000027977449906… — @mint-echosphere.bsky.social1 likes and repost · 1 reply
- Sep 16, 2026PAIR (NVIDIA) : router qui distribue l'inférence entre les machines du réseau local, détecte les nœuds disponibles, gère Ollama et LM… — @camilleroux.com0 likes and reposts · 1 reply
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/absolute-imports.mdcCursor rule
- .cursor/rules/agent-onboarding.mdcCursor rule
- .cursor/rules/architecture.mdcCursor rule
- .cursor/rules/backend-constants.mdcCursor rule
- .cursor/rules/build-and-typecheck.mdcCursor rule
- .cursor/rules/commit-sign-off.mdcCursor rule
- .cursor/rules/communication-layers.mdcCursor rule
- .cursor/rules/engines-vs-backends-naming.mdcCursor rule
- .cursor/rules/file-editing.mdcCursor rule
- .cursor/rules/imports-discipline.mdcCursor rule
- .cursor/rules/ipc-patterns.mdcCursor rule
- .cursor/rules/model-registry.mdcCursor rule
- .cursor/rules/no-legacy-fallbacks.mdcCursor rule
- .cursor/rules/no-push-to-main.mdcCursor rule
- .cursor/rules/platform-helpers.mdcCursor rule
- .cursor/rules/proxy-inference-routing.mdcCursor rule
- .cursor/rules/readme-ownership.mdcCursor rule
- .cursor/rules/renderer-stores.mdcCursor rule
- .cursor/rules/security.mdcCursor rule
- .cursor/rules/service-contracts.mdcCursor rule
- .cursor/rules/services-agent-onboarding.mdcCursor rule
- .cursor/rules/services-change-propagation.mdcCursor rule
- .cursor/rules/state-and-auto-start.mdcCursor rule
- .cursor/rules/test-type-discipline.mdcCursor rule
- .cursor/rules/type-discipline.mdcCursor rule
- .cursor/rules/type-safety.mdcCursor rule
- kaizen-uiSkill
- pair-test-styleSkill
- sync-backendSkill
- pair-github-prSkill
The file
We split this system-architecture.mdc into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 45
Never launch one worker from both Electron and the broker.
- Distinctive: line 116
Prefer live broker or discovery values.
- Distinctive: line 117
Do not assume a proxy port before the broker reports it.
- Distinctive: line 162
use deterministic proxy default order.
- Distinctive: line 238
Keep these current when contracts change:
- Distinctive: line 246
Do not add migration diaries or completed historical narratives.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: Current PAIR runtime architecture, communication paths, modular services, and security boundaries alwaysApply: true --- <!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0 --> # System Architecture `docs/architecture.md` is the rendered current-state reference. ## Process model PAIR is an Electron application backed by the sibling `services/` tree. - Electron starts only `nvpair-ui-broker`. - The broker supervises every runtime worker. - Backend processes communicate with their parent over stdio JSON-RPC. - Development binaries live in `cli-bin/`. - Packaged binaries live in `process.resourcesPath/cli-bin`. The canonical inventory is `src/shared/constants/modular-binaries.ts`. Broker-owned workers: - `nvpair-proxy`, one process hosting a facade per enabled engine. It starts with no engine and no listener; the broker sends a `facade/enable` per engine carrying that engine's port. Clients still address each facade as `ollama-proxy:` / `lmstudio-proxy:`, and one supervisor covers them all, so a crash is reported against `nvpair-proxy` and restarts every facade together; - `nvpair-node-scanner`; - `nvpair-node-info`; - `nvpair-workload-manager`; - `nvpair-cluster-manager`; - `nvpair-node-settings`; - `nvpair-manual-nodes`; - `nvpair-engine-manager`; - `nvpair-errors`; - `nvpair-job-scheduler`. `nvpair-tui` is bundled but not supervised by Electron or the broker. Never launch one worker from both Electron and the broker. There is no broker-absent fallback. The Inference Demo's `inference-dispatcher` is the one non-broker executable Electron launches. It is not a worker: its source lives in `scripts/inference-dispatcher` at the monorepo root, it is absent from `services/versions.json` and `modular-binaries.ts`, and it ships in its own `tools/` resource directory. See "Inference Demo" below. The connector remains `connecting` until broker `app:ready` and the required Ollama proxy readiness arrive. A startup deadline routes failures to Settings > Service with the error and log/restart controls; late readiness transitions the existing process tree to connected. ## Communication ### Renderer to service `window.pairApi` is the only renderer service-control API. It uses `window.__PAIR_TRANSPORT__`, the `service-bridge:*` IPC envelope, Electron main handlers, and the broker. Logical invoke and push types live in `src/shared/types/ws-channels.ts`. Browser mode is unsupported. ### Renderer to Electron `window.windowApi` is reserved for: - window and tray management; - clipboard; - service lifecycle and logs; - updater control; - first-run state. IPC types live in `src/shared/types/ipc-channels.ts`. All handlers use `safeHandle()`. ### Terminal PAIR has no Electron-backed console client. The `nvpair` command on PATH is a launcher for the bundled Go `nvpair-tui`, which owns its own broker and worker tree. Electron generates that launcher on packaged builds (`src/electron/nvpair-command.ts`); the Debian package installs the equivalent wrapper at `/usr/bin/nvpair`. Do not add a TypeScript command surface, control socket, or local control server. ### Node telemetry Electron directly polls each discovered node's advertised `/v1/node-info` endpoint every two seconds while it is healthy. Consecutive failures back off to 4, 8, 16, then 30 seconds and reset on success or an endpoint change. This is the only service-data HTTP exception because rich telemetry is not exposed by the broker JSON-RPC contract. This renderer-facing metrics path is display-only. Independently, the backend scanner provides compact maximum-GPU utilization on the same healthy cadence and capped failure backoff; the manual-node worker supplies the same payload shape. The broker uses both for scheduling. ### Inference HTTP Ollama and LM Studio proxies expose local client-compatible HTTP endpoints. Chat behaves as a local third-party client. Prompts, messages, chunks, and response bodies must never be logged. ## Runtime defaults Backend-coupled constants belong in `src/shared/constants/modular-runtime.ts`. - Prefer live broker or discovery values. - Do not assume a proxy port before the broker reports it. - Native chat fallbacks are Ollama `127.0.0.1:11434` and LM Studio `127.0.0.1:1234`. - Cluster pairing currently uses port `14321`. - Node telemetry path is `/v1/node-info`. Backend discovery service names and TXT layouts are not PAIR contracts. Consume the broker's reported discovery snapshots instead of duplicating those details. ## State flow The service is authoritative. 1. The UI sends commands. 2. The broker and workers execute them. 3. Backend notifications update `ModularBridgeState`. 4. Typed push events update renderer stores. Stores fetch domain snapshots on startup and subscribe to push events. Engine commands return no state. The centralized pending-actions store is the only optimistic engine/model state in the renderer. Current push channels are declared in `WsPushChannelMap`; do not maintain a second handwritten channel list. ## Discovery `nvpair-node-scanner` is the discovery authority. The broker exposes canonical addresses, trust state, model inventory, and per-engine model attribution in `AvailableNode`. Electron merges discovery, proxy presence, engine-manager facts, and node-info metrics into the renderer node model. Manual nodes go through the broker's `node/add`, `node/remove`, and `nodes/list` relay. Electron persists and replays user entries. ## Routing Routing is backend-owned: 1. for model-bearing inference, filter to nodes whose per-engine inventory advertises the requested model; 2. within that owner set, apply explicit manual selection; 3. apply `nvpair-job-scheduler` priority; 4. use deterministic proxy default order. Empty and non-matching inventories are excluded. If no advertised owner is routable, the proxy returns a local `502`; retryable upstream failures continue only through other advertised owners. PAIR does not call `node/select` and must not implement a TypeScript router. The broker relays pending workload and source-aware GPU telemetry. The scheduler uses EWMA-smoothed fresh utilization to derive pressure 0–3, with neutral pressure 1 for invalid, missing, or stale data, then ranks by `pending + gpuPressure`, pressure, and UUID. Each proxy minimizes `pending + gpuPressure + localReservations` for capable nodes. ## Inference Demo A fixed sixty-second burst of synthetic traffic sent through the local proxies so job activity is visible on Overview. - Electron main owns the schedule (`src/electron/inference-demo.ts`, `src/electron/inference-demo-schedule.ts`). - Each request spawns the bundled `inference-dispatcher`, which behaves as an ordinary third-party HTTP client. - Requests target a broker-reported proxy port, never an engine's own port. The backend decides placement; PAIR must not describe the demo as distributing work itself. - Progress is broadcast on the `demo:state` Electron push channel (`IpcPushChannelMap`), not the service push bus. State is node-local and is not synchronized. - Children run with `stdio: 'ignore'` and with `INFERENCE_DISPATCHER_*` stripped from the environment. Never surface or log prompts or responses. ## Engines `nvpair-engine-manager` owns lifecycle, port, desired-state, and model operations. - Local lifecycle supports install, start, stop, uninstall, update, and port changes. - Remote lifecycle uses the engine manager's remote control methods where available. - `engine:prepare-shutdown` stops processes without clearing persisted desired state. - Engine and proxy ports are persisted by their backend owners. - Running adopted engines reject operations that require process ownership. - Per-engine environment and CLI argument overrides are not part of the current contract. The model hub is Electron-main functionality under `src/electron/model-hub/`. It provides curated Ollama and LM Studio catalogs; model operations still go through the engine manager. ## Pairing and security `nvpair-cluster-manager` and the other backend workers own cluster identity, PIN pairing, trusted certificates, membership, and every node-to-node channel. PAIR implements **no** security or cryptography: it relays pairing and membership commands, renders the resulting notifications, and never reads keys or builds transport security. The PIN is a convenience pairing code, not a strong authenticator. See `.cursor/rules/security.mdc`. ## Packaging `npm run build:modular-binaries` builds the backend for the target platform and writes `cli-bin/manifest.json`. Packaging rejects stale or unexpected `cli-bin` files. The macOS privileged helper firewall list is derived from `needsFirewallAccess` in `MODULAR_RUNTIME_BINARIES`. `npm run service-contracts:check` verifies parity with the Swift helper. Build and release details live in `docs/macos-privileged-helper.md`. ## Documentation Keep these current when contracts change: - `docs/architecture.md`; - `docs/frontend-api.md`; - `docs/services-backend.md`; - `docs/services-parity.md`; - this rule and `architecture.mdc`. Do not add migration diaries or completed historical narratives. Git history is the history.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

