Ling-3.1-flash VRAM requirements at Q4 and 1M context
Ling-3.1-flash needs about 357 GB in this Q4_K_M, 1,048,576 token, batch one scenario. 314 GB of that is weights, so the cache barely moves the answer.
Ling-3.1-flash is almost all weights. It's a mixture of experts model from inclusionAI with 560B total and 25B active parameters, and each of its 72 layers picks 8 of 512 experts per token. The 25B figure tells you how much math a token costs. It doesn't tell you how much has to sit in memory, because the next token can route to different experts. This estimate keeps the whole pool resident at Q4_K_M, which the calculator prices at 0.56 bytes per parameter. That's 314 GB of weights, 10.9 GB of cache at the full 1M context, and a 33 GB runtime allowance, for 357 GB. The weights are MIT licensed.
By TechCompare · Updated
Calculator
Estimated VRAM required
357 GB
560B params at Q4_K_M, 1,048,576 token context, batch 1, inference.
Estimate accuracy: Planning estimate. Rounded model counts, tensor formats, cache packing, and workspace can change actual allocation. Confirm the exact checkpoint and serving engine with a load test.
Ling-3.1-flash has 63 fixed-state KDA layers and 9 latent attention layers. The latent layers store 576 values per token, following the Transformers implementation. The model card lists a 1M context while the config sets 262,144, so check your server's limit. Speculative decoding needs extra memory.
Hybrid linear attention applied: 63 of 72 layers use fixed recurrent state, so only 9 sparse-attention layers contribute to the context-growing KV cache. The fixed state adds about 0.28 GB at batch 1 and does not grow with context length.
Hardware that fits
Apple entries show installed unified memory separately from a model budget based on an 8 GB reserve. That budget is a planning heuristic, not a fixed hardware limit.
No single GPU in our catalog has enough memory. Multi-GPU or CPU offload required.
How this is calculated
The cache is small because of how the layers are built. Every eighth layer, nine in all, is latent attention that stores 576 values per token (a 512 value latent plus 64 rope values). The other 63 layers are Kimi Delta Attention, which keeps a fixed state instead of a cache that grows. Together that state is 0.28 GB at batch one, and it doesn't change with context length. In FP16 the latent layers cost 10,368 bytes per token, which makes 10.9 GB at 1M tokens, or 3 percent of the total. The runtime allowance alone, at 32.7 GB, is bigger than the whole cache. Two context numbers are in circulation for this model. The model card lists 1M tokens, while max_position_embeddings in the config is 262,144. This page uses 1M because that's what the card says, and it also shows 256K, where the total is 348 GB. Stopping at 256K trims 9.0 GB from the estimate, and 32K trims 11.6 GB for a total of 346 GB. Check which limit your server enforces before you size anything around the longer one.
Verdict
Budget for the weights first and treat the cache as a rounding error. By capacity alone the total needs 5 cards of 80 GB or 2 cards of 192 GB. Eight 80 GB cards give 640 GB, which covers this estimate on paper. Paper capacity isn't a deployment plan. The engine decides how experts and layers are split, which splits it supports, and how much workspace each card keeps for itself. The model card recommends SGLang, and vLLM also works. Speculative decoding needs extra memory that this estimate leaves out, and so do prefill workspace and communication buffers. Measure resident memory at your real context length and batch size before you order hardware.
More Ling scenarios
Related guides
Frequently asked questions
How much VRAM does Ling-3.1-flash need at Q4?
Can I budget memory for 25B parameters because only 25B are active?
Why is the cache so small for a model with a 1M context?
Should I plan for 1M or 262,144 tokens of context?
What happens to the total if I serve several requests at once?
Which engine should I run it on?
What does this estimate leave out?
Related tools
RAM Latency Calculator
Convert DDR3/DDR4/DDR5 timings (CL, tRCD, tRP, tRAS) into true latency in nanoseconds.
Use tool ➜Power Cost Estimator
Estimate annual electricity costs for your PC, Server, or TV.
Use tool ➜Data Transfer Calculator
Estimate transfer times for files over USB, WiFi, Ethernet, and more.
Use tool ➜Memory and Storage Throughput Visualizer
Visualize the massive speed difference between CPU cache, RAM, and storage.
Use tool ➜