Skip to main content

Tenson (tenson.app): Formal Technical Whitepaper

Version 1.1 · Open-Weights Peer-to-Peer AI Inference Cloud


Abstract​

Open-weights large language models (Qwen3, DeepSeek-R1, Llama 3.3, GPT-OSS, Mistral, Gemma 3) now match frontier proprietary intelligence while executing at high throughput on prosumer silicon—specifically 24–48 GB NVIDIA RTX GPUs and 64–192 GB unified-memory Apple Silicon workstations. Tenson (tenson.app) aggregates this globally distributed idle silicon into a single, OpenAI-compatible Edge API cloud with $0 hardware CapEx.

This paper formalizes Tenson's four core subsystems:

  1. Weighted Redis 7 ZSET Routing & Atomic Concurrency Control (acquire_slot.lua via EVALSHA).
  2. Immutable PostgreSQL 16 Double-Entry Accounting with atomic pre-flight escrow, exact 80/2080/20 settlement, and 7-day rolling holdbacks over fiat Stripe rails.
  3. Multi-Stage Tail-Latency Failover combining 3,000 ms3{,}000\,\text{ms} TTFT silent retries, 100%100\% mid-stream refunds, and invisible centralized overflow.
  4. Optimistic GPU Audits—a game-theoretic verification mechanism that makes model spoofing strictly negative expected value without per-request cryptographic overhead.

1. Marginal Cost & CapEx-Zero Economics​

Let a centralized GPU cloud amortize hardware acquisition ChwC_{\text{hw}}, data-center power/cooling CdcC_{\text{dc}}, and cluster ops CopsC_{\text{ops}} over utilization factor u∈(0,1]u \in (0,1] and lifetime TT:

ccloud=Chw+Cdc+Copsu⋅T⋅Φtokc_{\text{cloud}} = \frac{C_{\text{hw}} + C_{\text{dc}} + C_{\text{ops}}}{u \cdot T \cdot \Phi_{\text{tok}}}

where Φtok\Phi_{\text{tok}} is peak sustained tokens per second. In contrast, Tenson recruits already-amortized edge silicon (Chw=0C_{\text{hw}} = 0 to the network) whose marginal serving cost is strictly incremental power draw ΔP\Delta P at residential/office electricity rate ekWhe_{\text{kWh}}:

cedge=ΔP⋅ekWh3.6×106⋅Φtok≪ccloudc_{\text{edge}} = \frac{\Delta P \cdot e_{\text{kWh}}}{3.6 \times 10^6 \cdot \Phi_{\text{tok}}} \ll c_{\text{cloud}}

By eliminating fixed hardware amortization, Tenson sustains competitive Buyer pricing while returning 80%80\% of gross inference revenue to hardware Sellers.


2. Weighted ZSET Routing & Atomic Slot Locking​

Let Nm\mathcal{N}_m denote the set of worker nodes advertising canonical model mm with an active Redis heartbeat key node:hb:<id> (TTL=15 s\text{TTL} = 15\,\text{s}, refreshed every 5 s5\,\text{s}).

2.1 Scoring Function​

For candidate node n∈Nmn \in \mathcal{N}_m and Buyer ingress region rbuyerr_{\text{buyer}}, Tenson computes a bounded composite routing score S(n,rbuyer)∈[−10,90]S(n, r_{\text{buyer}}) \in [-10, 90]:

S(n,rbuyer)=I[Rn≥60]⋅(0.50 Rn+0.30 τ~n+0.10 ρ(n,rbuyer)−0.10 ℓ~n)S(n, r_{\text{buyer}}) = \mathbb{I}[R_n \ge 60] \cdot \Big( 0.50\, R_n + 0.30\, \tilde{\tau}_n + 0.10\, \rho(n, r_{\text{buyer}}) - 0.10\, \tilde{\ell}_n \Big)

where:

  • Rn∈[0,100]R_n \in [0, 100] is node nn's reputation score, with hard quarantine floor I[Rn≥60]=0\mathbb{I}[R_n \ge 60] = 0 for Rn<60.0R_n < 60.0 (evicted from grid:model:<m>).
  • τ~n=100⋅min⁡ ⁣(τn150, 1)\tilde{\tau}_n = 100 \cdot \min\!\left(\frac{\tau_n}{150},\, 1\right) is normalized throughput relative to a 150 tok/s150\,\text{tok/s} reference ceiling.
  • ρ(n,rbuyer)=100⋅I[rn=rbuyer]\rho(n, r_{\text{buyer}}) = 100 \cdot \mathbb{I}[r_n = r_{\text{buyer}}] is the regional proximity bonus.
  • ℓ~n=100⋅min⁡ ⁣(ℓn1000, 1)\tilde{\ell}_n = 100 \cdot \min\!\left(\frac{\ell_n}{1000},\, 1\right) is normalized median latency in milliseconds.

2.2 Atomic Concurrency Invariant​

Let ana_n be active in-flight jobs on node nn and MnM_n its declared max_concurrent capacity. Oversubscription is prevented via single-threaded Redis Lua execution (acquire_slot.lua):

