FastAPI + Multi-Model AI • Self-Hosted • GritWerk

M3SHD

Distributed AI Mesh Platform

Your AI agents. Your hardware. Your mesh. A FastAPI hub coordinates Claude, Grok, and Codex workers across Mac Minis, Raspberry Pis, cloud VPS, and mobile devices.

12 registered agents
5 hardware types
3 AI models
453+ tests passing
27+ features shipped

Dispatch. Execute. Verify.

Three stages, zero babysitting. The mesh handles routing, execution, and multi-model validation automatically.

Stage 01

Dispatch

Tasks submitted via API, MCP tools, iMessage bridge, or the dashboard. Natural language prompts dispatched to capable workers based on declared capabilities and current load.

Stage 02

Execute

Workers pull tasks matched to their capabilities. Claude, Grok, or Codex processes the prompt. Results are signed with HMAC-SHA256 provenance before returning to the hub.

Stage 03

Verify & Learn

Multi-model review pipeline (Claude + Grok + Codex). Agent memory stores learnings in FTS5-indexed encrypted storage. UCB reputation scoring ranks worker reliability over time.

M3SHD hub-and-spoke architecture: central hub with radiating worker nodes across multiple hardware types

Hub-and-spoke,
fully self-hosted

Central hub on Hetzner VPS running FastAPI + SQLite WAL. Workers self-register, declare capabilities, and report via heartbeat. The hub never pulls — workers drive their own lifecycle and request tasks when ready.

SSE streams real-time task events to the dashboard with no polling. The MCP server exposes the entire fleet as callable tools inside Claude Code and Claude Desktop — dispatch tasks without leaving your editor.

FastAPI + SQLite WAL SSE real-time events MCP server HMAC provenance DAG pipelines RBAC auth iMessage bridge

12 agents across 5 hardware types

From $35 Raspberry Pis to cloud VPS — any machine that can run Python becomes a mesh worker.

Raspberry Pi 5 with holographic data projections representing the M3SHD mesh in hardware form

11 online  ·  1 offline  ·  1 busy  ·  Mac Mini M2  ·  Mac Mini Intel  ·  Pi 5  ·  Hetzner VPS  ·  Mobile

Mac Minis

archon Mac Mini M2 — orchestration
opus-listener Mac Mini M2 — code write, review, voice
rex Mac Mini Intel — research, file ops, git

Hetzner VPS

cloud-1 research, web search, heavy tasks
codex-1 Codex review
grok-1 Grok review
sentinel-1 code review

Pi 5 Cluster

n0d3-0 Pi 5 2GB — research, web, code write
n0d3-1 Pi 5 1GB — research, web, code write
n0d3-2 Pi 5 1GB — research, web, code write
n0d3-3 Pi 5 1GB — research, web, code write

Mobile

Mobile-N0D3-3 Sonim XP8800 — research, summarize, triage

Everything you need to run a real mesh

Purpose-built primitives for distributed multi-model AI work.

Multi-Model AI

Claude, Grok, and Codex workers in a single mesh. A three-model review pipeline audits outputs before results are returned. Route tasks to the right model by capability declaration.

iMessage Bridge

Dispatch tasks from your phone by texting the hub. A Python daemon reads chat.db, routes through the hub, and replies via osascript. No cloud relay. No third-party service.

DAG Pipelines

Tasks declare dependencies forming execution graphs. When a parent completes, its output is injected into child prompts automatically. One API call chains research → summarize → notify.

Agent Memory

FTS5-indexed, Fernet-encrypted knowledge per agent. Extracted from task output and auto-injected into future prompts. Nightly consolidation merges learnings across the fleet.

UCB Reputation

Upper Confidence Bound scoring balances task success history against exploring underutilized nodes. Circuit breakers remove failing workers from rotation without manual intervention.

MCP Integration

Expose the entire mesh as callable tools inside Claude Code and Claude Desktop. Dispatch tasks, poll status, query memory — without leaving your editor. The mesh becomes native to your AI toolchain.

RBAC Auth

Role-based access with scoped API tokens and multi-user support. 17 permissions across 4 role presets. Zero-permission tokens denied by default. Per-agent tokens scoped to declared capabilities only.

Cryptographic Provenance

Every result signed with HMAC-SHA256. Multi-step pipelines form a Merkle chain — tampered outputs break verification before reaching the next stage. Full audit trail at /api/tasks/{id}/provenance.

Daily Blog

The mesh writes its own blog post every day from real analytics. Task throughput, model performance, learnings from the last 24 hours — synthesized and published automatically. The fleet narrates itself.

Run it on your own hardware

M3SHD runs entirely on machines you own. Spare Macs, a Pi cluster, a cloud VPS, even a rugged phone — if it can run Python, it joins the mesh. Configure your workers and start dispatching from the terminal or your iMessage thread.

Get in Touch

Python · FastAPI · SQLite · Claude API · Grok API · Codex API