WorldFlow AI / self-hosted inference

How much capacity does semantic reuse give back?

Model your private LLM fleet as three outcomes: semantic reuse hits recover prefill computation from semantically similar context, exact-prefix hits reuse byte-identical prefixes, and misses recompute everything. The model always runs and generates a fresh answer; reuse removes the redundant compute. Traffic profile in, monthly fleet cost and reclaimed capacity out.

Traffic
Reuse
Similar-but-not-identical context. WorldFlow reuses validated KV computation, so prefill is skipped; the model still decodes a fresh answer.
Byte-identical KV/prompt-cache match. Serving engines do this today; prefill is skipped, output still decodes.
Semantic + exact-prefix hits capped at 95% of traffic.
Serving Fleet
Switching converts the fleet cost and all outputs using fixed July 2026 reference rates.
Use all-in hourly cost: GPUs, reserved capacity, orchestration, and serving overhead.
Fleet-level throughput. Defaults are illustrative; replace with your measured serving numbers.
Modeled monthly serving cost
blended serving cost per request
monthly cost with exact-prefix only
additional monthly savings from semantic reuse
fleet-hours reclaimed monthly
Semantic reuse hits
Exact-prefix hits
Misses
Cumulative cost avoided over 12 months. The gap is what semantic reuse adds on top of exact-prefix.

Known simplifications: a semantic hit is modeled as skipping the full prefill, while real systems reuse validated KV blocks and pay lookup, validation, and policy-check overhead; hit rates are inputs rather than TTL simulations; and savings assume reclaimed capacity can be scaled down or used for growth. Full formulas are in the .

README

Estimate how semantic KV reuse changes the monthly cost and capacity profile of a self-hosted LLM serving fleet. The model always runs and generates a fresh answer; reuse removes recomputation, not generation.

What each request can do

OutcomeMeaningModeled work
Semantic reuse hitThe context is semantically similar to prior traffic; validated KV computation is reused and prefill is skipped.Decode only
Exact-prefix hitA byte-identical KV/prompt-cache prefix is available. Serving engines do this today.Decode only
MissNo usable reuse.Full prefill and decode

Both hit types cost the same per request. The difference is coverage: exact-prefix fires only on byte-identical prefixes, while semantic reuse extends the same prefill savings to similar-but-not-identical context. The gap between the chart's two lines is the increment semantic reuse adds on top of what the serving engine already provides.

Formulas

cost_per_sec = fleet_cost_per_hour / 3600
prefill_sec  = input_context_tokens / prefill_tokens_per_sec
decode_sec   = output_tokens / decode_tokens_per_sec

miss_cost         = (prefill_sec + decode_sec) x cost_per_sec
prefix_hit_cost   = decode_sec x cost_per_sec
semantic_hit_cost = decode_sec x cost_per_sec

blended_cost = semantic_rate x semantic_hit_cost
             + prefix_rate x prefix_hit_cost
             + miss_rate x miss_cost

monthly_cost      = blended_cost x requests_per_day x 30
exact_prefix_only = same blend, semantic traffic treated as misses
semantic_added    = exact_prefix_only - monthly_cost

reclaimed_hours = (semantic_rate + prefix_rate) x prefill_sec
                  x requests_per_day x 30 / 3600

Defaults

InputDefaultBasis
Requests per day100,000Illustrative enterprise workload; agentic traffic multiplies per-user calls
Input context20,000 tokensLong-context assistant or agent session
Output500 tokensTypical non-trivial answer
Semantic reuse hit rate25%Illustrative; depends on workload repetition
Exact-prefix hit rate40%Illustrative; depends on byte-identical prefix reuse and TTL fit
CurrencyUSDSwitching converts values with fixed July 2026 reference rates
Fleet cost$160/hourIllustrative mid-size serving fleet, all-in
Prefill throughput100,000 tok/sIllustrative fleet-level throughput
Decode throughput5,000 tok/sIllustrative fleet-level throughput

Replace the throughput and fleet-cost inputs with measured numbers before using the output as a business case.

Known simplifications

  1. A semantic hit is modeled as skipping the full prefill. Real systems reuse validated KV blocks and pay embedding, lookup, validation, and policy-check overhead.
  2. Hit rates are inputs, not a TTL simulation. Real hit rates depend on request timing, cache size, routing, and eviction behavior.
  3. Reclaimed capacity only becomes cash savings when the fleet can be scaled down, deferred, or used to absorb growth.
  4. Request shape is uniform. Real traffic has a distribution of context and output lengths; run separate cases for p50, p90, and p99 workloads.
  5. Reuse safety gates are outside the calculator. KV computation is only reused when it passes validation and policy checks for the new request.
  6. Currency selection converts values with fixed July 2026 reference rates; it does not change the underlying model.

MIT license. Built as a WorldFlow AI public artifact.