meta-llama · text

Llama-3.1-8B

meta-llama/Llama-3.1-8B

Llama-3.1-8B at Q4_K_M is exactly 4,920,733,824 bytes (4.58 GiB / 4.92 GB) — an effective 4.902 bits per weight, not the nominal 4. Its KV cache at 32K is 4.00 GiB.

From the file· summed from 1 file(s)From the file· KV from mirror (mirror:unsloth/Llama-3.1-8B)
Parameters
8.0B
Architecture
llama
32 layers
Context
131,072
native (config.json)
License
llama3.1

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
Q2_K2.96 GiB3,179,141,1203.167dphn
Q3_K_S3.41 GiB3,664,509,7603.651dphn
Q3_K_M3.74 GiB4,018,928,4484.004292dphn
Q3_K3.74 GiB4,018,928,4484.004dphn
Q3_K_L4.03 GiB4,321,966,9124.306dphn
Q4_04.34 GiB4,661,223,2964.644292dphn
Q4_K_S4.37 GiB4,692,680,5764.675dphn
Q4_K_M4.58 GiB4,920,733,8244.902292NousResearch
Q4_K_M4.58 GiB4,920,734,3364.902292Delentia
Q4_K_M4.58 GiB4,920,745,8564.902292dphn
Q4_K4.58 GiB4,920,745,8564.902dphn
Q4_14.78 GiB5,130,264,9605.111dphn
Q5_05.21 GiB5,599,306,6245.578dphn
Q5_K_S5.21 GiB5,599,306,6245.578dphn
Q5_K_M5.34 GiB5,732,987,0085.711292NousResearch
Q5_K5.34 GiB5,733,000,0645.711dphn
Q5_K_M5.34 GiB5,733,000,0645.711292dphn
Q5_15.65 GiB6,068,348,2886.045dphn
Q6_K6.14 GiB6,596,006,0166.571292NousResearch
Q6_K6.14 GiB6,596,020,1606.571292dphn
Q8_07.95 GiB8,540,770,4328.509292NousResearch
Q8_07.95 GiB8,540,770,9448.509Delentia
Q8_07.95 GiB8,540,788,5448.509292dphn
Q4_K_M3 shards13.75 GiB14,762,205,53614.707Delentia
F1614.97 GiB16,068,924,22416.008292dphn

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0960.50 GiB0.50 GiB32 / 0 / 0
8,1921.00 GiB1.00 GiB32 / 0 / 0
16,3842.00 GiB2.00 GiB32 / 0 / 0
32,7684.00 GiB4.00 GiB32 / 0 / 0
65,5368.00 GiB8.00 GiB32 / 0 / 0
131,07216.00 GiB16.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 4.21 GiB. The real file is 4.58 GiB, because a quantization is a mixture and some tensors are always kept at higher precision.

Architecture

from mirror:unsloth/Llama-3.1-8B
Layers
32
Attention heads
32
KV heads
8
Head dim
128
Hidden size
4096
Vocab
128,256
Sliding window
none
SWA period
MLA
no
Experts
Experts per token
use_sliding_window

Questions people ask

How much VRAM does Llama-3.1-8B need?
Q4_K_M is exactly 4,920,733,824 bytes (4.58 GiB) in weights. Add the KV cache, which depends on your context length, plus roughly half a gigabyte of runtime overhead.
How large is Llama-3.1-8B's KV cache?
4.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 Llama-3.1-8B 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.