← Back to Discover

StarCoder 2

A 15-billion-parameter code model from the BigCode project, trained on more than 600 programming languages. It is a base model for continuing code from context, not an instruction-following assistant.

Open modelsLocal models

What it does

StarCoder2-15B is a code model published on Hugging Face by the BigCode project. It has 15 billion parameters and was trained on more than 600 programming languages from The Stack v2, with opt-out requests excluded. The training data also includes other selected sources such as arXiv and Wikipedia text. The model uses grouped-query attention, a 16,384-token context window with 4,096-token sliding-window attention, and a fill-in-the-middle training objective, over more than four trillion tokens. The model card gives example code for running it with the Transformers library on CPU or GPU, in bfloat16, or in 8-bit and 4-bit quantized form, and links to serving guides for vLLM, SGLang and Docker Model Runner. Quantized versions are listed for llama.cpp, Ollama, LM Studio and Jan. It is not an instruction model, so natural-language commands asking it to write a function do not work well. The card warns that its output may not behave as intended, can be inefficient, and may contain bugs or exploits. The model can also reproduce source code from its training data, so licence and attribution requirements still apply, and a search index is provided to trace where generated code came from. The model is released under the BigCode OpenRAIL-M v1 licence.

Capabilities

  • 15 billion parameters, trained on 600+ programming languages
  • 16,384-token context window with 4,096-token sliding-window attention
  • Fill-in-the-middle training objective
  • Example code for Transformers, including 8-bit and 4-bit quantized loading
  • Serving guides for vLLM, SGLang and Docker Model Runner
  • Quantized versions listed for llama.cpp, Ollama, LM Studio and Jan

When to use it

  • You want a base code model that you can run on your own hardware
  • You are experimenting with code completion or fine-tuning and want documented training data
  • You want to check generated code against the pretraining data using the provided search index