Skip to main content

MFabric

License: MIT Python 3.11+

Zero-config mutual-TLS 1.3 OpenAI mesh router for every computer you own.

Expose one local OpenAI-compatible endpoint (http://127.0.0.1:8788/v1) on your laptop or workstation that securely routes across Ollama, LM Studio, vLLM, and llama.cpp (llama-server) running on your other macOS, Linux, and Windows machines—with no cloud account, no mandatory VPN install, no static YAML, and no manual API key files.


Why MFabric?

  • 60-Second Zero-Keyfile Pairing $\to$ Mutual TLS 1.3: Compare a 6-word Short Authentication String (HKDF-bound to both the Fabric Root CA and the helper's ECDSA P-256 + Ed25519 public keys) and approve once. MFabric issues pinned X.509 leaf certificates automatically, encrypting every prompt and streamed token over Wi-Fi/LAN with TLS 1.3 mutual authentication.
  • Keep Model Servers Safely on 127.0.0.1: Leave Ollama (:11434), LM Studio (:1234), vLLM (:8000), and llama-server bound strictly to loopback so unauthenticated model ports are never exposed on 0.0.0.0.
  • Drop-In OpenAI /v1 Compatibility: Works out of the box with Cursor, Continue, Cline, Open WebUI, and the official openai Python/TypeScript SDKs—including multi-turn messages[], real-time SSE stream: true, tools / tool_choice, reasoning_content, /v1/embeddings, and instant TCP disconnect cancellation.
  • Presence, Battery & VRAM-Aware Routing: Virtual models (auto, fast), canonical model names, and pinned @peer/model targets automatically steer away from unplugged laptops on battery or desktops under heavy foreground GPU load, with seamless pre-first-token failover.
  • Dual-Signed Content-Free Execution Receipts: Every routed response records a mfabric.receipt.v3 signed by both the executing helper's Ed25519 key and your host's Ed25519 key (with zero prompt or output text stored), verifiable offline via mfab receipts verify.

Install (macOS, Linux, Windows)

Requires Python 3.11 or newer:

pip install mfabric
mfab doctor

(Both mfab and mfabric CLI commands are installed; you can also isolate it with pipx install mfabric or uv tool install mfabric.)


Quickstart (Two Machines, Under 60 Seconds)

1. Start the router on your primary computer (Host)

mfab up -d

This starts your local OpenAI /v1 router and web dashboard on http://127.0.0.1:8788 plus the LAN pairing listener on port 8935.

2. Join any GPU desktop, workstation, or Mac on your network (Helper)

If Ollama, LM Studio, or vLLM is already running on 127.0.0.1 on that machine, MFabric discovers its models automatically. Need a standalone GGUF runtime? Run mfab install-llama first to fetch an official SHA-256-verified llama-server build for CUDA, Metal, Vulkan, or CPU.

# Auto-discovers your host over mDNS, or pass the Join URL explicitly:
mfab join -d
# Explicit URL fallback (or when mDNS is blocked / disabled):
# mfab join http://<host-lan-ip>:8935 --no-discovery -d

Verify that the 6-word pairing phrase shown on the helper matches mfab pending (or http://127.0.0.1:8788) on your host, then approve that exact phrase:

mfab approve "<6-word-phrase>"
# (or bare `mfab approve` when only a single request is pending)

3. Point any OpenAI client at http://127.0.0.1:8788/v1

mfab peers
mfab models
mfab chat "Write a lock-free ring buffer in C++20."

Python (openai SDK)

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8788/v1", api_key="local")
stream = client.chat.completions.create(
    model="auto",  # or "fast", "qwen2.5-coder:32b", or "@workstation/qwen2.5-coder:32b"
    messages=[{"role": "user", "content": "Explain mutual TLS 1.3 in three sentences."}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

Cursor / Continue / Cline / Open WebUI

  • OpenAI Base URL: http://127.0.0.1:8788/v1
  • API Key: local (or set MFABRIC_API_KEY before mfab up to enforce a custom Bearer token)
  • Model: auto, fast, any discovered model ID, or @<peer_id>/<model_id> to pin a specific machine.

What Can I Do Next?

Goal Command
Inspect live nodes, GPUs, battery state & models mfab status or mfab peers
Pin a prompt to one exact machine (fail-closed, no failover) mfab chat -m "@studio-mac/qwen2.5-coder:32b" "Refactor this module"
Serve a local .gguf file directly without Ollama/LM Studio mfab install-llama && mfab join --model ~/Models/qwen2.5-7b-instruct-q4_k_m.gguf -d
Verify cryptographic proof of which machine ran a request mfab receipts list $\to$ mfab receipts verify <receipt_id>
Revoke a helper immediately (pushes signed mTLS shutdown) mfab revoke <peer_id>
Run automatically at login (LaunchAgent / systemd / Startup) mfab service install --role helper (or --role host)
Require a Bearer API key on /v1/* and /api/* Set MFABRIC_API_KEY="<secret>" in your environment before mfab up
Stop background host/helper processes mfab down

Operating-System & Firewall Notes

  • macOS: The first time you run mfab up or mfab join, allow your terminal or IDE under System Settings $\to$ Privacy & Security $\to$ Local Network. To keep a Mac helper awake while serving with the display off, run caffeinate -dimsu in a separate tab.
  • Windows: Windows Defender Firewall prompts on first LAN bind (or blocks inbound connections on Public network profiles). Set your trusted home/office Wi-Fi or Ethernet to Private network, or run the exact New-NetFirewallRule command printed by mfab join if reachback fails.
  • Linux: If ufw or firewalld is active, allow inbound TCP 8935 on the host (for pairing) and TCP 8789 on helpers from your private LAN subnet (e.g., sudo ufw allow from 192.168.0.0/16 to any port 8789 proto tcp).

Security Model & Beta Caveats

  • Mutual TLS 1.3 Inference Transport: All /v1/* model traffic and /mesh/v1/* health checks between Host and Helpers run over TLS 1.3 with mutual certificate verification (CERT_REQUIRED), SHA-256 leaf fingerprint pinning, and X.509 URI SAN role checks (urn:mfabric:host:<id> vs. urn:mfabric:peer:<id>). Compromising one helper certificate does not grant lateral access to other helpers.
  • Explicit Pairing Approval: LAN mDNS discovery (_mfabric-v3._tcp.local.) only locates candidate host addresses and can be disabled with --no-discovery. No machine can join or receive a certificate until you verify the 6-word SAS phrase and approve on the host.
  • Loopback Protection: The host console (127.0.0.1:8788) enforces Host-header allowlisting (blocking DNS rebinding), Origin validation, and Content-Type: application/json checks against cross-origin browser CSRF.
  • What MFabric v0.3 Does Not Do: MFabric v0.3 routes whole OpenAI requests across independent runtimes and fails over before the first output token; it does not shard a single model's weights across multiple machines over Wi-Fi, and revoking a peer blocks new MFabric dispatches without altering your local Ollama/vLLM installation. Do not port-forward :8788 or :8935 to the public Internet.

License

MIT License. Copyright (c) 2026 Sfiniti AI Inc. See LICENSE and NOTICE.

Metadata

Release files for mfabric 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mfabric 0.3.0
File Size Uploaded Provenance Actions
mfabric-0.3.0.tar.gz 126.3 kB With provenance Details for mfabric-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mfabric 0.3.0
File Interpreter ABI Platform Actions
mfabric-0.3.0-py3-none-any.whl Python 3 none any Details for mfabric-0.3.0-py3-none-any.whl

Total release size: 240.4 kB

Release files / mfabric-0.3.0.tar.gz

Download URL mfabric-0.3.0.tar.gz
Size 126.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e8d55418459df02b88549eb67de74d360aedef350b5273dd5da2e321b3d1a715
BLAKE2b-256 checksum
How to use checksums
1d1f5587e5f7506d06e0b3496e8d83e12c8dfa539e824a2bb9574b5267b23efa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / mfabric-0.3.0-py3-none-any.whl

Download URL mfabric-0.3.0-py3-none-any.whl
Size 114.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
502ee1da8f7e3f22ce9ec36baa193509062bc63b788a92f1accdbb0e575ecae9
BLAKE2b-256 checksum
How to use checksums
315f1a5f6d48ba6335a453936b914beb5531d688b39d8a7e277e1cd35cf7d61b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for mfabric 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mfabric-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page