janhq · text

Jan-code-4b

janhq/Jan-code-4b

Jan-code-4b at Q4_K_M is exactly 2,716,066,656 bytes (2.53 GiB / 2.72 GB) — an effective 4.926 bits per weight, not the nominal 4. Its KV cache at 32K is 4.50 GiB.

From the file· summed from 1 file(s)From the file· KV per layer
Parameters
4.4B
Architecture
qwen3
36 layers
Context
262,144
native (config.json)
License
apache-2.0

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
IQ2_M1.56 GiB1,680,112,1923.047bartowski
Q2_K1.67 GiB1,797,124,6723.259bartowski
IQ3_XXS1.70 GiB1,824,782,9123.309bartowski
IQ3_XS1.85 GiB1,981,503,5523.593bartowski
Q3_K_S1.91 GiB2,054,124,8963.725janhq
Q3_K_S1.91 GiB2,054,125,6323.725bartowski
IQ3_M1.98 GiB2,130,024,5123.863bartowski
Q2_K_L2.03 GiB2,176,964,6723.948bartowski
Q3_K_M2.09 GiB2,242,745,6964.067janhq
Q3_K_M2.09 GiB2,242,746,4324.067bartowski
Q3_K_L2.24 GiB2,406,913,3764.365janhq
Q3_K_L2.24 GiB2,406,914,1124.365bartowski
IQ4_XS2.31 GiB2,477,383,2324.493bartowski
Q4_02.41 GiB2,588,332,8964.694janhq
Q4_02.42 GiB2,594,559,5524.705bartowski
IQ4_NL2.42 GiB2,600,130,1124.715bartowski
Q4_K_S2.42 GiB2,602,095,4564.719janhq
Q4_K_S2.47 GiB2,649,282,1124.804bartowski
Q4_K_M2.53 GiB2,716,066,6564.926janhq
Q4_K_M2.62 GiB2,813,388,3525.102bartowski
Q4_12.64 GiB2,839,724,8965.150janhq
Q4_12.64 GiB2,839,725,6325.150bartowski
Q5_02.88 GiB3,091,116,8965.606janhq
Q5_K_S2.88 GiB3,091,116,8965.606janhq
Q4_K_L2.89 GiB3,102,066,7525.625bartowski
Q5_K_S2.93 GiB3,141,252,6725.697bartowski
Q5_K_M2.94 GiB3,156,919,1365.725janhq
Q5_K_M3.07 GiB3,298,477,6325.982bartowski
Q5_13.11 GiB3,342,508,8966.062janhq
Q5_K_L3.30 GiB3,538,536,5126.417bartowski
Q6_K3.38 GiB3,625,324,8966.574janhq
Q6_K3.47 GiB3,728,176,1926.761bartowski
Q6_K_L3.65 GiB3,916,576,8327.103bartowski
Q8_04.37 GiB4,693,669,2168.512janhq
Q8_04.37 GiB4,693,669,9528.512bartowski
BF168.22 GiB8,829,196,09616.012bartowski

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0960.56 GiB0.56 GiB36 / 0 / 0
8,1921.13 GiB1.13 GiB36 / 0 / 0
16,3842.25 GiB2.25 GiB36 / 0 / 0
32,7684.50 GiB4.50 GiB36 / 0 / 0
65,5369.00 GiB9.00 GiB36 / 0 / 0
131,07218.00 GiB18.00 GiB36 / 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 2.31 GiB. The real file is 2.53 GiB, because a quantization is a mixture and some tensors are always kept at higher precision.

Architecture

from config.json
Layers
36
Attention heads
32
KV heads
8
Head dim
128
Hidden size
2560
Vocab
151,936
Sliding window
none
SWA period
MLA
no
Experts
Experts per token
use_sliding_window
false

Questions people ask

How much VRAM does Jan-code-4b need?
Q4_K_M is exactly 2,716,066,656 bytes (2.53 GiB) in weights. Add the KV cache, which depends on your context length, plus roughly half a gigabyte of runtime overhead.
How large is Jan-code-4b's KV cache?
4.50 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 Jan-code-4b 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.