deepseek-ai · text · mixture of experts

DeepSeek-Coder-V2-Instruct

deepseek-ai/DeepSeek-Coder-V2-Instruct

DeepSeek-Coder-V2-Instruct at Q4_K_M is exactly 142,453,964,736 bytes (132.67 GiB / 142.45 GB) — an effective 4.834 bits per weight, not the nominal 4. Its KV cache at 32K is 2.11 GiB.

From the file· summed from 4 file(s)From the file· KV per layer
Parameters
236B
total, not active
Architecture
deepseek2
60 layers
Context
163,840
native (config.json)
License
other

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
IQ1_S2 shards44.14 GiB47,392,224,9281.608legraphista
IQ1_M2 shards49.06 GiB52,682,669,7281.788bartowski
IQ1_M3 shards49.06 GiB52,682,669,8561.788legraphista
IQ2_XXS3 shards57.28 GiB61,500,077,8242.087legraphista
IQ2_XS2 shards63.99 GiB68,711,290,5282.332bartowski
IQ2_XS3 shards63.99 GiB68,711,290,6562.332legraphista
IQ2_S3 shards65.07 GiB69,866,895,1362.371legraphista
IQ2_M4 shards71.64 GiB76,920,821,6322.610legraphista
Q2_K_S4 shards74.13 GiB79,601,274,7842.701legraphista
Q2_K3 shards80.04 GiB85,946,674,9762.917bartowski
Q2_K3 shards80.04 GiB85,946,675,0082.917second-state
Q2_K4 shards80.04 GiB85,946,675,0722.917legraphista
Q2_K_L3 shards81.44 GiB87,441,714,9762.967bartowski
IQ3_XXS4 shards84.61 GiB90,846,566,3043.083legraphista
IQ3_XS5 shards89.69 GiB96,304,424,9283.268legraphista
Q3_K_S4 shards94.70 GiB101,679,196,1283.450second-state
Q3_K_S5 shards94.70 GiB101,679,196,1603.450legraphista
IQ3_S5 shards94.70 GiB101,679,196,1603.450legraphista
IQ3_M5 shards96.27 GiB103,371,253,7923.508legraphista
Q3_K_M3 shards104.93 GiB112,665,528,1283.823bartowski
Q3_K_M4 shards104.93 GiB112,665,528,2563.823second-state
Q3_K5 shards104.93 GiB112,665,528,3523.823legraphista
Q3_K_L5 shards113.97 GiB122,372,065,3444.153second-state
Q3_K_L6 shards113.97 GiB122,372,065,4404.153legraphista
IQ4_XS6 shards116.94 GiB125,563,453,5684.261legraphista
Q4_05 shards123.78 GiB132,912,455,7764.510second-state
IQ4_NL6 shards123.78 GiB132,912,455,8084.510legraphista
Q4_K_S5 shards124.68 GiB133,875,834,9444.543second-state
Q4_K_S6 shards124.68 GiB133,875,835,0084.543legraphista
Q4_K_M4 shards132.67 GiB142,453,964,7364.834bartowski
Q4_K_M5 shards132.67 GiB142,453,964,8644.834second-state
Q4_K7 shards132.67 GiB142,453,965,0244.834legraphista
Q5_K_S7 shards151.16 GiB162,308,464,5765.508legraphista
Q5_K_S6 shards151.16 GiB162,308,464,7685.508second-state
Q5_06 shards151.16 GiB162,308,464,7685.508second-state
Q5_K8 shards155.74 GiB167,223,787,6485.675legraphista
Q5_K_M6 shards155.74 GiB167,223,787,6805.675second-state
Q6_K9 shards180.25 GiB193,541,724,3846.568legraphista
Q6_K7 shards180.25 GiB193,541,724,5126.568second-state
Q8_011 shards233.41 GiB250,623,467,9688.505legraphista

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0960.26 GiB18.75 GiB71.11×60 / 0 / 0
8,1920.53 GiB37.50 GiB71.11×60 / 0 / 0
16,3841.05 GiB75.00 GiB71.11×60 / 0 / 0
32,7682.11 GiB150.00 GiB71.11×60 / 0 / 0
65,5364.22 GiB300.00 GiB71.11×60 / 0 / 0
131,0728.44 GiB600.00 GiB71.11×60 / 0 / 0

This model uses multi-head latent attention. No V cache is allocated at all, and the K cache stores a 512-wide latent plus 64 rope dimensions — so reading num_key_value_heads from config.json and multiplying, as every calculator does, overstates the cache by well over an order of magnitude.

Compare with

same modality, comparable size

Will it run on your card?

full quant x context sweep

Why other calculators give a different number

A parameters × bits ÷ 8 estimate puts Q4_K_M at roughly 123.50 GiB. The real file is 132.67 GiB, because a quantization is a mixture and some tensors are always kept at higher precision. The larger discrepancy is the cache: this model allocates no value cache at all, so any formula reading num_key_value_heads overstates it by more than an order of magnitude.

Architecture

from config.json
Layers
60
Attention heads
128
KV heads
128
Head dim
192
Hidden size
5120
Vocab
102,400
Sliding window
none
SWA period
MLA
yes
Experts
160
Experts per token
6
use_sliding_window

Questions people ask

How much VRAM does DeepSeek-Coder-V2-Instruct need?
Q4_K_M is exactly 142,453,964,736 bytes (132.67 GiB) in weights. Add the KV cache, which depends on your context length, plus roughly half a gigabyte of runtime overhead.
How large is DeepSeek-Coder-V2-Instruct's KV cache?
2.11 GiB at 32K context with an f16 cache, computed per layer. Quantizing the cache to q8_0 roughly halves it, which is often the difference between a context length fitting and not.
Is DeepSeek-Coder-V2-Instruct a mixture-of-experts model?
Yes — 160 experts, 6 routed per token. Every expert must be resident, but only the routed ones are read per token, which is why its memory requirement and its speed behave very differently.
Which quantization of DeepSeek-Coder-V2-Instruct should I use?
Q4_K_M is the usual default. Pick the largest quantization that fits your card at the context you actually need — the table above gives exact sizes for every one published.