why cached inference is an ad network, not an orderbook
The Surplus Intelligence marketplace uses an orderbook: providers list prices per million tokens, buyers pay the cheapest listing. That's the right model for unused capacity — GPU hours are a commodity. But it's the wrong model for cached inference, and here's why.
Cached inference behaves exactly like programmatic advertising. The mapping is precise:
| ad network | surp cache auction |
|---|---|
| cookie / user data | prompt prefix hash (SHA-256 of first N tokens) |
| DSP bid request | gateway broadcasts: "prefix hash X, Y output tokens, SLA Z" |
| DSP evaluates inventory + data match | provider checks KV cache for prefix X |
| DSP bids based on match rate | provider bids based on cached-token fraction |
| second-price (Vickrey) auction | lowest bid wins, pays second-lowest |
| win/loss + latency feedback | wall-clock latency reveals true cache state |
| cookie fraud | cache-state fraud (claiming cache hit when fresh) |
The critical insight: the prompt prefix is a disclosed signal, not a secret. The gateway hashes the prefix (system prompt + first chunk of user message) into a 16-character fingerprint. This is exactly like a cookie ID in ad tech:
Providers who have prefix X warm in their KV cache should bid lower to win the fill — and they want to, because their marginal cost is near-zero. The orderbook prevents this price discovery from happening.
Providers would lie about cache state ("yes I have 80% cached" when they have 0%). But we can verify: a cache hit is 5-10x faster than fresh compute for the same token count. surp already measures wall-clock latency per model via the health board. So we infer true cache state from the latency/token ratio, and penalize providers whose bids implied cache but whose latency proved fresh compute.
This is the ad-network "post-bid verification" layer — the same mechanism DSPs use to detect cookie fraud. A provider that discounts its bid (claiming cache) but serves with fresh-compute latency loses its affinity score, and future bids won't discount. The system is self-correcting.
methodology: Prefix-hash affinity: SHA-256 of normalized prefix (cookie-like). Cache state inferred from latency/token ratio (post-bid verification). Providers with high affinity discount below list price (Vickrey-style).
The full auction requires provider-side cooperation (they must check KV cache and bid). SI's static orderbook doesn't support that yet. But surp has built the gateway-side infrastructure that makes the auction possible:
cache_affinity.prefix_hash() — SHA-256 of normalized prefix, 16 chars, no plaintext leakage.cache_affinity.proposed_bid() discounts list price up to 50% for models with high affinity — the DSP bid based on match rate./api/stats under cache_affinity.The missing piece is provider cooperation. To run a real auction, Surplus Intelligence providers would need to:
This is a protocol change, not a code change. surp's gateway is ready to participate the moment SI exposes a bid-request endpoint. Until then, the affinity data we collect is the public good that proves the mechanism works.
Orderbook pricing for cached inference overcharges buyers and under-rewards cache creators. A buyer asking the same prefix twice pays list price both times, even though the second fill cost the provider ~5x less. An auction would let the cached provider bid lower, win the fill, and pass savings to the buyer — while still earning more than the commodity margin. The exact-response cache and SRP reward ledger are surp's current approximation of this; the affinity auction is the full vision.
related: cache-aware routing · provider health board · reward proposal · free models · API docs