Meta·Code Llama·LlamaForCausalLM

CodeLlama 34B HF — Hardware Requirements & GPU Compatibility

ChatCode

CodeLlama 34B HF is a 33.7B-parameter open language model from Meta in the Code Llama family. It supports a context window of up to 16,384 tokens. At Q4_K_M it needs about 20.95 GB of VRAM — see which GPUs and Macs can run it below.

27.6K downloads 178 likes16K context

Specifications

Publisher
Meta
Family
Code Llama
Parameters
33.7B
Architecture
LlamaForCausalLM
Context Length
16,384 tokens
Vocabulary Size
32,000
Release Date
2023-08-24
License
Llama 2 Community

Get Started

How Much VRAM Does CodeLlama 34B HF Need?

Select a quantization to see compatible GPUs below.

QuantizationBitsVRAM
Q2_Kest.3.4015.0 GB
Q3_K_Mest.3.9017.1 GB
Q4_K_Mest.4.8020.9 GB
Q5_K_Mest.5.7024.8 GB
Q6_Kest.6.6028.5 GB
Q8_0est.8.0034.5 GB
BF16est.16.0068.2 GB

est.= calculated VRAM estimate; no published GGUF file found for that quantization yet. Other rows are verified against real community uploads.

Which GPUs Can Run CodeLlama 34B HF?

Q4_K_M · 20.9 GB

CodeLlama 34B HF (Q4_K_M) requires 20.9 GB of VRAM to load the model weights. For comfortable inference with headroom for KV cache and system overhead, 28+ GB is recommended. Using the full 16K context window can add up to 2.8 GB, bringing total usage to 23.8 GB. 7 GPUs can run it, including NVIDIA GeForce RTX 5090, NVIDIA GeForce RTX 3090 Ti.

Which Devices Can Run CodeLlama 34B HF?

Q4_K_M · 20.9 GB

41 devices with unified memory can run CodeLlama 34B HF, including NVIDIA DGX H100, NVIDIA DGX A100 640GB, Mac Mini M4 Pro (24 GB).

Runs great

Plenty of headroom

Frequently Asked Questions

How much VRAM does CodeLlama 34B HF need?

CodeLlama 34B HF requires 20.9 GB of VRAM at Q4_K_M, or 68.2 GB at BF16. Full 16K context adds up to 2.8 GB (23.8 GB total).

VRAM = Weights + KV Cache + Overhead

Weights = 33.7B × 4.8 bits ÷ 8 = 20.2 GB

KV Cache + Overhead 0.8 GB (at 2K context + ~0.3 GB framework)

KV Cache + Overhead 3.6 GB (at full 16K context)

VRAM usage by quantization

20.9 GB
23.8 GB

Learn more about VRAM estimation →

Can NVIDIA GeForce RTX 4090 run CodeLlama 34B HF?

Yes, at Q4_K_M (20.9 GB) or lower. Higher quantizations like Q5_K_M (24.8 GB) exceed the NVIDIA GeForce RTX 4090's 24 GB.

What's the best quantization for CodeLlama 34B HF?

For CodeLlama 34B HF, Q4_K_M (20.9 GB) offers the best balance of quality and VRAM usage. Q5_K_M (24.8 GB) provides better quality if you have the VRAM. The smallest option is Q2_K at 15.0 GB.

VRAM requirement by quantization

Q2_K
15.0 GB
Q4_K_M
20.9 GB
Q5_K_M
24.8 GB
Q6_K
28.5 GB
Q8_0
34.5 GB
BF16
68.2 GB

★ Recommended — best balance of quality and VRAM usage.

Learn more about quantization →

Can I run CodeLlama 34B HF on a Mac?

CodeLlama 34B HF requires at least 15.0 GB at Q2_K, which exceeds the unified memory of most consumer Macs. You would need a Mac Studio or Mac Pro with a high-memory configuration.

Can I run CodeLlama 34B HF locally?

Yes — CodeLlama 34B HF can run locally on consumer hardware. At Q4_K_M quantization it needs 20.9 GB of VRAM. Popular tools include Ollama, LM Studio, and llama.cpp.

How fast is CodeLlama 34B HF?

At Q4_K_M, CodeLlama 34B HF can reach ~210 tok/s on AMD Instinct MI350X. On NVIDIA GeForce RTX 4090: ~31 tok/s. Speed depends mainly on GPU memory bandwidth. Real-world results typically within ±20%.

tok/s = (bandwidth GB/s ÷ model GB) × efficiency

Example: NVIDIA B2008000 ÷ 20.9 × 0.65 = ~248 tok/s

Estimated speed at Q4_K_M (20.9 GB)

~248 tok/s
~31 tok/s
~248 tok/s
~210 tok/s

Real-world results typically within ±20%. Speed depends on batch size, quantization kernel, and software stack.

Learn more about tok/s estimation →

What's the download size of CodeLlama 34B HF?

At Q4_K_M, the download is about 20.25 GB. The full-precision BF16 version is 67.49 GB. The smallest option (Q2_K) is 14.34 GB.

Which GPUs can run CodeLlama 34B HF?

7 consumer GPUs can run CodeLlama 34B HF at Q4_K_M (20.9 GB). Top options include NVIDIA GeForce RTX 5090, AMD Radeon RX 7900 XTX, NVIDIA GeForce RTX 3090. 1 GPU have plenty of headroom for comfortable inference.

Which devices can run CodeLlama 34B HF?

41 devices with unified memory can run CodeLlama 34B HF at Q4_K_M (20.9 GB), including AMD Ryzen AI 9 HX 370 (Strix Point) Laptop, ASUS Ascent GX10, Asus ROG Flow Z13 (2025, Ryzen AI Max+ 395, 128 GB), Beelink GTR9 Pro (Ryzen AI Max+ 395, 128 GB). Apple Silicon Macs use unified memory shared between CPU and GPU, making them well-suited for local LLM inference.