Decentralized AI Compute Grid
Monkey Troop is a FOSS (MIT Licensed) peer-to-peer network that democratizes access to AI inference. Users donate idle GPU time to run LLM inference for others in exchange for time-based credits, similar to folding@home but for AI.
Enable anyone to:
- Donate idle GPU compute when not in use locally
- Earn credits based on actual hardware performance (time-based, normalized)
- Use those credits to access high-performance GPUs when needed
- Trust the network through cryptographic verification and proof-of-hardware
- π Secure P2P Mesh: Direct node-to-node connections via Tailscale/Headscale (WireGuard)
- π― OpenAI Compatible: Drop-in replacement for any tool using OpenAI API
- βοΈ Fair Economy: Time-based credits with hardware multipliers (RTX 4090 = 4x, etc.)
- π Proof-of-Hardware: Cryptographic benchmarking prevents hardware spoofing
- π€ Trusted Clusters: Create private networks with friends/teams
- π Public Commons: Join the global network at
troop.100monkeys.ai - π§ Multi-Engine: Supports Ollama, LM Studio, vLLM, and more
βββββββββββββββ ββββββββββββββββββββ βββββββββββββββ
β Client ββββββββββΊβ Coordinator ββββββββββΊβ Worker β
β (Sidecar) β Tickets β (troop.monkey.ai)βDiscoveryβ (Agent) β
β β β β β β
β localhost: β β - Redis Registry β β - Ollama β
β 9000 β β - PostgreSQL β β - Tailscale β
βββββββββββββββ β - JWT Auth β β - GPU β
β ββββββββββββββββββββ βββββββββββββββ
β β²
β Direct P2P Connection β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
(Encrypted via Tailscale WireGuard)- Coordinator (Python/FastAPI): Discovery, authentication, proof-of-hardware verification
- Worker (Rust): GPU monitoring, heartbeat broadcasting, JWT verification proxy
- Client (Rust): Local OpenAI-compatible API proxy for seamless integration
- Shared (Rust): Common data structures and types
There are two installation paths depending on your role:
Install the worker (to donate GPU) or client (to use GPU) to join an existing network.
# Install worker/client binaries
curl -fsSL https://raw.githubusercontent.com/monkeytroop/monkey-troop/main/install.sh | bash
# Join the public network
export COORDINATOR_URL="https://troop.100monkeys.ai/api"
tailscale up --login-server=https://troop.100monkeys.ai/vpn --authkey=<provided-key>
# Start donating compute
monkey-troop-worker
# OR use the network (in another terminal)
monkey-troop-client
# Point your AI tool to: http://localhost:9000/v1Deploy your own coordinator with Headscale VPN for a private network.
# Clone repository on your VPS
git clone https://github.com/monkeytroop/monkey-troop.git
cd monkey-troop
# Run automated installer (interactive)
./install-coordinator.sh
# OR with command-line flags
./install-coordinator.sh \
--domain troop.example.com \
--email admin@example.com \
--routing-mode path \
--enable-backupsWhat gets installed:
- β Headscale VPN server (node discovery)
- β Coordinator API (FastAPI + PostgreSQL + Redis)
- β Caddy reverse proxy (automatic HTTPS)
- β Systemd services (auto-restart)
- β Optional: Daily database backups
See DEPLOYMENT.md for detailed documentation.
For advanced users who want full control, see DEPLOYMENT.md for manual Headscale setup instructions.
- Rust 1.75+ (for worker/client)
- Python 3.11+ (for coordinator)
- Docker & Docker Compose
- PostgreSQL 15+
- Redis 7+
# Clone the repository
git clone https://github.com/monkeytroop/monkey-troop.git
cd monkey-troop
# Build Rust components
cargo build --release
# Set up Python environment
cd coordinator
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt# Start coordinator stack
docker-compose -f docker-compose.coordinator.yml up -d
# Run worker (requires GPU)
cargo run --bin monkey-troop-worker
# Run client
cargo run --bin monkey-troop-clientEnable streaming responses for real-time token generation:
import requests
response = requests.post(
"http://localhost:3000/v1/chat/completions",
json={
"model": "llama3:8b",
"messages": [{"role": "user", "content": "Write a story"}],
"stream": True
},
stream=True
)
for chunk in response.iter_lines():
if chunk:
print(chunk.decode('utf-8'))Monkey Troop automatically detects and supports multiple inference engines:
- vLLM (highest priority - fastest inference)
- Ollama (versatile, easy setup)
- LM Studio (GUI-based management)
Workers detect all available engines at startup and route requests intelligently based on model availability. vLLM models are prioritized for performance.
Setup vLLM (optional):
# Install vLLM
pip install vllm
# Start vLLM server
vllm serve meta-llama/Llama-3-8B --port 8000
# Or use custom host
export VLLM_HOST=http://localhost:8000Configure model refresh (optional):
# Check for new models every 5 minutes (default: 3 minutes)
export MODEL_REFRESH_INTERVAL=300- docs/DEPLOYMENT.md - Deploy your own Headscale coordinator
- CONTRIBUTING.md - Development setup and guidelines
- docs/PROJECT_STRUCTURE.md - Project architecture details
- docs/MVP_STATUS.md - Implementation status and roadmap
- docs/TESTING_GUIDE.md - Testing instructions
Monkey Troop is fully open source (MIT License). Contributions are welcome!
See CONTRIBUTING.md for development setup.
MIT License - Copyright (c) 2026 Monkey Troop Contributors
Inspired by:
- Petals - Distributed inference concepts
- Folding@home - Distributed computing for good
- Ollama - Local LLM runtime
- Tailscale - Zero-config VPN mesh networking
π¨ Status: Phase 2 Complete - Production-Ready Alpha (93.8%)
The system includes:
- β Credit accounting with PostgreSQL ledger
- β Rate limiting (100/hr default, 20/hr strict)
- β Audit logging to PostgreSQL
- β JWT-based authorization (RSA-2048)
- β Proof-of-Hardware benchmarking
- β Timeout enforcement (5s/30s/300s)
- β Streaming responses (Server-Sent Events)
- β Multi-engine support (Ollama, vLLM, LM Studio)
- β Integration tests + CI/CD pipeline
- π§ VPS deployment (handled separately)
See docs/MVP_STATUS.md for detailed progress.
Join us in building the future of decentralized AI!