Scoring: price, latency, quality
The auction ranks effective cost, not sticker price. Latency and quality are measured by the router, not claimed by providers.
Version second-score/3 ranks effective cost rather than sticker price. Expected request cost is multiplied by measured latency and service factors; the lowest score wins. Money remains integer USDC base units. Floating-point scoring chooses a provider but never touches a stored balance.
The score inputs
| Input | Source | Effect |
|---|---|---|
expected cost | signed input, cached-input, and output rates × forecast tokens | the raw monetary base of the score |
TTFT | router-measured time to first token | priority-weighted latency markup, capped against the fastest candidate |
reliability | router-observed completion success | penalizes fast-first-byte but incomplete service |
trust | verification score for provider and model class | penalizes adverse integrity evidence |
throughput | router-measured output rate | penalizes materially slower completion than the measured field |
New or clean providers are not assigned an automatic quality bonus: every service factor is 1.0 when there is no adverse signal. Raw expected cost remains separate so the customer cap is priced on genuine cost rather than a quality penalty.
Customer priorities
cheapest, balanced, and fastest change the exchange rate between expected cost and measured TTFT. Reliability, trust, and throughput protections remain in the service factor. The same clearing and disclosure rules apply to every preset.
- router/src/market/auction.ts the second-score/3 effective-cost calculation
- router/src/market/quotes.ts measured latency, reliability, and throughput
- router/src/trust/verification.ts verification trust input