No description
  • Erlang 61.8%
  • Shell 25.1%
  • Python 9.6%
  • Dockerfile 3.5%
Find a file
2026-11-24 01:12:03 +01:00
.github public tree: no lab machine, no fleet path, and a check that keeps it out (#15) 2026-11-03 13:12:39 +01:00
apps The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:21:03 +01:00
architecture wip: live test fixes, C4 model, docs for pair#8 2026-10-23 03:33:06 +02:00
assets wip: live test fixes, C4 model, docs for pair#8 2026-10-23 03:33:06 +02:00
config The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:21:03 +01:00
deploy The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:21:03 +01:00
docs pair#8: the rate-limit assertion cannot pass without a limiter 2026-10-23 04:49:03 +02:00
scripts No crew member or lab box names in a public tree (PR 2 squashed) 2026-11-23 21:29:02 +01:00
test_live pair#8: the rate-limit assertion cannot pass without a limiter 2026-10-23 04:49:03 +02:00
.gitignore scaffold: rebar3 new mcl_service (mcl-om ca5a539 template) 2026-09-23 17:17:57 +02:00
.tool-versions scaffold: rebar3 new mcl_service (mcl-om ca5a539 template) 2026-09-23 17:17:57 +02:00
CHANGELOG.md build: move onto macula 18.3.0 and mcl_om 1.8.0 (#13) (#14) 2026-11-03 12:33:54 +01:00
Containerfile The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:21:03 +01:00
LICENSE scaffold: rebar3 new mcl_service (mcl-om ca5a539 template) 2026-09-23 17:17:57 +02:00
README.md README: drop the GitHub Sponsors badge 2026-11-23 22:20:31 +00:00
rebar.config build: move onto macula 18.3.0 and mcl_om 1.8.0 (#13) (#14) 2026-11-03 12:33:54 +01:00
SECURITY.md SECURITY.md: response times, attachment and identity rules, drills (macula-io/macula#174) 2026-10-31 02:59:30 +01:00

CI License ghcr.io BEAM Buy Me a Coffee

Macula

A bridge between a household's own NVIDIA PAIR cluster and a Macula realm

Status: measured end to end, released as v0.1.0

Measured 23 October 2026 from a second machine, against this bridge running beside an unmodified PAIR install on its own host (CPU inference; that host's GTX 1050 Ti driver is broken and was not part of the test).

Claim What the run showed
A realm member gets a completion the member's token carried member/email-verified; qwen2.5:3b-instruct-q4_K_M answered ready (5 bytes)
A node with no realm membership is refused {error, {call_error, <<"unauthorized">>, undefined}}
The per-caller limit trips 20 per 60 s window; the burst was refused rate_limited on its 20th call, 19 completions served. The window is fixed and counted per caller node, so a burst across a rollover gets a fresh budget: the test asserts that a refusal was SEEN inside a 3-window budget, plus a per-window ceiling on completions, never a fixed call number

One command runs all three: scripts/live_test_pair8.sh. The suite lives in test_live/ and outside CI's gate on purpose — it cannot pass without a deployed bridge.

The unit suite in test/ is the other half: it replaces PAIR and the mesh with stand-ins and runs in CI on every push.

What has not happened yet:

  • The fleet entry lands with the release: v0.1.0's image is signed and attested, and macula-fleet pins that digest on the box that runs PAIR.
  • One bridge per cluster, no cluster introspection, no redundancy, and no measurement beyond the three claims above.
  • The rate limit is per caller NODE, not per person: one member with three bound nodes gets three budgets.
  • The member key must be bound to its person before the node's first connect. A node the realm has already admitted in its own right cannot be bound afterwards (the realm answers client_already_member), so a key that has connected once has to be replaced rather than admitted.

Revoking the test member: macula-cli person unbind -to <client node id> ends that client's membership; ending the person, which a realm admin does on the Members desk, ends every client it has.

What it is meant to become

NVIDIA PAIR (Personal AI Router) turns a household's own machines into one local inference cluster: LAN-scoped, Ollama- and OpenAI-compatible, with no changes needed to the programs that use it. This service does not reimplement any of that. It sits next to an unmodified PAIR install as a thin translator, so that members of a Macula realm can use that cluster from elsewhere, and nobody outside the realm can:

Macula realm  <--(macula 12 RPC, realm members only)-->  mcl-nvidia-pair  <--(loopback HTTP)-->  PAIR cluster
  (wide area, post-quantum)                                (this repo)          (unmodified, LAN only)
  • Realm side: it offers one procedure, mcl-nvidia-pair/chat, to the realm. Macula admits a call only with a membership token the realm signed, carrying the required tier (member/email-verified by default). The check happens in macula before the call reaches this service's code.
  • PAIR side: it forwards an accepted chat request to PAIR's own Ollama-compatible proxy on the same machine, over plain loopback HTTP. No change to PAIR, no pairing, no extra certificates. That is also why it must run on a machine that is already a member of the PAIR cluster.

It implements exactly one operation and builds the outbound request itself. It never forwards a caller's path, so PAIR's own admin surface (/api/pull, /api/delete, engine control) is not reachable from the realm.

How the design was arrived at, and what it rejected: docs/DESIGN.md.

Like every mcl service, it also answers mcl-nvidia-pair/info, which mcl_om adds: its name, version and description, its org and claim labels, node id, the macula and mcl_om versions, uptime, the health word and the procedures it advertises. Open to any mesh caller, public facts only.

Layout

apps/mcl_nvidia_pair/        The service: boots on mcl_om, offers mcl-nvidia-pair/chat, reports /health
apps/chat_to_pair/           Forwards one authorised chat request to PAIR's loopback proxy
apps/throttle_pair_callers/  Per-caller fixed-window rate limit (macula has no inbound throttle)
config/                      sys.config.src, filled from the environment at boot
deploy/                      docker-compose.yml, the service's own run contract
docs/                        The design (and how it was reached), getting started

Running it

Erlang/OTP 28.4.3 and rebar3 (see .tool-versions).

rebar3 compile
rebar3 eunit
rebar3 lint

See docs/GETTING_STARTED.md for configuration and for trying the PAIR side against a real local install.

/health (port 8499) reports three things: whether the configured PAIR backend answers, whether the service is configured to serve at all, and, from mcl_om, whether the realm has granted this node its procedure.

Architecture

The C4 model is in architecture/README.md, with its diagrams drawn by architecture/c4_diagrams.py into assets/. Change the script, run it (python3 architecture/c4_diagrams.py), and look at the result before committing.

mcl-nvidia-pair system context

Licence

Apache-2.0.