How Tenson Works Under the Hood
1. Weighted Redis ZSET Routing & Lua Slot Lock
Every 5-second worker heartbeat recalculates node score in pool::
Text
Score = (Reputation_Score * 0.50) + (Normalized_TPS * 0.30) + (Region_Bonus * 0.10) - (Normalized_Latency_ms * 0.10)
Nodes with reputation_ are automatically quarantined. Concurrent gateways reserve slots atomically via EVALSHA acquire_.
2. Failover State Machine
- 3,000ms Pre-TTFT Watchdog: Cancels stalled Node A (
job_), penalizes reputationcancel -2., and silently retries Node B (up to 2 retries) with zero buyer error.0 - Mid-Stream Disconnect: Terminates SSE with
finish_, refunds 100% of buyer escrow, and penalizes Node Areason: "error" -5..0 - Cold-Start Centralized Fallback: Transparently overflows when a model pool has 0 free slots to preserve 99.9% SLA.
3. Zero-Log Privacy & Optimistic GPU Audits
Raw prompts never touch PostgreSQL or disk logs. On job_, 3% of jobs (15% for new nodes with <100 jobs) are buffered in volatile Redis RAM (TTL 300s), replayed on canonical reference GPUs, and deleted immediately upon verdict. Confirmed spoofers are banned with 100% stake slashed.