Written by Jakub Rusinowski · Last updated February 28, 2024
Model library → StarCoder 2 → StarCoder 2 7B
The sweet spot for code generation. Strong multi-language support, good at completing complex functions. Works well on 8GB VRAM GPUs as a lightweight coding assistant.
StarCoder 2 7B needs about 5 GB of VRAM at Q4_K_M — quantized weights plus framework overhead, before any KV cache. On Apple Silicon that figure comes out of unified memory.
| Parameters | 7 Billion |
| Context window | 16,384 |
| Architecture | Dense |
| Provider | BigCode |
| Licence | BigCode Open RAIL-M v1 |
| Specified at | Q4_K_M |
| System RAM | 16 GB |
| Record updated | 2024-02-28 |
BigCode OpenRAIL-M — commercial use permitted. Weights are downloadable and commercial use is permitted, subject to the licence’s acceptable-use terms.
Modelled on a reference NVIDIA RTX 4090 (24 GB), at 8K context. Speed figures are ESTIMATES from the memory-bandwidth roofline described on the methodology page, not benchmarks we ran — rows marked measured come from published or reader-submitted runs. VRAM here includes the KV cache, so it reads higher than the headline figure above, which does not.
| Quant | Weights | VRAM needed | Est. speed | Fit on 24 GB |
|---|---|---|---|---|
| Q2_K | 2.4 GB | 3.7 GB | ~174 tok/s (est.) | Fits comfortably |
| Q3_K_M | 3.1 GB | 4.4 GB | ~150 tok/s (est.) | Fits comfortably |
| Q4_K_M | 4.3 GB | 5.7 GB | ~120 tok/s (est.) | Fits comfortably |
| Q5_K_M | 5.1 GB | 6.4 GB | ~107 tok/s (est.) | Fits comfortably |
| Q6_K | 5.9 GB | 7.2 GB | ~96 tok/s (est.) | Fits comfortably |
| Q8_0 | 7.7 GB | 9.0 GB | ~79 tok/s (est.) | Fits comfortably |
| F16 | 14.4 GB | 15.7 GB | ~46 tok/s (est.) | Fits comfortably |
Want the memory numbers alone, at every quantization level and your own context length? Use the StarCoder 2 7B VRAM calculator.
or compare on Vast.ai from $0.35/hr (typical low · varies)
As an Amazon Associate we earn from qualifying purchases. Cloud GPU links are referral links — we may earn a commission at no extra cost to you.
The cheapest catalogued GPU that runs StarCoder 2 7B is the Intel Arc B570 (10 GB).
Install Ollama, then run:
ollama run starcoder2:7b
Weights on Hugging Face: bigcode/starcoder2-7b.
Best for: code completion, coding, multi language.
← All StarCoder 2 models | VRAM calculator | Check your own hardware