codellama · text

CodeLlama-70b-Instruct-hf

codellama/CodeLlama-70b-Instruct-hf

CodeLlama-70b-Instruct-hf at Q4_K_M is exactly 41,423,092,736 bytes (38.58 GiB / 41.42 GB) — an effective 4.804 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
69.0B
Architecture
llama
80 layers
Context
4,096
native (config.json)
License
llama2

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
I1-IQ1_S13.54 GiB14,535,673,1201.686mradermacher
I1-IQ1_M14.85 GiB15,943,386,4001.849mradermacher
I1-IQ2_XXS17.03 GiB18,289,575,2002.121mradermacher
I1-IQ2_XS18.94 GiB20,334,298,4002.358mradermacher
I1-IQ2_S19.89 GiB21,354,461,4722.477mradermacher
I1-IQ2_M21.64 GiB23,231,412,5122.694mradermacher
Q2_K23.71 GiB25,462,588,4162.953second-state
Q2_K23.71 GiB25,462,588,4482.953TheBloke
I1-Q2_K23.71 GiB25,462,589,7282.953mradermacher
I1-IQ3_XXS24.76 GiB26,581,612,8323.083mradermacher
I1-IQ3_XS26.37 GiB28,315,139,3603.284mradermacher
Q3_K_S27.86 GiB29,919,459,3283.470second-state
Q3_K_S27.86 GiB29,919,459,3603.470TheBloke
I1-IQ3_S27.86 GiB29,919,460,6403.470mradermacher
I1-Q3_K_S27.86 GiB29,919,460,6403.470mradermacher
I1-IQ3_M28.82 GiB30,944,443,6803.589mradermacher
Q3_K_M30.99 GiB33,274,902,5283.859second-state
Q3_K_M30.99 GiB33,274,902,5603.859TheBloke
I1-Q3_K_M30.99 GiB33,274,903,8403.859mradermacher
Q3_K_L33.67 GiB36,148,000,7684.192second-state
Q3_K_L33.67 GiB36,148,000,8004.192TheBloke
I1-Q3_K_L33.67 GiB36,148,002,0804.192mradermacher
I1-IQ4_XS34.30 GiB36,829,999,3924.272mradermacher
Q4_036.20 GiB38,872,431,6164.508second-state
Q4_036.20 GiB38,872,431,6484.508TheBloke
I1-Q4_036.34 GiB39,019,233,5684.526mradermacher
Q4_K_S36.55 GiB39,249,918,9764.552second-state
Q4_K_S36.55 GiB39,249,919,0084.552TheBloke
I1-Q4_K_S36.55 GiB39,249,920,2884.552mradermacher
Q4_K_M38.58 GiB41,423,092,7364.804second-state
Q4_K_M38.58 GiB41,423,092,7684.804TheBloke
I1-Q4_K_M38.58 GiB41,423,094,0484.804mradermacher
Q5_044.20 GiB47,461,596,1605.505second-state
Q5_K_S44.20 GiB47,461,596,1605.505second-state
Q5_044.20 GiB47,461,596,1925.505TheBloke
Q5_K_S44.20 GiB47,461,596,1925.505TheBloke
I1-Q5_K_S44.20 GiB47,461,597,4725.505mradermacher
Q5_K_M45.41 GiB48,753,966,0805.654second-state
Q5_K_M45.41 GiB48,753,966,1125.654TheBloke
I1-Q5_K_M45.41 GiB48,753,967,3925.654mradermacher

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0961.25 GiB1.25 GiB80 / 0 / 0
8,1922.50 GiB2.50 GiB80 / 0 / 0
16,3845.00 GiB5.00 GiB80 / 0 / 0
32,76810.00 GiB10.00 GiB80 / 0 / 0
65,53620.00 GiB20.00 GiB80 / 0 / 0
131,07240.00 GiB40.00 GiB80 / 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 36.13 GiB. The real file is 38.58 GiB, because a quantization is a mixture and some tensors are always kept at higher precision.

Architecture

from config.json
Layers
80
Attention heads
64
KV heads
8
Head dim
128
Hidden size
8192
Vocab
32,016
Sliding window
none
SWA period
MLA
no
Experts
Experts per token
use_sliding_window

Questions people ask

How much VRAM does CodeLlama-70b-Instruct-hf need?
Q4_K_M is exactly 41,423,092,736 bytes (38.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 CodeLlama-70b-Instruct-hf'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 CodeLlama-70b-Instruct-hf 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.