StarCoder2: The Open Coding Model Trained on 600+ Programming Languages
BigCode's StarCoder2-15B is trained on The Stack v2 covering 619 programming languages, bringing fill-in-the-middle completion and strong HumanEval scores to a model you can run without a vendor contract.
Mahmudul Haque Qudrati
CEO & ML Engineer
One AI engineering post, weekly
LLM benchmarks, prompt techniques, and token-cost breakdowns — not another AI news roundup.
StarCoder2 is the second generation of the BigCode project's open coding models, released in February 2024. The project is a collaboration between Hugging Face, ServiceNow, and the broader open-source research community. The flagship 15B model is trained on The Stack v2 - a cleaned and deduplicated dataset of source code across 619 programming languages.
Model Variants
BigCode released three sizes:
- StarCoder2-3B - fits on a single consumer GPU (12GB VRAM), good for autocomplete
- StarCoder2-7B - balanced size for most IDE integration use cases
- StarCoder2-15B - best quality, recommended for generation tasks
All three are released under the BigCode Open RAIL-M license, which allows commercial use with attribution.
Team workspace
Ship faster with chat, meetings, and projects in one place — Zlyqor.
HumanEval and Benchmark Comparisons
| Model | HumanEval pass@1 | Parameters |
|---|---|---|
| StarCoder2-15B | 46.3% (base), ~72% instruct | 15B |
| CodeLlama 34B | 53.7% | 34B |
| StarCoder (v1) 15B | 33.6% | 15B |
| Qwen2.5-Coder 7B | 88.4% | 7B |
The instruct-tuned version (StarCoder2-15B-Instruct-v0.1) reaches competitive scores on instruction following, though newer models like Qwen2.5-Coder have surpassed it on raw HumanEval. StarCoder2 remains relevant for its breadth of language coverage and fill-in-the-middle support.
Fill-in-the-Middle Training
StarCoder2 is trained with the FIM (fill-in-the-middle) objective, using a special set of tokens that makes code completion feel natural:
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("bigcode/starcoder2-15b")
model = AutoModelForCausalLM.from_pretrained(
"bigcode/starcoder2-15b",
torch_dtype=torch.bfloat16,
device_map="auto"
)
prefix = "def is_palindrome(s: str) -> bool:\n "
suffix = "\n\nassert is_palindrome('racecar') == True"
fim_prompt = f"<fim_prefix>{prefix}<fim_suffix>{suffix}<fim_middle>"
inputs = tokenizer(fim_prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=64, temperature=0.2)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
VS Code Integration via Continue
The easiest way to use StarCoder2-15B for day-to-day coding is through the Continue extension:
- Install Continue from the VS Code marketplace
- In
~/.continue/config.json, add:
{
"tabAutocompleteModel": {
"title": "StarCoder2",
"provider": "ollama",
"model": "starcoder2:15b"
}
}
- Run
ollama pull starcoder2:15b
You now have local, private tab completion that never sends your code to a third-party server.
Hugging Face Code Leaderboard
The Big Code Models Leaderboard tracks models on HumanEval, MBPP, MultiPL-E, and DS-1000. As of early 2025, StarCoder2-15B sits in the top 10 for models under 20B parameters, though the Qwen2.5-Coder family has moved above it in absolute scores.
When to Choose StarCoder2
- You need maximum language breadth (619 languages vs ~100 for most models)
- You want IDE tab completion with FIM and full local privacy
- You need a model in the 7 - 15B range that balances quality and hardware requirements
- You want to build on top of a permissively licensed, academically documented model
Links
Mahmudul Haque Qudrati
CEO & ML Engineer
Visionary leader with extensive experience in machine learning and software development. Drives strategic innovation and business growth.
More from Mahmudul
Related Articles
How to Use Claude to Make Videos Like Vox and Others
Claude can help you make Vox-style videos by generating scripts, editing with code, and automating animation. Here's a practical guide with real workflows and costs.
OpenAI Ends Cursor Model Access on Nov 12, 2026: What Developers Need to Know
OpenAI will terminate Cursor's access to its models on November 12, 2026, following SpaceX's acquisition. This guide explains the timeline, why it happened, and practical steps to migrate your workflow.
Ox Alpha That Became GLM 5.3 Flash: From Mystery to Preview, Everything We Know
Ox Alpha, the anonymous AI model that topped coding benchmarks, turned out to be GLM-5.3-Flash from Zhipu. Here's the full story, from mystery to official preview, with evidence and practical details.
// discussion
Comments