Calculation Methodology & Data Sources
How AIGPUCost calculates GPU VRAM, GQA/MLA KV cache memory, decode throughput, and API break-even points.
1. Model Weights VRAM
Weights (GB) = Parameters (B) × (Effective Bits / 8) × Quantization Overhead. We use realistic effective bit-widths rather than naive integers: FP16 = 16.0 bits, FP8/INT8 = 8.2 bits (including scaling factors), Q6_K = 6.56 bits, and Q4_K_M/AWQ = 4.5 bits.
2. KV Cache VRAM (GQA & DeepSeek MLA Aware)
For standard Grouped-Query Attention (GQA) transformers like Llama 3/4, Qwen2.5/3, Gemma 3, and Mistral:
KV Cache (Bytes) = 2 × Layers × KV_Heads × Head_Dim × Context_Length × Concurrency × KV_Bytes
For DeepSeek-V3 and DeepSeek-R1, which use Multi-Head Latent Attention (MLA), KV cache stores compressed latent vectors (dim = 576 per layer) rather than separate K and V projections—reducing KV memory by >90%.
3. Single-Stream Decode Speed Estimate
Autoregressive LLM token generation at low batch size is memory-bandwidth bound. We estimate practical decode speed using 0.62 × Total_GPU_Memory_Bandwidth / Active_Model_Weights_GB, properly using active parameters for Mixture-of-Experts (MoE) models like DeepSeek-R1 (37B active) and Qwen3-235B (22B active).
4. Automated Daily Data Pipeline
Commercial LLM API token rates are refreshed automatically via GitHub Actions from OpenRouter's public Models API. Cloud GPU rates reflect public on-demand reference pricing across marketplace and managed clouds.