Skip to content
Friendly disclaimer: flozi00 TechHub is a solo side-project next to a full-time job — personal learning notes, no official statements. Verify critical steps yourself.

LLM Inference Calculator & Break-Even Analyzer

Calculate LLM VRAM and token throughput: weights, KV-cache and GPU bandwidth for open models like Qwen, DeepSeek or GLM.

3 min readflozi00
aigpuinferencevllmdeep-learningtoolscalculator
Skip to the full article
Watch · explore · understand

Find capacity, then compare two modeled speed limits

The calculator combines a memory-fit gate with bandwidth and compute estimates; their crossing is a model marker to validate.

AI-assisted learning visualization · schematic article explanation

Step 1 / 4Make room for the contexts

Weights are only one part of memory use. After weights and runtime allowances, the remaining KV budget must cover stored tokens across concurrent requests.

AlgorithmCurrent stepSelect a block to explain it
Model, GPU, precision and batch
Choose context length and an explicit efficiency assumption.
Memory fit and KV budget
Subtract weights and runtime before allocating contexts.
  1. Model, GPU, precision and batch Memory fit and KV budget
    memory inputs
What to remember

B* is the intersection of simplified limits; capacity and real serving measurements decide whether that point is useful.

The estimates omit or simplify attention, KV traffic, scheduling, communication and MoE overlap. Efficiency is an input assumption, and a larger batch need not preserve each user’s token speed.

Terms and the complete walkthrough
Roofline estimate
A predicted limit based on available computation and data movement.
Aggregate throughput
Tokens produced per second across all active requests.
Crossover batch B*
The first modeled batch where the bandwidth and compute estimates meet.
  1. Make room for the contexts

    Weights are only one part of memory use. After weights and runtime allowances, the remaining KV budget must cover stored tokens across concurrent requests.

  2. Model weight reuse explicitly

    The dense model assumes one weight read per decode batch. Its MoE approximation increases active weight bytes with batch and caps at total weights; real expert overlap need not follow that rule.

  3. Compare bandwidth and compute ceilings

    The lower modeled ceiling limits aggregate token throughput. B* marks where the bandwidth estimate reaches the compute estimate, using the chosen effective resource assumptions.

  4. Check whether the crossover is usable

    Enough memory may run out before B*. Treat the curve as an exploration tool and measure real context lengths and concurrent traffic, including latency rather than only aggregate tokens per second.

All connections

  • Model, GPU, precision and batch → Memory fit and KV budget: memory inputs
  • Model, GPU, precision and batch → Modeled weights read per step: batch and routing assumptions
  • Modeled weights read per step → Bandwidth throughput estimate: per-step byte traffic
  • Model, GPU, precision and batch → Compute throughput estimate: active parameters and FLOPS
  • Memory fit and KV budget → B*: where the ceilings meet: feasible batch limit
  • Bandwidth throughput estimate → B*: where the ceilings meet: bandwidth curve
  • Compute throughput estimate → B*: where the ceilings meet: compute ceiling
  • B*: where the ceilings meet → Validate context and concurrency: conditional estimate
Set your own pace. Pause at any time or select a step directly.

Two interactive tools for planning LLM serving hardware. The planner estimates VRAM fit, decode throughput, and time-to-first-token for a concrete model + GPU + precision + batch configuration. The break-even analyzer answers the deeper capacity question: at which batch size does decode stop being bandwidth-limited, at which point is it compute-limited, and what is the maximum sequence length you can serve at that batch.

The throughput figures are idealized roofline estimates, not measured serving rates. The efficiency slider is an assumption rather than a verified universal 60–80% range. The inference math guide explains the formulas.

1. The planner: capacity, throughput, latency

Interactive Estimator

LLM inference planner beta

Total parameters drive VRAM capacity; active parameters drive decode speed (MoE only fetches routed experts per token). MLA and hybrid-attention models use compressed KV-cache math.

Capacity check (Single GPU)

Model weights (total)
65.52 GB
Active weights per token
65.52 GB
KV cache per token
0.26 MB
Total KV cache (5,120 tok × 1)
1.34 GB
Activations
0.8 GB
Runtime overhead
1.2 GB
Total VRAM needed
68.86 GB
Available VRAM
96 GB
Headroom
27.14 GB
Max batch @ current context
~21
Max context @ batch 1
~108,639 tok

Roofline alignment

  • GPU ops:byte (BF16 (2 B))279.02 ops/byte
  • Decode intensity (batch 1)1 ops/byte
  • Effective intensity (batch 1)1 ops/byte
  • Gap278.02 ops/byte

Memory-bound: raising batch size lifts effective intensity because more tokens share each active-weight fetch.

Latency snapshot

Decode throughput
20.51 tok/s
Time per token
48.75 ms
Throughput limit
Memory
Time to first token (4,096 tok)
762.62 ms
Total request time
50.69 s
Memory-limited ceiling
20.51 tok/s
Compute-limited ceiling
5,723.09 tok/s

