LL

CodeLlama-70b-hf

LlamaGGUF by RichardErkhovUpdated 2024-06-26
Download on Hugging Face
Parameters69B
Context16K
Layers80
Architecturellama
Smallest quant0.2 GB
Quick answer

CodeLlama-70b-hf needs about 44.6 GB of memory at Q4_K_M (a 41.4 GB file) with an 8K context window, so it fits on a 48 GB GPU. This repository has 22 quants, from 0.2 GB (Q8_0) to 56.6 GB (Q6_K).

CodeLlama-70b-hf is a 69B-parameter Llama model in GGUF format, quantized by RichardErkhov. Its trained context length is 16K tokens. The repository has 22 quant files, from 0.2 GB (Q8_0) to 56.6 GB (Q6_K).

Quants & memory

QuantFileEst. memoryvs VRAMResultDownload
Q8_00.2 GB 3.4 GB
Fits Get file →
Q5_125.4 GB 28.6 GB
Too big Get file →
Q2_K25.5 GB 28.6 GB
Too big Get file →
IQ3_XS28.3 GB 31.5 GB
Too big Get file →
IQ3_S29.9 GB 33.1 GB
Too big Get file →
Q3_K_S29.9 GB 33.1 GB
Too big Get file →
IQ3_M30.9 GB 34.1 GB
Too big Get file →
Q3_K33.3 GB 36.5 GB
Too big Get file →
Q3_K_M33.3 GB 36.5 GB
Too big Get file →
Q3_K_L36.1 GB 39.3 GB
Too big Get file →
IQ4_XS37.2 GB 40.4 GB
Too big Get file →
Q4_038.9 GB 42.1 GB
Too big Get file →
IQ4_NL39.2 GB 42.4 GB
Too big Get file →
Q4_K_S39.2 GB 42.4 GB
Too big Get file →
Q4_K41.4 GB (2 parts) 44.6 GB
Too big Get file →
Q4_K_M41.4 GB (2 parts) 44.6 GB
Too big Get file →
Q4_143.2 GB (2 parts) 46.4 GB
Too big Get file →
Q5_047.5 GB (2 parts) 50.6 GB
Too big Get file →
Q5_K_S47.5 GB (2 parts) 50.6 GB
Too big Get file →
Q5_K48.8 GB (2 parts) 51.9 GB
Too big Get file →
Q5_K_M48.8 GB (2 parts) 51.9 GB
Too big Get file →
Q6_K56.6 GB (2 parts) 59.8 GB
Too big Get file →

What GPU do you need for CodeLlama-70b-hf?

These figures add the file size, an fp16 KV cache at an 8K context window (worked out from this model’s own header) and about 0.5 GB for the runtime. They are estimates, so leave a little headroom, and expect to use less context or a smaller quant if you are right at the limit.

  • 4 GB VRAM: the best quant that fits is Q8_0 (0.2 GB file, about 3.4 GB in use).
  • 6 GB VRAM: the best quant that fits is Q8_0 (0.2 GB file, about 3.4 GB in use).
  • 8 GB VRAM: the best quant that fits is Q8_0 (0.2 GB file, about 3.4 GB in use).
  • 12 GB VRAM: the best quant that fits is Q8_0 (0.2 GB file, about 3.4 GB in use).
  • 16 GB VRAM: the best quant that fits is Q8_0 (0.2 GB file, about 3.4 GB in use).
  • 24 GB VRAM: the best quant that fits is Q8_0 (0.2 GB file, about 3.4 GB in use).
  • 32 GB VRAM: the best quant that fits is IQ3_XS (28.3 GB file, about 31.5 GB in use).
  • 48 GB VRAM: the best quant that fits is Q4_1 (43.2 GB file, about 46.4 GB in use).

Which CodeLlama-70b-hf quant should you choose?

Q4_K_M is the usual starting point for CodeLlama-70b-hf: it balances file size and quality well. Here it is a 41.4 GB file.

The Q8_0 file is 0.2 GB, about 0.0 times the size of Q4_K_M. It keeps the weights closer to the original, which only matters if you have the memory to spare.

If memory is tight, the smallest file is Q8_0 at 0.2 GB, with the quality trade-offs that come with fewer bits. Close to lossless. It costs roughly twice the memory of a 4-bit file, so it suits cases where you have plenty of VRAM.

New to quant names? Read GGUF quantization explained.

Specifications

Architecture from the GGUF header

Architecturellama
Parameters69B
Layers80
Trained context16,384 tokens
KV cache (fp16)320 KB per token

Source

Quantized byRichardErkhov
FamilyLlama
Downloads (HF)94
Last updated2024-06-26

Frequently asked questions about CodeLlama-70b-hf

How much VRAM does CodeLlama-70b-hf need?

About 44.6 GB at Q4_K_M with an 8K context window. That is the 41.4 GB file, plus the KV cache and roughly 0.5 GB of runtime overhead. Smaller quants need less and longer context needs more.

Can I run CodeLlama-70b-hf on an 8 GB GPU?

Yes, with Q8_0: the 0.2 GB file needs about 3.4 GB at 8K context. Larger quants in this repository do not fit in 8 GB.

What is the file size of CodeLlama-70b-hf GGUF?

It depends on the quant: Q8_0 is 0.2 GB, Q5_1 is 25.4 GB, Q2_K is 25.5 GB, IQ3_XS is 28.3 GB, IQ3_S is 29.9 GB, Q3_K_S is 29.9 GB and 16 more.

What context length does CodeLlama-70b-hf support?

The GGUF header lists a trained context length of 16,384 tokens (16K). The KV cache grows with the context you use: about 2.7 GB at 8K and 5.4 GB at 16K.

Where can I download CodeLlama-70b-hf GGUF?

The files are on Hugging Face in the RichardErkhov/codellama_-_CodeLlama-70b-hf-gguf repository. The download buttons on this page open the file on Hugging Face. ggufmodels.com does not host any model files.

Similar models

Browse all →

More from RichardErkhov

All by RichardErkhov →

More Llama models

All Llama →

Other large models

All large models →