Meta
CodeLlama 7B Instruct (7B parameters) requires approximately 13.9 GB of VRAM with Q4_K_M quantization. For the best balance of quality and speed, we recommend hardware with at least 16 GB of VRAM.
Get started
— copy & paste to run locallyCopy-paste commands to run CodeLlama 7B Instruct on your machine.
Run
lms load CodeLlama-7b-Instruct-hf && lms server startQuick specs
About this model
Related models
Inference speed
Estimated decode speed (tokens/sec) for CodeLlama 7B Instruct at Q4_K_M across popular GPUs and Apple Silicon, using the fastest local runtime per device. Fastest is RTX 5090 32GB at ~98 tok/s. Speed is memory-bandwidth bound, so cards that fit the whole model in VRAM run far faster than ones that offload to system RAM.
| GPU / Mac | Memory | Quant | Speed (tok/s) | Fits? |
|---|---|---|---|---|
| 32 GB | Q4_K_M | 98.0 | Fits | |
| 24 GB | Q4_K_M | 98.0 | Fits | |
| 16 GB | Q4_K_M | 98.0 | Tight | |
| 24 GB | Q4_K_M | 98.0 | Fits | |
RX 7900 XTX 24GB | 24 GB | Q4_K_M | 98.0 | Fits |
Mac Studio M3 Ultra 256GB | 256 GB | Q4_K_M | 98.0 | Fits |
Mac Studio M2 Ultra 128GB | 128 GB | Q4_K_M | 98.0 | Fits |
Mac Studio M1 Ultra 128GB | 128 GB | Q4_K_M | 98.0 | Fits |
MacBook Pro M4 Max 128GB | 128 GB | Q4_K_M | 87.8 | Fits |
MacBook Pro M4 Max 64GB | 64 GB | Q4_K_M | 87.8 | Fits |
MacBook Pro M3 Max 64GB | 64 GB | Q4_K_M | 56.2 | Fits |
MacBook Pro M1 Max 64GB | 64 GB | Q4_K_M | 51.5 | Fits |
MacBook Pro M4 Pro 48GB | 48 GB | Q4_K_M | 45.3 | Fits |
| 12 GB | Q4_K_M | 43.0 | Heavy offload | |
| 12 GB | Q4_K_M | 24.7 | Heavy offload | |
| 8 GB | Q4_K_M | 10.6 | Too big |
Estimates for single-stream decoding at Q4_K_M; real tokens/sec varies with prompt length, context, batch size, and runtime build. Prompt processing (prefill) is faster than the decode figures shown here.
Quick picks
Best hardware
Run this model
Quantization
How much VRAM CodeLlama 7B Instruct (7B) needs at each GGUF quant, and whether it fits a 24 GB card (RTX 4090 / 3090). The recommended Q4_K_M uses ~4.3 GB — about 43% less VRAM than Q8_0, at a small quality cost.
| Quant | Bits | VRAM (weights) | Quality | Fits 24 GB? |
|---|---|---|---|---|
| Q2_K | 2 | 2.7 GB | Low | Fits |
| Q3_K_S | 3 | 3.4 GB | Low | Fits |
| NVFP4 | 4 | 3.9 GB | Medium | Fits |
| Q4_K_Mrecommended | 4 | 4.3 GB | Medium | Fits |
| Q5_K_M | 5 | 5 GB | High | Fits |
| Q6_K | 6 | 5.7 GB | High | Fits |
| Q8_0 | 8 | 7.5 GB | Very High | Fits |
| F16 | 16 | 14.3 GB | Maximum | Offloads |
VRAM shown is quantized weights only; add ~1–3 GB runtime overhead plus KV cache for your context length. Lower quants trade quality for memory — Q4_K_M is the usual sweet spot; Q2/Q3 only when you must fit a bigger model.
Quality benchmarks
Coding
Source: official · 2023-08-24
Hardware compatibility
Computing compatibility...
Memory breakdown
Frequently asked questions
CodeLlama 7B Instruct (7B parameters) requires approximately 13.9 GB of VRAM with Q4_K_M quantization. Lower quantizations like Q4_K_M use less memory but may reduce quality.
Yes, RX 7600 XT 16GB can run CodeLlama 7B Instruct with a compatibility score of 74/100. It provides 16 GB of memory and achieves approximately 39.1 tokens per second.
The recommended quantization for CodeLlama 7B Instruct is Q4_K_M, which offers the best balance between model quality and memory efficiency. Higher quantizations preserve more quality but require more VRAM.
The top recommended hardware for CodeLlama 7B Instruct: RX 7900 XT 20GB (score: 80/100), RTX A4500 20GB (score: 80/100), RTX 3090 24GB (score: 79/100). These provide the best combination of memory, bandwidth, and compute for running this model locally.
Yes, CodeLlama 7B Instruct is well-suited for coding. It was designed with these use cases in mind.
See also