[whatmodel.sh](../../README.md) / StarCoder2 3B # StarCoder2 3B BigCode · released 2024-02 · 3.03B params · bigcode-openrail-m **score 35.1** ±0.6 · #625 of 732 · from 17 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 3B among every model on that task or test, worst to best.
task    vs the others          rank  counts  tests
coding  ▁▁▁●▅▇█▇▅▄▃▁    #427 of 469     87%      9
math    ▁▁▃●█▆▄█▄▂▁▁   #353 of 431*    2.8%      1
coding · #427 of 469 · 87% 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                            31.7%  ▁·▁▁▃●▆▅█▃▁▁ beats 16/99  easy · avg 76%       46%  sharp · at its level · several runs
HumanEval+                           27.4%  ▁·▁▁▁●▄▄▄█▃▁ beats 16/99  easy · avg 70%       17%  sharp · at its level
MBPP                                 42.4%  █·▅▃▃▃●▃▃▅·▅ beats 9/15   easy · avg 81%      7.1%  at its level · several runs
HumanEvalSynthesize (HumanEvalPac…   31.7%  ▁·▂▁▂●▅█▄▄▁▂ beats 9/35   medium · avg 62%    4.9%  at its level
CRUXEval-I                           32.1%  ▃▅●▃▃▅·▃▃▅·▅ beats 5/15   medium · avg 56%    3.0%  at its level · several runs
DS-1000 (maker)                      25.0%  ▄▄·▄█●▄█·█·▄ beats 6/12   medium · avg 49%    2.9%  typical
HumanEvalExplain (HumanEvalPack, …   13.1%  ▄●█▃▄▇▄▁▇▃·▁ beats 5/35   medium · avg 46%    2.5%  typical
CRUXEval-O                           34.0%  ▃·▃█●▅▃·▃▃▅▃ beats 6/15   medium · avg 54%    2.5%  blunt · at its level · several runs
HumanEvalFix (HumanEvalPack, 6-la…   11.0%  ▁·▁▁▄●█▄█▁▅▅ beats 8/35   medium · avg 51%    2.0%  sharp
math · #353 of 431 · 2.8% of its score Beats [GPT-3.5 Turbo (0125)](gpt-3-5-turbo-0125.md), [DBRX Instruct](dbrx-instruct.md), [Phi-3 Medium 128K Instruct](phi-3-medium-128k-instruct.md) here, though they rank higher overall. Trails [OPT-2.7B](opt-2-7b.md), [Gemma 2B (base)](gemma-2b-base.md), [Stable Code 3B](stable-code-3b.md) here, though they rank lower overall.
test           result  vs the others in its run  difficulty      counts  why
GSM8K (maker)   27.7%  ▄▄▄·▄●·██·█▄ beats 5/12   easy · avg 75%    2.8%  sharp · at its level
other tests (2)
test                             result  vs the others in its run  difficulty        counts  why
EvoEval (overall)                 20.2%  ▂▂●▄▄█▁▄▅▃▁▃ beats 4/42   medium · avg 52%    6.6%  typical
BigCodeBench (Complete) (maker)   21.4%  ●▁▁▄▂▅▇█▆▂▂▂ beats 1/58   medium · avg 48%    3.0%  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   41% ▇▇▇▇▇
Top Leaderboard Ranking = Top Coding Pr…        2   20% ▇▇
StarCoder 2 and The Stack v2: The Next …        6   20% ▇▇
Granite Code Models: A Family of Open F…        6   17% ▇▇
BigCodeBench paper (submitted / maker-r…        1    3% ▇
prior: pull toward the middle                        0% ▇
weighted average                                   = 35.1
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 3B (Q4_K_M, needs ~1.8 GB, from [huggingface.co/second-state](https://huggingface.co/second-state/StarCoder2-3B-GGUF/tree/7fca3e2da2ce31df411461e2cb9cae2d2b492f35)) ```sh llama cli -hf second-state/StarCoder2-3B-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-3B-GGUF:Q4_K_M ``` Other versions: Q8_0 (~3.2 GB) `llama cli -hf second-state/StarCoder2-3B-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 3B (Q4_K_M, needs ~1.8 GB, from [huggingface.co/second-state](https://huggingface.co/second-state/StarCoder2-3B-GGUF/tree/7fca3e2da2ce31df411461e2cb9cae2d2b492f35)) ```sh lms get https://huggingface.co/second-state/StarCoder2-3B-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 (~3.2 GB) `lms get https://huggingface.co/second-state/StarCoder2-3B-GGUF@Q8_0 -y` · 4bit (~1.9 GB, Mac only) `lms get https://huggingface.co/mlx-community/starcoder2-3b-4bit -y` · 8bit (~3.4 GB, Mac only) `lms get https://huggingface.co/OmAr-Kader-DeV/starcoder2-3b-mlx-8Bit -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 3B (Q4_K_M, needs ~1.8 GB, from [ollama.com](https://ollama.com/library/starcoder2/tags)) ```sh ollama run starcoder2:3b-q4_K_M ``` Other versions: Q8_0 (~3.2 GB) `ollama run starcoder2:3b-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 3B (4bit, needs ~1.9 GB, Mac only, from [huggingface.co/mlx-community](https://huggingface.co/mlx-community/starcoder2-3b-4bit/tree/d90b61f0a26e018c1505ea6ed0fdfeca4e649789)) ```sh mlx_lm.chat --model mlx-community/starcoder2-3b-4bit ``` 3. Or start an OpenAI-compatible server at http://localhost:8080/v1 ```sh mlx_lm.server --model mlx-community/starcoder2-3b-4bit ``` Other versions: 8bit (~3.4 GB, Mac only) `mlx_lm.chat --model OmAr-Kader-DeV/starcoder2-3b-mlx-8Bit` Model repository and documentation: [huggingface.co/bigcode](https://huggingface.co/bigcode/starcoder2-3b) [interactive version](https://whatmodel.sh/model/starcoder2-3b) · [JSON](https://whatmodel.sh/api?format=json&all=1)