Meta·Code Llama·LlamaForCausalLM

CodeLlama 34B Instruct HF — Hardware Requirements & GPU Compatibility

ChatCode

CodeLlama-34b-Instruct-hf is Meta's 34-billion-parameter instruction-tuned Code Llama model, fine-tuned from the base Code Llama checkpoint for safer, more reliable code-assistant use, as opposed to the plain base and Python-specialized variants in the same family (which also ships in 7B, 13B, and 70B sizes). It is an early, first-generation code model built on the original Llama 2 architecture and predates the later Code Llama 70B release. At 34B parameters, it needs a multi-GPU setup or aggressive quantization for local use. Context length is 16,384 tokens. It is released under the Llama 2 Community License, a custom license that restricts commercial use above 700 million monthly active users, requiring a separate license from Meta, and was published in August 2023.

21.2K downloads 305 likes 5.2K quant downloads16K 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 Instruct HF Need?

Select a quantization to see compatible GPUs below.

QuantizationBitsVRAM
Q2_K3.4015.0 GB
Q3_K_S3.5015.5 GB
Q3_K_M3.9017.1 GB
Q4_04.0017.6 GB
Q4_K_M4.8020.9 GB
Q5_K_M5.7024.8 GB
Q6_K6.6028.5 GB
Q8_08.0034.5 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 Instruct HF?

Q4_K_M · 20.9 GB

CodeLlama 34B Instruct 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 Instruct HF?

Q4_K_M · 20.9 GB

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

Runs great

— Plenty of headroom

Where to Download CodeLlama 34B Instruct HF

Community quantizations of this model — GGUF for llama.cpp, Ollama, and LM Studio, plus AWQ/MLX variants where available.

Related Models

Frequently Asked Questions

How much VRAM does CodeLlama 34B Instruct HF need?

CodeLlama 34B Instruct 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 Instruct HF?

Yes, at Q5_K_S (23.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 Instruct HF?

For CodeLlama 34B Instruct HF, Q4_K_M (20.9 GB) offers the best balance of quality and VRAM usage. Q5_K_S (23.9 GB) provides better quality if you have the VRAM. The smallest option is IQ2_XXS at 10.0 GB.

VRAM requirement by quantization

IQ2_XXS
10.0 GB
IQ3_XS
14.6 GB
Q3_K_M
17.1 GB
Q4_K_M ★
20.9 GB
Q5_K_S
23.9 GB
BF16
68.2 GB

★ Recommended — best balance of quality and VRAM usage.

Learn more about quantization →

Can I run CodeLlama 34B Instruct HF on a Mac?

CodeLlama 34B Instruct HF requires at least 10.0 GB at IQ2_XXS, 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 Instruct HF locally?

Yes — CodeLlama 34B Instruct 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 Instruct HF?

At Q4_K_M, CodeLlama 34B Instruct HF can reach ~229 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 B200 → 8000 ÷ 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
~229 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 Instruct HF?

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

Which GPUs can run CodeLlama 34B Instruct HF?

7 consumer GPUs can run CodeLlama 34B Instruct 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 Instruct HF?

41 devices with unified memory can run CodeLlama 34B Instruct 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.