[whatmodel.sh](../../README.md) / CodeGemma 2B (v1.0) # CodeGemma 2B (v1.0) Google · released 2024-03 · 2.51B params · gemma **score 33.6** ±0.7 · #638 of 732 · from 12 benchmark results across 4 sources Score within the [LMArena (text)](https://whatmodel.sh/?set=lmarena-text&score=set) comparison set only. ## What it's good at ● marks CodeGemma 2B (v1.0) among every model on that task or test, worst to best.
task    vs the others         rank  counts  tests
coding  ▁▁▁●▅▇█▇▅▄▃▁   #441 of 469     95%      9
coding · #441 of 469 · 95% of its score Beats [Qwen3.5 2B](qwen3-5-2b.md), [Molmo 7B-D (0924)](molmo-7b-d.md), [Tulu 2 7B](tulu-2-7b.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) here, though they rank lower overall.
test                                result  vs the others in its run  difficulty        counts  why
HumanEval                            26.8%  ▁·▁▁●▄▆▅█▃▁▁ beats 10/99  easy · avg 76%       39%  sharp · at its level · several runs
HumanEval+                           20.7%  ▁·▁▁▁●▄▄▄█▃▁ beats 9/99   easy · avg 70%       24%  sharp
HumanEvalSynthesize (HumanEvalPac…   30.4%  ▁·▂▁▂●▅█▄▄▁▂ beats 6/35   medium · avg 62%    7.1%  at its level
MBPP                                 30.4%  ●·▅▃▃▃▅▃▃▅·▅ beats 1/15   easy · avg 67%      7.1%  at its level · several runs
MBPP+                                46.6%  ▁···▁▁▂●▇█▆▂ beats 15/75  easy · avg 66%      5.9%  at its level
HumanEvalExplain (HumanEvalPack, …   17.3%  ▄▇█●▄▇▄▁▇▃·▁ beats 14/35  medium · avg 46%    3.4%  typical
CRUXEval-I                           29.6%  ▃●█▃▃▅·▃▃▅·▅ beats 1/15   medium · avg 56%    3.4%  at its level
CRUXEval-O                           32.1%  ▃·▃●█▅▃·▃▃▅▃ beats 3/15   medium · avg 54%    2.8%  blunt · at its level
HumanEvalFix (HumanEvalPack, 6-la…    4.4%  ▁·●▁▄██▄█▁▅▅ beats 1/35   medium · avg 51%    2.7%  sharp
other tests (1)
test                     result  vs the others in its run  difficulty        counts  why
BigCodeBench (Complete)   23.9%  ▂●▁▄▂▅▇█▆▂▂▂ beats 3/58   medium · avg 48%    4.4%  typical
## 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…        3   63% ▇▇▇▇▇▇▇▇
Granite Code Models: A Family of Open F…        6   24% ▇▇▇
CodeGemma: Open Code Models Based on Ge…        2    9% ▇
BigCodeBench paper                              1    4% ▇
prior: pull toward the middle                        0% ▇
weighted average                                   = 33.6
Licences: EvalPlus / EvalPerf published evaluation runs ([Apache-2.0](../../licenses/evalplus-published-runs-Apache-2.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)) · CodeGemma: Open Code Models Based on Gemma ([CC BY 4.0](../../licenses/paper-2406.11409v2-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 CodeGemma 2B (v1.0) (Q4_K_M, needs ~1.6 GB, from [huggingface.co/lmstudio-community](https://huggingface.co/lmstudio-community/codegemma-2b-GGUF/tree/8978e8846f2638de9d7a1d280ec7162d30b137fb)) ```sh llama cli -hf lmstudio-community/codegemma-2b-GGUF:Q4_K_M ``` 3. Or start a local server and open the address it prints (http://localhost:9931) ```sh llama serve -hf lmstudio-community/codegemma-2b-GGUF:Q4_K_M ``` Other versions: Q8_0 (~2.7 GB) `llama cli -hf lmstudio-community/codegemma-2b-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 CodeGemma 2B (v1.0) (Q4_K_M, needs ~1.6 GB, from [huggingface.co/lmstudio-community](https://huggingface.co/lmstudio-community/codegemma-2b-GGUF/tree/8978e8846f2638de9d7a1d280ec7162d30b137fb)) ```sh lms get https://huggingface.co/lmstudio-community/codegemma-2b-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 (~2.7 GB) `lms get https://huggingface.co/lmstudio-community/codegemma-2b-GGUF@Q8_0 -y` · 4bit (~2.2 GB, Mac only) `lms get https://huggingface.co/mlx-community/codegemma-2b-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 CodeGemma 2B (v1.0) (Q4_K_M, needs ~1.6 GB, from [ollama.com](https://ollama.com/library/codegemma/tags)) ```sh ollama run codegemma:2b-code-q4_K_M ``` Other versions: Q8_0 (~2.7 GB) `ollama run codegemma:2b-code-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 CodeGemma 2B (v1.0) (4bit, needs ~2.2 GB, Mac only, from [huggingface.co/mlx-community](https://huggingface.co/mlx-community/codegemma-2b-4bit/tree/a946ef789099ecdfb73ccb59e6f21bb7255f3f6c)) ```sh mlx_lm.chat --model mlx-community/codegemma-2b-4bit ``` 3. Or start an OpenAI-compatible server at http://localhost:8080/v1 ```sh mlx_lm.server --model mlx-community/codegemma-2b-4bit ``` Model repository and documentation: [huggingface.co/google](https://huggingface.co/google/codegemma-2b) [interactive version](https://whatmodel.sh/model/codegemma-2b) · [JSON](https://whatmodel.sh/api?format=json&all=1)