[whatmodel.sh](../../README.md) / StarCoder2 7B # StarCoder2 7B BigCode · released 2024-02 · 7.17B params · bigcode-openrail-m **score 36.6** ±0.6 · #613 of 732 · from 19 benchmark results across 5 sources Score within the [LMArena (text)](https://whatmodel.sh/?set=lmarena-text&score=set) comparison set only. ## What it's good at ● marks StarCoder2 7B among every model on that task or test, worst to best.
task    vs the others         rank  counts  tests
coding  ▁▁▁●▅▇█▇▅▄▃▁   #422 of 469     86%      9
math    ▁▁▃▅●▆▄█▄▂▁▁   #317 of 431    4.8%      2
coding · #422 of 469 · 86% of its score Beats [DeepSeek R1 Distill Qwen 7B](deepseek-r1-distill-qwen-7b.md), [Qwen3.5 2B](qwen3-5-2b.md), [DeepSeek R1 Distill Llama 8B](deepseek-r1-distill-llama-8b.md) here, though they rank higher overall. Trails [Llama 3.2 1B Instruct](llama-3-2-1b.md), [SmolLM2 1.7B Instruct](smollm2-1-7b.md), [Granite 3B Code Base (2K)](granite-3b-code-base-2k.md) here, though they rank lower overall.
test                                result  vs the others in its run  difficulty        counts  why
HumanEval                            35.4%  ▁·▁▁▃●▆▅█▃▁▁ beats 21/99  easy · avg 76%       45%  sharp · at its level · several runs
HumanEval+                           29.9%  ▁·▁▁▁▃●▄▄█▃▁ beats 20/99  easy · avg 70%       17%  sharp · at its level
MBPP                                 45.4%  █·▅▃▃▃▅▃●▅·▅ beats 11/15  easy · avg 81%      6.6%  at its level · several runs
HumanEvalSynthesize (HumanEvalPac…   37.4%  ▁·▂▁▂▆●█▄▄▁▂ beats 14/35  medium · avg 62%    4.8%  at its level
CRUXEval-I                           34.2%  ▃▅█▃●▅·▃▃▅·▅ beats 7/15   medium · avg 56%    2.8%  at its level · several runs
DS-1000 (maker)                      27.8%  ▄▄·▄██▄●·█·▄ beats 8/12   medium · avg 49%    2.8%  typical
HumanEvalExplain (HumanEvalPack, …   13.5%  ▄●█▃▄▇▄▁▇▃·▁ beats 6/35   medium · avg 46%    2.5%  typical
CRUXEval-O                           35.8%  ▃·▃██●▃·▃▃▅▃ beats 8/15   medium · avg 54%    2.3%  blunt · at its level · several runs
HumanEvalFix (HumanEvalPack, 6-la…    8.9%  ▁·▁▁●██▄█▁▅▅ beats 4/35   medium · avg 51%    2.1%  sharp
math · #317 of 431 · 4.8% of its score Beats [GPT-4 (0613)](gpt-4-0613.md), [Athene-70B](athene-70b.md), [Gemma 2 27B IT](gemma-2-27b.md) here, though they rank higher overall.
test           result  vs the others in its run  difficulty        counts  why
GSM8K (maker)   40.4%  ▄▄▄·▄█·█●·█▄ beats 8/12   easy · avg 75%      3.9%  sharp · at its level · several runs
MATH            10.4%  ▃·▃····●···█ beats 2/5    medium · avg 37%    0.9%  noisy
other tests (2)
test                             result  vs the others in its run  difficulty        counts  why
EvoEval (overall)                 25.0%  ▂▂▃●▄█▁▄▅▃▁▃ beats 9/42   medium · avg 52%    6.6%  typical
BigCodeBench (Complete) (maker)   28.5%  ▂▁▁●▂▅▇█▆▂▂▂ beats 7/58   medium · avg 48%    2.9%  at its level
## How the score was worked out Each result implies a score on its own, after adjusting for how hard that test is and who ran it. The model's score is their weighted average, with a small pull toward the middle for thinly tested models. Each test's weight is its *counts* column above; here it is added up by who ran the tests. [Method](../method.md)
source                                    results  share of the score
EvalPlus / EvalPerf published evaluatio…        2   40% ▇▇▇▇▇
Top Leaderboard Ranking = Top Coding Pr…        2   20% ▇▇
StarCoder 2 and The Stack v2: The Next …        6   19% ▇▇
Granite Code Models: A Family of Open F…        8   18% ▇▇
BigCodeBench paper (submitted / maker-r…        1    3% ▇
prior: pull toward the middle                        0% ▇
weighted average                                   = 36.6
Licences: EvalPlus / EvalPerf published evaluation runs ([Apache-2.0](../../licenses/evalplus-published-runs-Apache-2.0.txt)) · Top Leaderboard Ranking = Top Coding Proficiency ([CC BY 4.0](../../licenses/paper-2403.19114v1-CC-BY-4.0.txt)) · StarCoder 2 and The Stack v2: The Next Generation ([CC BY-SA 4.0](../../licenses/paper-2402.19173v1-CC-BY-SA-4.0.txt)) · Granite Code Models: A Family of Open Foundation Models for Code Intelligence ([CC BY 4.0](../../licenses/paper-2405.04324v1-CC-BY-4.0.txt)) · BigCodeBench paper ([CC BY 4.0](http://creativecommons.org/licenses/by/4.0/)) ## How to run it ### llama.cpp (recommended) 1. Install llama.cpp. Homebrew and winget installs name the commands llama-cli and llama-server instead. [Other ways to install](https://github.com/ggml-org/llama.cpp/blob/master/docs/install.md) ```sh # macOS / Linux curl -LsSf https://llama.app/install.sh | sh # Windows irm https://llama.app/install.ps1 | iex ``` 2. Run StarCoder2 7B (Q4_K_M, needs ~4.4 GB, from [huggingface.co/second-state](https://huggingface.co/second-state/StarCoder2-7B-GGUF/tree/b5a3389fafb6c1686d221d4400ee3be5a702bcde)) ```sh llama cli -hf second-state/StarCoder2-7B-GGUF:Q4_K_M ``` 3. Or start a local server and open the address it prints (http://localhost:9931) ```sh llama serve -hf second-state/StarCoder2-7B-GGUF:Q4_K_M ``` Other versions: Q8_0 (~7.6 GB) `llama cli -hf second-state/StarCoder2-7B-GGUF:Q8_0` ### LM Studio 1. Install LM Studio. Open the app once before using the lms command. [Download it (macOS / Windows / Linux)](https://lmstudio.ai/download) 2. Run StarCoder2 7B (Q4_K_M, needs ~4.4 GB, from [huggingface.co/second-state](https://huggingface.co/second-state/StarCoder2-7B-GGUF/tree/b5a3389fafb6c1686d221d4400ee3be5a702bcde)) ```sh lms get https://huggingface.co/second-state/StarCoder2-7B-GGUF@Q4_K_M -y ``` 3. Then run lms ls to see its name, and lms chat followed by that name Other versions: Q8_0 (~7.6 GB) `lms get https://huggingface.co/second-state/StarCoder2-7B-GGUF@Q8_0 -y` · 4bit (~4.4 GB, Mac only) `lms get https://huggingface.co/mlx-community/starcoder2-7b-4bit -y` ### Ollama 1. Install Ollama. [Download it (macOS / Windows)](https://ollama.com/download) ```sh # Linux curl -fsSL https://ollama.com/install.sh | sh ``` 2. Run StarCoder2 7B (Q4_K_M, needs ~4.4 GB, from [ollama.com](https://ollama.com/library/starcoder2/tags)) ```sh ollama run starcoder2:7b-q4_K_M ``` Other versions: Q8_0 (~7.6 GB) `ollama run starcoder2:7b-q8_0` ### MLX (Mac) 1. Install MLX (Mac). Apple silicon Macs only, text only. ```sh # with uv uv tool install mlx-lm # or pip install mlx-lm ``` 2. Run StarCoder2 7B (4bit, needs ~4.4 GB, Mac only, from [huggingface.co/mlx-community](https://huggingface.co/mlx-community/starcoder2-7b-4bit/tree/1da6e99505fc3d78a917c84674e16cbf3121046f)) ```sh mlx_lm.chat --model mlx-community/starcoder2-7b-4bit ``` 3. Or start an OpenAI-compatible server at http://localhost:8080/v1 ```sh mlx_lm.server --model mlx-community/starcoder2-7b-4bit ``` Model repository and documentation: [huggingface.co/bigcode](https://huggingface.co/bigcode/starcoder2-7b) [interactive version](https://whatmodel.sh/model/starcoder2-7b) · [JSON](https://whatmodel.sh/api?format=json&all=1)