P2P Distributed AI Network
Intelligence partagée — Shared Intelligence
v5.2Everything you need for a distributed AI network — nothing you don't.
Ollama, OpenAI, Anthropic, and any OpenAI-compatible endpoint. Bring your own key, share models across the P2P network automatically.
BYOKReal-time bidirectional sync via WebSocket. Gossip protocol propagates changes across all nodes. No central server — ever.
Gossip ProtocolCRDT conflict-free replication, vector clocks for causal ordering, gossip propagation, and TTL support. Memory that never conflicts.
CRDT + Vector ClocksEd25519 identity keys, HMAC shared secrets, Web of Trust (PGP-like transitive trust), stealth mode for hidden nodes.
No Accounts NeededLocal first → cloud on demand → peer failover. Ensemble consensus queries multiple models and returns the best answer. Circuit breakers protect the network.
Auto-FailoverScore-based limits: share more compute, earn more access. 1–200 queries/minute depending on your contribution. Fair by design.
Merit-BasedStatic config, Tailscale auto-discovery, or dynamic API registration. Nodes find each other — zero manual work on Tailscale.
Zero ConfigThe neuromesh command with /status, /peers, /models, /quota, /ensemble, and more. Full control from your terminal.
0.16s startup, 17MB RAM, 4 dependencies. Runs on a Raspberry Pi, a Core 2 Duo, or anything with Python 3.12+.
Minimal FootprintOne command install: openclaw skill install neuromesh. Integrates with your OpenClaw agent seamlessly.
We're tired of AI as a service. Monthly subscriptions. API keys that expire. Rate limits you didn't ask for. Vendor lock-in. Data you don't control. Servers that go down and take your workflow with them.
NeuroMesh is the antidote. Your machines, your models, your memory. Connect them peer-to-peer. No middleman. No subscription. No "enterprise tier".
The network doesn't phone home. It doesn't meter your usage. It doesn't upsell you. It just works — locally, privately, and reliably.
Every node is equal. No master, no slave, no controller. Memory syncs via CRDT so there are never conflicts. Auth is decentralized — your keys, your trust. Add a node, and the whole network gains compute. Remove one, and the rest keeps running.
This is AI infrastructure for people who build things, not for people who buy things.
Running in under 2 minutes. Seriously.
Grab the code and enter the directory.
# Clone & enter git clone https://github.com/NeuroMesh-ai/neuromesh.git cd NeuroMesh
That's it. One command. Python 3.12+ required.
python3 src/neuromesh_v5.py
# Or with a custom config
python3 src/neuromesh_v5.py --config config/bug.json
Set a shared P2P secret and add peers. They discover each other automatically.
{
"node_name": "mynode",
"port": 8080,
"p2p_secret": "your-shared-secret",
"peers": [
{"name": "other-node", "host": "192.168.1.100", "port": 8080}
]
}
Memory sync, model sharing, and real-time communication — all automatic.
# Ping a node curl http://localhost:8080/api/ping # Query AI with auth TS=$(date +%s) SIG=$(echo -n "/api/query:$TS" | openssl dgst -sha256 \ -hmac "your-secret" | awk '{print $NF}') curl -X POST http://localhost:8080/api/query \ -H "X-NeuroMesh-Auth: $SIG" \ -H "X-NeuroMesh-TS: $TS" \ -H "Content-Type: application/json" \ -d '{"prompt":"Hello!","model":"glm-5.1:cloud"}'
Every node is identical. No master. No slave. Pure P2P.
┌─────────────────────────────────────────────┐
│ Node (Bug) │
│ ┌─────────┐ ┌──────────┐ ┌────────────┐ │
│ │ HTTP │ │WebSocket │ │ CRDT │ │
│ │ REST API│ │ Server │ │ Memory │ │
│ └────┬────┘ └────┬─────┘ └─────┬──────┘ │
│ │ │ │ │
│ └──────┬─────┘──────────────┘ │
│ │ │
│ ┌──────┴──────┐ │
│ │ AI Router │◄──── Ollama (local) │
│ └──────┬──────┘ │
│ │ │
│ ┌──────┴──────┐ │
│ │ Peer Mgr │◄──── Tailscale/Static │
│ └─────────────┘ │
└──────────────┬──────────────────────────────┘
│ WS + HTTP (gossip)
┌──────────────┴──────────────────────────────┐
│ Node (Pinky) │
│ (same architecture) │
└────────────────────────────────────────────┘
REST + WebSocket. Simple, typed, authenticated.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/ping | No | Health check |
| GET | /api/status | No | Node status, peers, memory stats |
| GET | /api/memory/{key} | No | Read a memory entry |
| POST | /api/memory/set | Yes | Write a memory entry |
| POST | /api/memory/push | Yes | Push memory entries (sync) |
| POST | /api/query | Yes | Query AI models |
| POST | /api/brain/chain | Yes | Chain multiple AI queries |
| POST | /api/trust/sign | Yes | Sign a peer's key (Web of Trust) |
| GET | /api/trust/{key} | No | Check trust score |
| GET | / | No | Web dashboard |
Connect to ws://host:port/ws and send typed JSON:
{"type": "auth", "hmac": "<signature>", "ts": "<timestamp>"}
{"type": "ping", "timestamp": 1234567890}
{"type": "query", "prompt": "What is AI?", "model": "glm-5.1:cloud"}
{"type": "memory_update", "key": "mykey", "entry": {"value": "mydata"}}
Full control from your terminal. The neuromesh command.