Cortensor-Native AI Orchestration Infrastructure β A production-grade distributed inference system that decomposes complex tasks, routes them through Cortensor nodes, validates outputs, and distributes micropayments based on performance.
- Project Overview
- Architecture
- Key Features
- Getting Started
- Configuration
- State Machine
- Scoring Formula
Fractal Inference Swarms is a Kubernetes-like orchestration layer for decentralized AI inference. It sits on top of the Cortensor network and provides:
- Intelligent Task Decomposition β Break complex prompts into atomic subtasks
- Distributed Inference Routing β Route subtasks to multiple Cortensor nodes
- Validation & Consensus β Validate outputs using Cortensor validators
- Result Aggregation β Merge validated outputs into unified responses
- PoUW-Based Scoring β Rank node performance using multi-factor metrics
- Micropayment Distribution β Reward high-performing nodes with x402 tokens
- Real-Time Observability β Monitor the entire swarm lifecycle via dashboard
This is not a prototype. This is enterprise-grade AI infrastructure designed for production workloads.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interface β
β (Next.js Real-Time Dashboard) β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Fractal Orchestrator β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ β
β β Task Splitterβ β Merge Engine β β Scoring Engine β β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ β
β β Validation β βReward Engine β β WebSocket Serverβ β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cortensor Network β
β β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β
β β Node A β β Node B β β Node C β β Node D β ... β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Cortensor Validators (Consensus) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Mock x402 Payment Ledger β
β (Ready for Real Blockchain Integration) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Automatic task decomposition into optimized subtasks
- Dynamic subtask routing to available Cortensor nodes
- State machine lifecycle tracking (see State Machine)
- Cross-validation of outputs from multiple nodes
- Cortensor validator consensus integration
- Conflict resolution using confidence-weighted voting
- Quality gates to reject low-confidence results
- Synthesizes distributed outputs into a coherent final result
- Contribution mapping β tracks which node provided what
- Confidence scoring for merged output
- Deduplication and format normalization
Node performance is evaluated using a configurable multi-factor formula (see Scoring Formula):
- Configurable weights via environment variables
- Multi-dimensional node evaluation
- Real-time leaderboard updates
- Mock x402 micropayment distribution
reward = baseReward Γ normalizedScore- Complete transaction ledger with audit trail
- Stake simulation (increases/slashing based on performance)
- WebSocket-powered live updates
- Agent spawn animations
- Session lifecycle visualization
- Validator consensus progress bars
- Leaderboard and reward distribution charts
# Clone the repository
git clone https://github.com/your-org/fractal-inference-swarms.git
cd fractal-inference-swarms
# Install dependencies
npm install
# Configure environment variables
cp .env.example .env
# Start the orchestrator
npm run start
# Launch the dashboard
npm run dashboard| Environment Variable | Description | Default |
|---|---|---|
CORTENSOR_ENDPOINT |
Cortensor network RPC endpoint | http://localhost:8545 |
SCORING_WEIGHT_CONSENSUS |
Weight for consensus score (wβ) |
0.30 |
SCORING_WEIGHT_CONFIDENCE |
Weight for confidence score (wβ) |
0.25 |
SCORING_WEIGHT_SPEED |
Weight for speed score (wβ) |
0.25 |
SCORING_WEIGHT_RELIABILITY |
Weight for reliability score (wβ) |
0.20 |
BASE_REWARD |
Base x402 micropayment per task | 100 |
WEBSOCKET_PORT |
Port for real-time dashboard feed | 3001 |
Each task passes through the following lifecycle stages:
CREATED β SPLIT β ROUTED β VALIDATING β MERGED β FINALIZED
| State | Description |
|---|---|
CREATED |
Task received and queued |
SPLIT |
Task decomposed into atomic subtasks |
ROUTED |
Subtasks dispatched to Cortensor nodes |
VALIDATING |
Outputs under consensus validation |
MERGED |
Validated outputs aggregated |
FINALIZED |
Result delivered, rewards distributed |
Node performance scores are computed as a weighted sum across four dimensions:
Final Score = wβ Γ consensus + wβ Γ confidence + wβ Γ speed + wβ Γ reliability
Where all weights (wβ through wβ) sum to 1.0 and are configurable via environment variables. Reward distribution is then calculated as:
reward = baseReward Γ normalizedScore
See LICENSE for details.