P2P Mode (Decentralized API)
P2P mode is designed to let AI Power Grid run in a decentralized mode using libp2p gossipsub, with no central server required.
P2P mode is in beta. The primary, default path today is the hosted API at
https://api.aipowergrid.io/v1 — the coordinator is centralized. The
decentralized mode described below is the goal P2P is building toward, not the
current default.
Why P2P?
| Centralized (Default) | Decentralized (P2P) |
|---|---|
| Single API server | Multiple API nodes |
| Redis job queue | Gossipsub messaging |
| Single point of failure | No single point of failure |
| You run the server | Network runs itself |
The Vision
┌─────────────────────────────────────────────────────────────────┐
│ P2P MESH │
│ (libp2p gossipsub) │
│ │
│ Every node connects to every other node. │
│ The goal: no central server, no single point of failure — │
│ the Grid runs itself. │
└────────────┬──────────────────────────┬─────────────────────────┘
│ │
┌────────▼────────┐ ┌────────▼────────┐
│ API Node 1 │ │ API Node 2 │ ... N nodes
│ (anywhere) │ │ (anywhere) │
└────────▲────────┘ └────────▲────────┘
│ │
HTTP request HTTP request
│ │
┌────────┴────────┐ ┌────────┴────────┐
│ User A │ │ User B │
└─────────────────┘ └─────────────────┘
┌─────────────────┐ ┌─────────────────┐
│ Worker 1 │ │ Worker 2 │ ... N workers
│ (your PC) │ │ (cloud GPU) │
│ │ │ │
│ Ollama/vLLM │ │ Ollama/vLLM │
└────────┬────────┘ └────────┬────────┘
│ │
└──────────────────────────┘
P2P meshWhat P2P Mode Aims to Enable
These are the design goals of P2P mode, not guarantees of the current beta:
- No Central Server: Jobs distributed via gossipsub, not Redis
- Permissionless: Anyone can run a worker or API node
- Censorship Resistant: Designed so there’s no central point to shut down
- Trustless: Deterministic claim resolution, aiming to avoid voting
- Self-Healing: Nodes join and leave, network adapts
Quick Start
Requirements
- Python 3.11+
libp2pandtriopackages- At least one bootstrap node address
pip install libp2p trioStatus
P2P mode is currently in beta. The hybrid queue allows running both Redis and P2P simultaneously during transition.