Decode ≈ min(aggregate bandwidth ÷ per-step bytes, FLOPS(BF16) ÷ 2·active-params, per-layer sync latency). Sync model: 0 sync(s)/layer × PCIe Gen5 x16 latency, scaled by kernel efficiency — TP+EP on PCIe fabrics is sync-bound, not bandwidth-bound.TTFT = max(total weight stream, linear + quadratic attention FLOPs).MoE capacity still needs all 32.762B params in VRAM.

2. Break-even: when does batching stop helping?

At small batches, weight reads can dominate decode. For a dense model in the simplified roofline model, one decode step reads the weights once for the batch: additional requests can raise aggregate throughput while reducing weight bytes per generated token. KV traffic, attention, kernels and scheduling still affect per-request speed. For MoE, different requests may route to overlapping or different experts, so the number of distinct weights read per step depends on routing.

Two modeled limits matter:

  1. Compute crossover — the idealized bandwidth and compute ceilings meet at B*. The actual crossover also depends on KV reads, attention, kernel efficiency and communication.
  2. MoE coverage approximation — the calculator caps per-step weight reads at total model size: min(active weight bytes × batch, total weight bytes). This assumes no overlap below the cap and complete coverage at the cap. Neither is generally true for routed experts; treat the reported saturation batch as a toy-model marker, not a measured threshold.

B* is where these two modeled ceilings meet. For a dense model with batch-independent weight reads, the formula is GPU FLOPS × bytes per parameter ÷ (2 × bandwidth), using consistent effective throughput and bandwidth. The calculator may find that B* exceeds the VRAM-feasible batch. Use the curve to explore assumptions, then benchmark latency and throughput at the target context and concurrency.

Break-even Analyzer

Decode break-even calculator beta

This simplified roofline estimates weight-read and compute ceilings as batch size changes. B* is where those modeled ceilings meet. MoE expert overlap, KV traffic, attention and scheduling can move the real crossover; benchmark your workload. The panel also estimates KV capacity at B*.

Break-even analysis

Break-even batch B* (memory → compute crossover)~280
Per-request tokens/s at B*20.44 tok/s
Aggregate tokens/s at B*5,723.09 tok/s
Max batch in VRAM (at 2,048 tok/seq)~53
Aggregate tokens/s at VRAM-max batch1,087.11 tok/s
Max sequence length at B*— (B* exceeds VRAM)
Max sequence length at VRAM-max batch~2,071 tok
KV cache per token0.26 MB
Fixed VRAM (weights + overhead)66.72 GB
Free VRAM for KV + activations28.78 GB
Effective FLOPS / bandwidth375 TFLOPS / 1,344 GB/s

B* ≈ 280 needs more KV memory than this setup holds (VRAM fits ~53 sequences at 2,048 tokens). The modeled compute crossover is unreachable at that context. More batching may increase aggregate throughput, but per-request speed and latency must be measured..

Decode throughput vs batch size

02k3k5k6kVRAM capB* (break-even)batch size →tok/sactual (min of both)bandwidth ceilingcompute ceiling

Aggregate tok/s = min(bandwidth ceiling, compute ceiling). The MoE weight-read model assumes no expert overlap below its total-weight cap and complete coverage at the cap; the actual curve depends on routing. B* is where the modeled memory ceiling first reaches the modeled compute ceiling. The VRAM line is the capacity limit at a 2,048-token context.

How the break-even is computed

Both calculators share the same decode model:

  • Bandwidth estimate (aggregate tok/s) = batch × effective bandwidth × occupied GPU capacity ÷ modeled per-step weight bytes. For MoE, the per-step bytes are approximated by min(activeBytes × batch, totalWeightBytes).
  • Compute estimate (aggregate tok/s) = effective FLOPS × GPUs ÷ (2 × active parameters), ignoring attention and other operations.
  • B* = first modeled batch where the bandwidth estimate reaches the compute estimate. It is not a runtime scheduling setting or a verified bound for a real model.
  • Max sequence length at B* = (total VRAM − weights − runtime overhead) ÷ (KV bytes per token × B*), capped at the model's context window.

The analyzer also reports an estimated maximum batch by KV capacity at a ~2k-token context. Runtime allocations and activation memory can lower the actual limit. Increasing batch can reduce per-request rate even below B*, especially with MoE routing, KV traffic or scheduling overhead.

Limitations

  • No continuous-batching arrival dynamics: B* is a steady-state ceiling, not a scheduling policy.
  • Attention decode FLOPs (growing with context length) are not in the compute ceiling; at very long contexts the real crossover arrives earlier.
  • The break-even chart uses tensor parallelism for multiple GPUs and assumes ideal bandwidth scaling; the planner adds a heuristic communication penalty, but neither replaces a topology-specific benchmark.

Sources