Failover, SLA & Rate Limits
Peer-to-peer hardware is inherently more dynamic than a single colocation rack. Tenson engineers reliability directly into the Edge API Gateway so Buyers experience centralized-grade uptime at P2P prices.
1. Silent 3,000ms TTFT Failover
- When
POST /arrives, the Gateway selects the highest-scoring online node from Redis ZSETv1/ chat/ completions grid:and atomically reserves a concurrency slot viamodel: <id> acquire_.slot. lua - The Gateway dispatches
job_over the worker's persistent WebSocket and starts a strict 3,000ms Time-To-First-Token (TTFT) timer.request - If the worker stalls, is cold-loading weights, or loses connectivity before emitting token #1:
- Gateway immediately sends
job_(cancel reason: "ttft_).timeout_ 3000ms" - Releases the Redis slot via
release_.slot. lua - Applies a
-2.reputation penalty to the stalled node in PostgreSQL.0 - Silently retries the next highest-scoring node (up to 2 P2P retries).
- Gateway immediately sends
Your SDK never sees a dropped connection or error during pre-first-token failover.
2. 100% Mid-Stream Drop Protection
Once token #1 has been streamed to the Buyer, silent retry is impossible. If a worker disconnects mid-stream:
- The WebSocket Hub detects the closed socket immediately and closes all active
Jobchannels for that node withStream Err.Worker Disconnected - Gateway runs
Refund— returning 100% of your reserved escrow points automatically (you payEscrow $0.for any incomplete stream).00 - Gateway logs
status = 'failed_inmidstream' inference_and docks the workerjobs -5.reputation.0
3. Invisible Centralized Overflow Fallback
During regional demand spikes when all P2P concurrency slots for a model are full:
- Rather than returning
503, the Gateway transparently streams the request through Tenson's configured upstream open-weights cluster (OVERFLOW_).BASE_ URL - Pricing to the Buyer remains identical.
inference_is recorded asjobs. is_ fallback true, and Platform Treasury retains100%of the job charge to cover upstream compute cost.
4. Rate Limits (429 Too Many Requests)
Every API key carries per-key rate_ (default 60–120 RPM) enforced in Redis via rl: with a 65s TTL. Exceeding the limit returns standard OpenAI 429 (error.).