codellama · text

CodeLlama-70b-Python-hf

codellama/CodeLlama-70b-Python-hf

CodeLlama-70b-Python-hf at Q4_K_M is exactly 41,423,092,192 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,672,3841.686mradermacher
I1-IQ1_M14.85 GiB15,943,385,6641.849mradermacher
I1-IQ2_XXS17.03 GiB18,289,574,4642.121mradermacher
I1-IQ2_XS18.94 GiB20,334,297,6642.358mradermacher
I1-IQ2_S19.89 GiB21,354,460,7362.477mradermacher
I1-IQ2_M21.64 GiB23,231,411,7762.694mradermacher
Q2_K23.71 GiB25,462,587,8722.953TheBloke
Q2_K23.71 GiB25,462,588,7362.953mradermacher
I1-Q2_K23.71 GiB25,462,588,9922.953mradermacher
I1-IQ3_XXS24.76 GiB26,581,612,0963.083mradermacher
IQ3_XS26.37 GiB28,315,138,3683.284mradermacher
I1-IQ3_XS26.37 GiB28,315,138,6243.284mradermacher
Q3_K_S27.86 GiB29,919,458,7843.470TheBloke
Q3_K_S27.86 GiB29,919,459,6483.470mradermacher
IQ3_S27.86 GiB29,919,459,6483.470mradermacher
I1-IQ3_S27.86 GiB29,919,459,9043.470mradermacher
I1-Q3_K_S27.86 GiB29,919,459,9043.470mradermacher
IQ3_M28.82 GiB30,944,442,6883.589mradermacher
I1-IQ3_M28.82 GiB30,944,442,9443.589mradermacher
Q3_K_M30.99 GiB33,274,901,9843.859TheBloke
Q3_K_M30.99 GiB33,274,902,8483.859mradermacher
I1-Q3_K_M30.99 GiB33,274,903,1043.859mradermacher
Q3_K_L33.67 GiB36,148,000,2244.192TheBloke
Q3_K_L33.67 GiB36,148,001,0884.192mradermacher
I1-Q3_K_L33.67 GiB36,148,001,3444.192mradermacher
I1-IQ4_XS34.30 GiB36,829,998,6564.272mradermacher
IQ4_XS34.64 GiB37,197,000,0004.314mradermacher
Q4_036.20 GiB38,872,431,0724.508TheBloke
I1-Q4_036.34 GiB39,019,232,8324.526mradermacher
Q4_K_S36.55 GiB39,249,918,4324.552TheBloke
Q4_K_S36.55 GiB39,249,919,2964.552mradermacher
I1-Q4_K_S36.55 GiB39,249,919,5524.552mradermacher
Q4_K_M38.58 GiB41,423,092,1924.804TheBloke
Q4_K_M38.58 GiB41,423,093,0564.804mradermacher
I1-Q4_K_M38.58 GiB41,423,093,3124.804mradermacher
Q5_044.20 GiB47,461,595,6165.505TheBloke
Q5_K_S44.20 GiB47,461,595,6165.505TheBloke
Q5_K_S44.20 GiB47,461,596,4805.505mradermacher
I1-Q5_K_S44.20 GiB47,461,596,7365.505mradermacher
Q5_K_M45.41 GiB48,753,965,5365.654TheBloke

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-Python-hf need?
Q4_K_M is exactly 41,423,092,192 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-Python-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-Python-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.