StarCoder 2 — Local AI Model by BigCode

作者: 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.

Hardware Requirements

StarCoder 2 3BMin 3 GB VRAM · Q4_K_M · 16,384 ctx · ollama run starcoder2:3b
StarCoder 2 7BMin 5 GB VRAM · Q4_K_M · 16,384 ctx · ollama run starcoder2:7b
StarCoder 2 15BMin 10 GB VRAM · Q4_K_M · 16,384 ctx · ollama run starcoder2:15b

Recommended GPU

The cheapest GPU that runs StarCoder 2 locally (min 3 GB VRAM) is the Intel Arc B570 (10 GB).

联盟营销声明: 本页部分链接为联盟推广链接——如果你通过它们购买,LLM Configurator 可能会获得佣金,而你无需支付任何额外费用。作为亚马逊联盟成员(Amazon Associate),LLM Configurator 会从符合条件的购买中获得收益。
Intel Arc B570 10GB
首发建议零售价:$219
2026年价格波动较大——请以当前商品页价格为准。
在亚马逊查看价格

How to Run Locally

Install Ollama then run: ollama run starcoder2:3b

Minimum VRAM: 3 GB. For best results use Q4_K_M quantization.

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.

Can I Run StarCoder 2 on My GPU?