StarCoder 2 — BigCode 的本地 AI 模型
作者: Jakub Rusinowski · 最后更新:
顶级开源代码生成模型。StarCoder 2在涵盖600+编程语言的The Stack v2数据集上训练。专为代码补全、生成和理解构建——而非通用模型的代码微调版本。
变体
StarCoder 2 最小的变体在 Q4_K_M 下约需 3 GB 显存——量化权重加框架开销,不含 KV 缓存。
| 模型 | Q4 下显存 | 显存 | 上下文 | 运行 |
|---|---|---|---|---|
| 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 |
显存为 Q4_K_M 下的量化权重加开销,与 GPU 与显存检测器使用同一引擎计算。
如何在本地运行 StarCoder 2
安装 Ollama,然后拉取标签。
ollama run starcoder2:3b在上方选择一个尺寸,查看它自己的显存、速度估算和安装命令。
许可证
Weights are downloadable and commercial use is permitted, subject to the licence’s acceptable-use terms.
适用于: StarCoder 2 3B, StarCoder 2 7B, StarCoder 2 15B推荐 GPU
目录中能在本地运行 StarCoder 2(至少 3 GB 显存)的最便宜 GPU 是 Intel Arc B570 (10 GB).
我的 GPU 能运行 StarCoder 2 吗?
- StarCoder 2 在 AMD Radeon RX 7800 XT 上
- StarCoder 2 在 AMD Radeon RX 7900 XT 上
- StarCoder 2 在 AMD Radeon RX 9060 XT 16GB 上
- StarCoder 2 在 AMD Radeon RX 9060 XT 8GB 上
- StarCoder 2 在 AMD Radeon RX 9070 上
- StarCoder 2 在 AMD Radeon RX 9070 XT 上
- StarCoder 2 在 Apple M1 上
- StarCoder 2 在 Intel Arc B570 上
- StarCoder 2 在 Intel Arc B580 上
- StarCoder 2 在 NVIDIA GeForce RTX 3060 (12GB) 上
- StarCoder 2 在 NVIDIA GeForce RTX 3070 上
- StarCoder 2 在 NVIDIA GeForce RTX 3070 Ti 上
- StarCoder 2 在 NVIDIA GeForce RTX 3080 (10GB) 上
- StarCoder 2 在 NVIDIA GeForce RTX 4060 上
- StarCoder 2 在 NVIDIA GeForce RTX 4060 Ti 16GB 上
- StarCoder 2 在 NVIDIA GeForce RTX 4070 上
- StarCoder 2 在 NVIDIA GeForce RTX 4070 Super 上
- StarCoder 2 在 NVIDIA GeForce RTX 4070 Ti 上
- StarCoder 2 在 NVIDIA GeForce RTX 4070 Ti Super 上
- StarCoder 2 在 NVIDIA GeForce RTX 4080 上
- StarCoder 2 在 NVIDIA GeForce RTX 4080 Super 上
- StarCoder 2 在 NVIDIA GeForce RTX 5060 上
- StarCoder 2 在 NVIDIA GeForce RTX 5060 Ti 16GB 上
- StarCoder 2 在 NVIDIA GeForce RTX 5060 Ti 8GB 上
- StarCoder 2 在 NVIDIA GeForce RTX 5070 上
- StarCoder 2 在 NVIDIA GeForce RTX 5070 Ti 上
- StarCoder 2 在 NVIDIA GeForce RTX 5080 上
StarCoder 2 — 常见问题
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.