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 at Pristren

Mahmudul Haque Qudrati

CEO & ML Engineer

March 12, 2026
7 min read
StarCoder2: The Open Coding Model Trained on 600+ Programming Languages

What Is StarCoder2?

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.

Start free

HumanEval and Benchmark Comparisons

ModelHumanEval pass@1Parameters
StarCoder2-15B46.3% (base), ~72% instruct15B
CodeLlama 34B53.7%34B
StarCoder (v1) 15B33.6%15B
Qwen2.5-Coder 7B88.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:

python
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:

  1. Install Continue from the VS Code marketplace
  2. In ~/.continue/config.json, add:
json
{
  "tabAutocompleteModel": {
    "title": "StarCoder2",
    "provider": "ollama",
    "model": "starcoder2:15b"
  }
}
  1. 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
#starcoder2#coding#bigcode#open-source#fill-in-middle

// discussion

Comments

0/4000
Mahmudul Haque Qudrati — CEO & ML Engineer at Pristren

Mahmudul Haque Qudrati

CEO & ML Engineer

Visionary technologist, software engineer, and machine learning specialist. Founder and CEO of Pristren, directing engineering teams that ship production-grade AI/ML pipelines, mission-critical full-stack applications, and developer tooling. Creator of Zlyqor, the unified team workspace platform. Author of 540+ technical guides and benchmark research reports on large language models, agentic workflows, Model Context Protocol (MCP), and modern web stacks.

PristrenZlyqor