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

Total VRAM required
357 GB
Ling-3.1-flash 560B (MoE) at Q4_K_M
Weights
314 GB
560B params
KV cache
10.9 GB
1024K tokens, FP16 KV

Calculator

Estimated VRAM required

357 GB

560B params at Q4_K_M, 1,048,576 token context, batch 1, inference.

Weights
314 GB
KV cache
10.9 GB
Overhead
32.7 GB

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

Kimi K3.1 Pro at Q4_K_M
A 2.78T expert pool with 24 latent attention layers and fixed state in the other 69.
View details ➜
Mistral Large 4 at Q4_K_M
A 1T expert pool with 63 latent cache owners and 44 layers that also store an index key.
View details ➜
Muse Spark Open at Q4_K_M
Only 16 of its 62 layers grow with context, and the other 46 hold a 2,048 token window.
View details ➜

Frequently asked questions

How much VRAM does Ling-3.1-flash need at Q4?
This page estimates about 357 GB with a 1,048,576 token context, one sequence and an FP16 cache. Weights make up 314 GB, the cache 10.9 GB and the runtime allowance 33 GB. At 256K the same setup comes to 348 GB. Q4_K_M here is a planning factor of 0.56 bytes per parameter, so check the size of the files you actually plan to load.
Can I budget memory for 25B parameters because only 25B are active?
No. Active parameters set the compute per token, but routing can send the next token to other experts, so all 560B parameters need a home. A 25B model would need only 14 GB of weights at this quant, and budgeting that much would leave out most of the expert pool. If you offload experts to system memory or storage, the GPU number drops, but the speed and bandwidth cost move to the host. Test that setup rather than assuming it works.
Why is the cache so small for a model with a 1M context?
Only 9 of the 72 layers keep a cache that grows with context, and those store a compressed latent of 576 values per token. The other 63 layers use Kimi Delta Attention, whose state has a fixed size of 0.28 GB in total at batch one. The result is 10.9 GB for the full 1M tokens. Each extra concurrent sequence needs its own copy of both the cache and the fixed state, while the weights are shared.
Should I plan for 1M or 262,144 tokens of context?
Start from the limit your server really enforces. The model card lists 1M, while max_position_embeddings in the config is 262,144, so the two sources disagree. The total is 357 GB at the longer length and 348 GB at 256K. Because the weights dominate, that choice changes the hardware plan less than it would for a model with a large cache. Test a long prompt on your own setup before you promise 1M to anyone.
What happens to the total if I serve several requests at once?
Weights stay the same, but every sequence adds its own cache and fixed state. At batch 4 the estimate is 394 GB at the full context. With a Q8 cache, if your engine supports it for this layout, the one sequence total at 1M becomes 351 GB. Real servers also pack requests of different lengths, so measure with your actual traffic mix.
Which engine should I run it on?
The model card recommends SGLang, and vLLM also works. Both need to handle the mix of Kimi Delta Attention and latent attention layers, so confirm support for your exact version before you buy hardware. A quantized conversion adds a second question, because the file format and the engine both have to support this layout. Ask the publisher or the engine's issue tracker, and don't treat a memory fit as proof that a setup runs.
What does this estimate leave out?
It leaves out speculative decoding buffers, prefill workspace, communication buffers between GPUs, and any uneven split across cards. The runtime allowance of 33 GB is a planning heuristic, not a measured cap. It also assumes every expert stays on the GPUs. Run your intended workload, record peak memory on the busiest card, and size the cluster from that number plus some margin.