stabilityai · text

stable-code-3b

stabilityai/stable-code-3b

stable-code-3b at Q4_K_M is exactly 1,708,595,200 bytes (1.59 GiB / 1.71 GB) — an effective 4.890 bits per weight, not the nominal 4. Its KV cache at 32K is 10.00 GiB.

From the file· summed from 1 file(s)From the file· KV per layer
Parameters
2.8B
Architecture
stablelm
32 layers
Context
16,384
native (config.json)
License
other

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
I1-IQ1_S0.63 GiB679,888,1281.946mradermacher
I1-IQ1_M0.68 GiB727,872,7682.083mradermacher
I1-IQ2_XXS0.75 GiB807,847,1682.312mradermacher
I1-IQ2_XS0.82 GiB878,380,2882.514mradermacher
I1-IQ2_S0.88 GiB949,438,2082.717mradermacher
I1-IQ2_M0.94 GiB1,013,417,7282.900mradermacher
Q2_K1.01 GiB1,083,755,5203.102TheBloke
Q2_K1.01 GiB1,083,756,0643.102mradermacher
I1-Q2_K1.01 GiB1,083,756,2883.102mradermacher
I1-IQ3_XXS1.03 GiB1,102,014,2083.154mradermacher
IQ3_XS1.11 GiB1,194,975,2643.420mradermacher
I1-IQ3_XS1.11 GiB1,194,975,4883.420mradermacher
Q3_K_S1.17 GiB1,254,448,6403.590TheBloke
Q3_K_S1.17 GiB1,254,449,1843.590mradermacher
IQ3_S1.17 GiB1,254,449,1843.590mradermacher
I1-Q3_K_S1.17 GiB1,254,449,4083.590mradermacher
I1-IQ3_S1.17 GiB1,254,449,4083.590mradermacher
IQ3_M1.23 GiB1,319,555,1043.776mradermacher
I1-IQ3_M1.23 GiB1,319,555,3283.776mradermacher
Q3_K_M1.30 GiB1,391,418,8803.982TheBloke
Q3_K_M1.30 GiB1,391,419,4243.982mradermacher
I1-Q3_K_M1.30 GiB1,391,419,6483.982mradermacher
Q3_K_L1.40 GiB1,508,564,4804.317TheBloke
Q3_K_L1.40 GiB1,508,565,0244.317mradermacher
I1-Q3_K_L1.40 GiB1,508,565,2484.317mradermacher
I1-IQ4_XS1.42 GiB1,525,248,7684.365mradermacher
IQ4_XS1.43 GiB1,536,307,7444.397mradermacher
Q4_01.50 GiB1,608,570,8804.603TheBloke
I1-Q4_01.50 GiB1,612,995,3284.616mradermacher
Q4_K_S1.51 GiB1,620,695,0404.638TheBloke
Q4_K_S1.51 GiB1,620,695,5844.638mradermacher
I1-Q4_K_S1.51 GiB1,620,695,8084.638mradermacher
Q4_K_M1.59 GiB1,708,595,2004.890TheBloke
Q4_K_M1.59 GiB1,708,595,7444.890mradermacher
I1-Q4_K_M1.59 GiB1,708,595,9684.890mradermacher
Q5_K_S1.81 GiB1,941,862,4005.557TheBloke
Q5_01.81 GiB1,941,862,4005.557TheBloke
Q5_K_S1.81 GiB1,941,862,9445.557mradermacher
I1-Q5_K_S1.81 GiB1,941,863,1685.557mradermacher
Q5_K_M1.86 GiB1,993,390,0805.705TheBloke

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0961.25 GiB1.25 GiB32 / 0 / 0
8,1922.50 GiB2.50 GiB32 / 0 / 0
16,3845.00 GiB5.00 GiB32 / 0 / 0
32,76810.00 GiB10.00 GiB32 / 0 / 0
65,53620.00 GiB20.00 GiB32 / 0 / 0
131,07240.00 GiB40.00 GiB32 / 0 / 0

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 1.46 GiB. The real file is 1.59 GiB, because a quantization is a mixture and some tensors are always kept at higher precision.

Architecture

from config.json
Layers
32
Attention heads
32
KV heads
32
Head dim
80
Hidden size
2560
Vocab
50,304
Sliding window
none
SWA period
MLA
no
Experts
Experts per token
use_sliding_window

Questions people ask

How much VRAM does stable-code-3b need?
Q4_K_M is exactly 1,708,595,200 bytes (1.59 GiB) in weights. Add the KV cache, which depends on your context length, plus roughly half a gigabyte of runtime overhead.
How large is stable-code-3b's KV cache?
10.00 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.
Which quantization of stable-code-3b 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.