Proposal: Cache-Served Token Pricing #1636
theaungmyatmoe
started this conversation in
Protocol Improvements
Replies: 1 comment 2 replies
|
#1550 still in draft, it should be first step to make it possible |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Proposal: Cache-Served Token Pricing
Author: Aung Myat Moe — operator of the Fusion gateway (
api.fusioncode.app), a broker servingdeepseek-ai/DeepSeek-V4-Flash-0731,MiniMaxAI/MiniMax-M2.7, andmoonshotai/Kimi-K2.6through the Gonka network.Summary
The network already performs real per-host KV prefix caching, but GNK is billed flat per token — cached tokens cost the same as fresh ones. This proposal makes cache-served tokens bill at a reduced rate (proposed 10% of fresh input), so the network's actual hardware savings flow to brokers and their clients, and the network wins more cache-heavy workloads (agents, long stable system prompts) that currently go to centralized providers with native cache discounts (e.g. DeepSeek's ~90% cached-input price).
Motivation (measured)
Live measurement on 2026-08-24 against
api.openbroker.gonka.gg(deepseek-ai/DeepSeek-V4-Flash-0731, 52k-token prompt):prompt_tokens_detailsnullnullnullThe latency collapse proves vLLM is reusing the GPU KV cache per host. Yet GNK billing is flat: 15 nGNK per token for every token, cached or not (verified from the OpenBroker usage API and ledger). Downstream brokers therefore cannot offer cache-based pricing, so the network is structurally uncompetitive for cache-heavy traffic — the exact traffic DeepSeek's own API discounts ~90%.
Why hosts still profit
Host cost is dominated by prefill — attention over every token. A KV-cache hit means the prefill was already computed: the host spends ~0 compute on cached tokens and only generates the new completion. A discounted cached rate still pays the host more than idle GPU time and increases utilization — the discount is a utilization incentive, not a loss.
Proposed pricing model
cached_rate = input_rate × DISCOUNT(proposed defaultDISCOUNT = 0.10; negotiable per model)prompt_tokens_details.cached_tokenscounts are credited — never locally estimated valuesWith today's flat 15 nGNK/token and
DISCOUNT = 0.10, a request with 50k cached + 2k fresh input + 16 output tokens drops from780,240nGNK to82,740nGNK — an ~89% reduction, matching the real hardware savings.Implementation options
prompt_tokens_details.cached_tokensonce telemetry lands (PR feat: lossless prompt-cache metadata passthrough + explicit vLLM prefix caching #1633); it applies the discount when computing GNK deduction. Ships in days. Con: policy lives in gateway code, less auditable.cached_tokenscount;inference-chainbilling (seex/inference/epochgroup/unit_of_compute_price.go) computes the discounted cost. Single source of truth, validated, per-model factors via epoch params. Con: requires chain upgrade + validation changes.Prerequisite
PR #1633 (telemetry):
--enable-prefix-caching+--enable-prompt-tokens-detailsso vLLM emitsusage.prompt_tokens_details.cached_tokens. Full proposal doc in PR #1635 (proposals/cache-served-token-pricing/proposal.md).Open questions
cached_tokenswhen the validator saw no shared prefix)?Impact
x/inferencetokenomics, gateway/broker billing,common/validation, mlnode vLLM flags (PR feat: lossless prompt-cache metadata passthrough + explicit vLLM prefix caching #1633).All reactions