Acquire(n)={1,if EXISTS(hbn)=1  ∧  an<Mn(atomically an←an+1)0,otherwise\text{Acquire}(n) = \begin{cases} 1, & \text{if } \text{EXISTS}(\text{hb}_n) = 1 \;\land\; a_n < M_n \quad (\text{atomically } a_n \leftarrow a_n + 1) \\ 0, & \text{otherwise} \end{cases}

Every acquired slot carries a 60 s60\,\text{s} safety TTL and is decremented via release_slot.lua in a guaranteed defer block.


3. Double-Entry Ledger & Settlement Mathematics​

All balances are denominated in integer points where 1,000 pts≡1.00 USD1{,}000\,\text{pts} \equiv 1.00\,\text{USD}, eliminating floating-point rounding drift.

3.1 Pre-Flight Escrow Ceiling​

For job jj targeting model mm with input rate rin(m)r_{\text{in}}^{(m)} and output rate rout(m)r_{\text{out}}^{(m)} (points per 10610^6 tokens), estimated prompt length tint_{\text{in}}, and requested max_tokens tmax⁡t_{\max}:

E(j)=⌈tin⋅rin(m)+tmax⁡⋅rout(m)106⌉E(j) = \left\lceil \frac{t_{\text{in}} \cdot r_{\text{in}}^{(m)} + t_{\max} \cdot r_{\text{out}}^{(m)}}{10^6} \right\rceil

Inside a serialized PostgreSQL transaction (SELECT id FROM users WHERE id = $1 FOR UPDATE), Gateway asserts:

Bbuyer=∑e∈Lbuyereamount≥E(j)B_{\text{buyer}} = \sum_{e \in \mathcal{L}_{\text{buyer}}} e_{\text{amount}} \ge E(j)

before appending escrow_hold (−E(j)-E(j)). Failure returns HTTP 402 Payment Required.

3.2 Exact Post-Stream 80/2080/20 Settlement​

Upon receiving job_complete with exact prompt tokens tin∗t_{\text{in}}^{*} and completion tokens tout∗t_{\text{out}}^{*}:

C(j)=⌈tin∗⋅rin(m)+tout∗⋅rout(m)106⌉C(j) = \left\lceil \frac{t_{\text{in}}^{*} \cdot r_{\text{in}}^{(m)} + t_{\text{out}}^{*} \cdot r_{\text{out}}^{(m)}}{10^6} \right\rceil

With platform fee β=2000 bps\beta = 2000\,\text{bps} (20.00%20.00\%):

Pseller(j)=⌊C(j)⋅(10,000−β)10,000⌋,Fplatform(j)=C(j)−Pseller(j)P_{\text{seller}}(j) = \left\lfloor \frac{C(j) \cdot (10{,}000 - \beta)}{10{,}000} \right\rfloor, \qquad F_{\text{platform}}(j) = C(j) - P_{\text{seller}}(j)

In a single ACID transaction, Gateway appends four immutable entries: +E(j) (escrow_release), -C(j) (job_charge), +P_{\text{seller}}(j) (job_payout), and +F_{\text{platform}}(j) (platform_fee to Treasury).

3.3 Zero-Sum Conservation Invariant​

Continuously exported to Prometheus (tenson_ledger_reconciliation_diff):

Δreconcile=∑e∈job_charge∣eamount∣−(∑e∈job_payouteamount+∑e∈platform_feeeamount)≡0\Delta_{\text{reconcile}} = \sum_{e \in \text{job\_charge}} |e_{\text{amount}}| - \left( \sum_{e \in \text{job\_payout}} e_{\text{amount}} + \sum_{e \in \text{platform\_fee}} e_{\text{amount}} \right) \equiv 0

3.4 7-Day Rolling Holdback & Withdrawable Balance​

At timestamp tt, Seller ss's withdrawable balance Ws(t)W_s(t) excludes unmatured job_payout entries younger than ΔH=7 days\Delta_H = 7\,\text{days}:

Ws(t)=∑e∈Lsetype≠job_payout∨(t−ets)≥ΔHeamountW_s(t) = \sum_{\substack{e \in \mathcal{L}_s \\ e_{\text{type}} \ne \text{job\_payout} \;\lor\; (t - e_{\text{ts}}) \ge \Delta_H}} e_{\text{amount}}

A Stripe Connect Express bank withdrawal of ww points is permitted if and only if w≥25,000w \ge 25{,}000 ($25.00 USD) and w≤Ws(t)w \le W_s(t).


4. Tail-Latency Failover & Reliability Bounds​

Let pttftp_{\text{ttft}} be the probability that a randomly selected online P2P node fails to emit token #1 within Tttft=3,000 msT_{\text{ttft}} = 3{,}000\,\text{ms}. With k=3k = 3 independent P2P attempts (1 primary + 2 silent retries) prior to centralized overflow:

P(P2P TTFT failure)=pttft3P(\text{P2P TTFT failure}) = p_{\text{ttft}}^3

For example, even if individual consumer nodes exhibit pttft=0.05p_{\text{ttft}} = 0.05 (5%5\%), silent failover drives P2P failure down to 0.053=0.0001250.05^3 = 0.000125 (0.0125%0.0125\%, or 99.9875%99.9875\% P2P success) before the invisible centralized overflow cluster (OVERFLOW_BASE_URL) absorbs the remaining tail:

P(overall request failure)=pttft3⋅poverflowP(\text{overall request failure}) = p_{\text{ttft}}^3 \cdot p_{\text{overflow}}


5. Optimistic GPU Audits: Game-Theoretic Security​

Rather than executing expensive zero-knowledge proofs (zkML) on every 30B–70B forward pass, Tenson enforces honest model execution via Optimistic GPU Audits backed by economic slashing.

5.1 Adaptive Sampling Policy​

For node nn with NnN_n completed jobs and warning flag wn∈{0,1}w_n \in \{0, 1\}:

psample(Nn,wn)={0.25,if wn=1 (warned)0.15,if Nn<100 (new node)0.03,otherwise (established)p_{\text{sample}}(N_n, w_n) = \begin{cases} 0.25, & \text{if } w_n = 1 \text{ (warned)} \\ 0.15, & \text{if } N_n < 100 \text{ (new node)} \\ 0.03, & \text{otherwise (established)} \end{cases}

5.2 Output Verification Metric​

For sampled job jj, services/auditor replays the prompt on a trusted reference GPU yielding reference text yrefy_{\text{ref}} and computes normalized token Jaccard similarity against Seller output ynodey_{\text{node}}:

σ(yref,ynode)=∣T(yref)∩T(ynode)∣∣T(yref)∪T(ynode)∣∈[0,1]\sigma(y_{\text{ref}}, y_{\text{node}}) = \frac{|T(y_{\text{ref}}) \cap T(y_{\text{node}})|}{|T(y_{\text{ref}}) \cup T(y_{\text{node}})|} \in [0, 1]

Decision boundaries adapt to sampling temperature θ\theta:

Verdict(σ,θ)={pass  (+0.5 rep),(θ≤0.1∧σ≥0.88)  ∨  (θ>0.1∧σ≥0.65)warn  (−5.0 rep),(θ≤0.1∧0.65≤σ<0.88)  ∨  (θ>0.1∧0.40≤σ<0.65)fail_spoof  (ban+100% slash),otherwise\text{Verdict}(\sigma, \theta) = \begin{cases} \text{pass} \;(+0.5\text{ rep}), & (\theta \le 0.1 \land \sigma \ge 0.88) \;\lor\; (\theta > 0.1 \land \sigma \ge 0.65) \\ \text{warn} \;(-5.0\text{ rep}), & (\theta \le 0.1 \land 0.65 \le \sigma < 0.88) \;\lor\; (\theta > 0.1 \land 0.40 \le \sigma < 0.65) \\ \text{fail\_spoof} \;(\text{ban} + 100\%\text{ slash}), & \text{otherwise} \end{cases}

5.3 Incentive Compatibility Theorem​

Suppose a rational Seller considers spoofing a large model mLm_L using a cheaper small model mSm_S, gaining marginal cost savings Δc>0\Delta c > 0 per job while risking forfeiture of staked + 7-day unmatured holdback capital Kn=Sn+HnK_n = S_n + H_n. The expected single-job profit of spoofing is:

E[Πspoof]=(1−psample)⋅Δc−psample⋅Kn\mathbb{E}[\Pi_{\text{spoof}}] = (1 - p_{\text{sample}}) \cdot \Delta c - p_{\text{sample}} \cdot K_n

Honest execution is the unique Nash equilibrium whenever:

Kn>1−psamplepsample⋅ΔcK_n > \frac{1 - p_{\text{sample}}}{p_{\text{sample}}} \cdot \Delta c

For a new node (psample=0.15p_{\text{sample}} = 0.15) with Δc=5 pts\Delta c = 5\,\text{pts} ($0.005) per job, any holdback/stake Kn>28.3 ptsK_n > 28.3\,\text{pts} ($0.03) makes spoofing strictly negative expected value—and because the 7-day rolling holdback naturally accumulates Kn≫1,000 ptsK_n \gg 1{,}000\,\text{pts}, rational Sellers are strictly incentivized to run authentic weights.


6. Structural Zero-Log Privacy​

Let DPG\mathcal{D}_{\text{PG}} be persistent PostgreSQL storage and DRAM\mathcal{D}_{\text{RAM}} be volatile RAM-only Redis (--appendonly no). Tenson enforces:

  1. ∀j,  (promptj,outputj)∉DPG\forall j,\; (\text{prompt}_j, \text{output}_j) \notin \mathcal{D}_{\text{PG}} (schema contains no text payload columns).
  2. For non-sampled jobs (97%97\% of established traffic), (promptj,outputj)∉DRAM(\text{prompt}_j, \text{output}_j) \notin \mathcal{D}_{\text{RAM}} after stream termination.
  3. For sampled jobs (3%3\%), payload lifetime is strictly bounded by min⁡(taudit,300 s)\min(t_{\text{audit}}, 300\,\text{s}) via Redis EXPIRE 300 and atomic GETDEL consumption by services/auditor.