StarCoder 2 — local AI model by BigCode
Written by Jakub Rusinowski · Last updated
The premier open-source code generation model. StarCoder 2 is trained on The Stack v2 dataset covering 600+ programming languages. Purpose-built for code completion, generation, and understanding — not a general-purpose model fine-tuned for code.
Variants
The smallest StarCoder 2 variant needs about 3 GB of VRAM at Q4_K_M — quantized weights plus framework overhead, before any KV cache.
| Model | VRAM at Q4 | VRAM | Context | Run it |
|---|---|---|---|---|
| StarCoder 2 3B → 3B | ~2.6 GB | 16,384 | ollama run starcoder2:3b | |
| StarCoder 2 7B → 7B | ~5.1 GB | 16,384 | ollama run starcoder2:7b | |
| StarCoder 2 15B → 15B | ~10.2 GB | 16,384 | ollama run starcoder2:15b |
Memory is quantized weights plus overhead at Q4_K_M, from the same engine as the GPU & VRAM checker.
How to run StarCoder 2 locally
Install Ollama, then pull the tag.
ollama run starcoder2:3bPick a size above for its own VRAM figure, speed estimate and install command.
Licence
Weights are downloadable and commercial use is permitted, subject to the licence’s acceptable-use terms.
Applies to: StarCoder 2 3B, StarCoder 2 7B, StarCoder 2 15BRecommended GPU
The cheapest catalogued GPU that runs StarCoder 2 locally (min 3 GB VRAM) is the Intel Arc B570 (10 GB).
Can I run StarCoder 2 on my GPU?
- StarCoder 2 on AMD Radeon RX 7800 XT
- StarCoder 2 on AMD Radeon RX 7900 XT
- StarCoder 2 on AMD Radeon RX 9060 XT 16GB
- StarCoder 2 on AMD Radeon RX 9060 XT 8GB
- StarCoder 2 on AMD Radeon RX 9070
- StarCoder 2 on AMD Radeon RX 9070 XT
- StarCoder 2 on Apple M1
- StarCoder 2 on Intel Arc B570
- StarCoder 2 on Intel Arc B580
- StarCoder 2 on NVIDIA GeForce RTX 3060 (12GB)
- StarCoder 2 on NVIDIA GeForce RTX 3070
- StarCoder 2 on NVIDIA GeForce RTX 3070 Ti
- StarCoder 2 on NVIDIA GeForce RTX 3080 (10GB)
- StarCoder 2 on NVIDIA GeForce RTX 4060
- StarCoder 2 on NVIDIA GeForce RTX 4060 Ti 16GB
- StarCoder 2 on NVIDIA GeForce RTX 4070
- StarCoder 2 on NVIDIA GeForce RTX 4070 Super
- StarCoder 2 on NVIDIA GeForce RTX 4070 Ti
- StarCoder 2 on NVIDIA GeForce RTX 4070 Ti Super
- StarCoder 2 on NVIDIA GeForce RTX 4080
- StarCoder 2 on NVIDIA GeForce RTX 4080 Super
- StarCoder 2 on NVIDIA GeForce RTX 5060
- StarCoder 2 on NVIDIA GeForce RTX 5060 Ti 16GB
- StarCoder 2 on NVIDIA GeForce RTX 5060 Ti 8GB
- StarCoder 2 on NVIDIA GeForce RTX 5070
- StarCoder 2 on NVIDIA GeForce RTX 5070 Ti
- StarCoder 2 on NVIDIA GeForce RTX 5080
StarCoder 2 — frequently asked questions
How much VRAM does StarCoder 2 need?
StarCoder 2 needs about 3 GB VRAM at Q4_K_M quantization for its smallest variant. Variants: StarCoder 2 3B (3 GB, Q4_K_M); StarCoder 2 7B (5 GB, Q4_K_M); StarCoder 2 15B (10 GB, Q4_K_M). On Apple Silicon, unified memory counts toward this requirement.
Can I run StarCoder 2 on an RTX 4090 (24 GB)?
Yes — StarCoder 2 runs on an RTX 4090 (24 GB) and other 24 GB cards such as the RTX 3090. Smaller variants also fit comfortably on 8–16 GB GPUs at Q4_K_M.
What quantization should I use for StarCoder 2?
Q4_K_M is the best balance of quality and VRAM for StarCoder 2 in most cases. Choose Q8_0 for near-lossless quality if you have spare VRAM, or smaller quants (Q3/Q2) only when memory is tight.
How do I run StarCoder 2 with Ollama?
Install Ollama, then run: ollama run starcoder2:3b. This downloads StarCoder 2 and starts a local, OpenAI-compatible endpoint — no internet connection is needed after the initial download.