作者: Jakub Rusinowski · 最后更新: 2026年7月10日
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.
| StarCoder 2 3B | Min 3 GB VRAM · Q4_K_M · 16,384 ctx · ollama run starcoder2:3b |
| StarCoder 2 7B | Min 5 GB VRAM · Q4_K_M · 16,384 ctx · ollama run starcoder2:7b |
| StarCoder 2 15B | Min 10 GB VRAM · Q4_K_M · 16,384 ctx · ollama run starcoder2:15b |
The cheapest GPU that runs StarCoder 2 locally (min 3 GB VRAM) is the Intel Arc B570 (10 GB).
Install Ollama then run: ollama run starcoder2:3b
Minimum VRAM: 3 GB. For best results use Q4_K_M quantization.
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.
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.
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.
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.