Comprehensive guides for peer-to-peer networking, distributed workflows, and libp2p integration.
- P2P Setup Guide - Main P2P setup guide
- P2P & MCP Architecture - Complete P2P and MCP documentation
- P2P Workflow Scheduler - Workflow scheduling guide
- P2P Workflow Quick Start - Quick start guide
- P2P Cache Deadlock Fix - Troubleshooting deadlocks
- P2P Cache Encryption - Secure P2P communications
- P2P Workflow Discovery - Discover and join P2P workflows
- P2P Workflow Scheduler - Advanced scheduling features
- P2P Autoscaler Quick Reference - Quick reference for autoscaling
- libp2p Universal Connectivity - Universal connectivity setup
- MCP P2P Setup Guide - Integrate MCP with P2P
IPFS Accelerate uses libp2p for peer-to-peer networking, enabling:
- Distributed Inference: Share compute across network peers
- Content Addressing: Cryptographically secure model distribution
- Fault Tolerance: Automatic failover and recovery
- Load Balancing: Distribute work across available peers
The P2P workflow scheduler uses Merkle clocks for distributed consensus:
from ipfs_accelerate_py.p2p_workflow_scheduler import MerkleClock
# Create clock for this node
clock = MerkleClock(node_id="node-123")
# Synchronize with other nodes
clock.update(other_node_clock)
# Get consensus hash
consensus_hash = clock.get_hash()Efficient priority-based task scheduling:
from ipfs_accelerate_py.p2p_workflow_scheduler import P2PWorkflowScheduler
scheduler = P2PWorkflowScheduler(node_id="worker-01")
await scheduler.start()
# Submit high-priority task
await scheduler.submit_workflow({
"name": "urgent-task",
"priority": 1, # Lower = higher priority
"tasks": [...]
})# Install P2P dependencies
pip install ipfs-accelerate-py[p2p]
# Start P2P node
ipfs-accelerate p2p start --node-id my-node
# Join network
ipfs-accelerate p2p join --bootstrap /ip4/...from ipfs_accelerate_py.p2p_workflow_scheduler import (
P2PWorkflowScheduler,
WorkflowTag
)
async def main():
# Create scheduler
scheduler = P2PWorkflowScheduler(node_id="worker-01")
await scheduler.start()
# Submit distributed workflow
workflow_id = await scheduler.submit_workflow({
"name": "batch-inference",
"tag": WorkflowTag.P2P_ELIGIBLE,
"tasks": [
{"model": "bert-base", "input": "text1"},
{"model": "bert-base", "input": "text2"}
]
})
# Monitor progress
status = await scheduler.get_workflow_status(workflow_id)
print(f"Progress: {status['completed']}/{status['total']}")┌─────────────────────────────────────────────┐
│ P2P Network Topology │
├─────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ Node A │◄────►│ Node B │ │
│ │ (Worker) │ │ (Worker) │ │
│ └──────────┘ └──────────┘ │
│ ▲ ▲ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ │
│ │ Node C │◄────►│ Node D │ │
│ │(Scheduler)│ │(Bootstrap)│ │
│ └──────────┘ └──────────┘ │
│ │
└─────────────────────────────────────────────┘
Last Updated: January 2026