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.