[whatmodel.sh](../../README.md) / Granite 20B Code Instruct (8K) # Granite 20B Code Instruct (8K) IBM · released 2024-04 · 20.07B params · apache-2.0 **score 45.4** ±1.2 · #465 of 732 · from 7 benchmark results across 3 sources Score within the [LMArena (text)](https://whatmodel.sh/?set=lmarena-text&score=set) comparison set only. ## What it's good at ● marks Granite 20B Code Instruct (8K) among every model on that task or test, worst to best.
task    vs the others         rank  counts  tests
coding  ▁▁▁▃▅●█▇▅▄▃▁   #337 of 469     61%      3
coding · #337 of 469 · 61% of its score Beats [Qwen3-VL 8B Instruct](qwen3-vl-8b-instruct.md), [Qwen3-VL 4B Instruct](qwen3-vl-4b-instruct.md), [LFM2.5 2.6B](lfm2-5-2-6b.md) here, though they rank higher overall. Trails [Phi-3-mini-128k-instruct (Apr 2024)](phi-3-mini-128k-instruct.md), [DeepSeek LLM 67B Chat](deepseek-llm-67b-chat.md), [WizardLM 70B V1.0](wizardlm-70b-v1-0.md) here, though they rank lower overall.
test                                result  vs the others in its run  difficulty        counts  why
HumanEvalSynthesize (HumanEvalPac…   50.5%  ▁·▂▁▂▆▅█▄●▁▂ beats 30/35  medium · avg 62%     26%  at its level
HumanEvalExplain (HumanEvalPack, …   38.2%  ▄▇█▃▄▇▄▁●▃·▁ beats 29/35  medium · avg 46%     18%  at its level
HumanEvalFix (HumanEvalPack, 6-la…   41.1%  ▁·▁▁▄██▄█▁●▅ beats 30/35  medium · avg 51%     18%  sharp · at its level
other tests (4)
test                                result  vs the others in its run   difficulty        counts  why
BigCodeBench (Complete)              42.1%  ▂▁▁▄▂▅▇●▆▂▂▂ beats 32/58   medium · avg 48%     17%  at its level
BigCodeBench (Instruct)              33.7%  ▃▂·▆▆●█▆▅▃▃▃ beats 14/33   medium · avg 39%     17%  at its level
EuroEval HellaSwag (English), tes…   33.1%  ▃·▁▁●▁▂▅█▇▄▁ beats 16/100  medium · avg 67%    2.9%  sharp · at its level · noisy
EuroEval Life in the UK (English …   45.4%  ▁▁▁▁▁▁●▂▄█▄▃ beats 17/146  easy · avg 82%      2.2%  at its level · noisy
## 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
Granite Code Models: A Family of Open F…        3   61% ▇▇▇▇▇▇▇
BigCodeBench paper                              2   33% ▇▇▇▇
EuroEval leaderboards                           2    5% ▇
prior: pull toward the middle                        1% ▇
weighted average                                   = 45.4
Licences: 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/)) · EuroEval leaderboards ([MIT](https://github.com/EuroEval/leaderboards/blob/1a77f1d2f8ba1ba05ab73287fb090d76bf41b2e0/LICENSE)) ## 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 Granite 20B Code Instruct (8K) (Q4_K_M, needs ~12.82 GB, from [huggingface.co/ibm-granite](https://huggingface.co/ibm-granite/granite-20b-code-instruct-8k-GGUF/tree/6e9f892709473675166a5f71d9c07e14d65d67ca)) ```sh llama cli -hf ibm-granite/granite-20b-code-instruct-8k-GGUF:Q4_K_M ``` 3. Or start a local server and open the address it prints (http://localhost:9931) ```sh llama serve -hf ibm-granite/granite-20b-code-instruct-8k-GGUF:Q4_K_M ``` ### 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 Granite 20B Code Instruct (8K) (Q4_K_M, needs ~12.82 GB, from [huggingface.co/ibm-granite](https://huggingface.co/ibm-granite/granite-20b-code-instruct-8k-GGUF/tree/6e9f892709473675166a5f71d9c07e14d65d67ca)) ```sh lms get https://huggingface.co/ibm-granite/granite-20b-code-instruct-8k-GGUF@Q4_K_M -y ``` 3. Then run lms ls to see its name, and lms chat followed by that name ### Ollama 1. Install Ollama. [Download it (macOS / Windows)](https://ollama.com/download) ```sh # Linux curl -fsSL https://ollama.com/install.sh | sh ``` 2. Run Granite 20B Code Instruct (8K) (Q4_0, needs ~12 GB, from [ollama.com](https://ollama.com/library/granite-code/tags)) ```sh ollama run granite-code:20b ``` Other versions: Q4_0 (~12 GB) `ollama run granite-code:20b` Model repository and documentation: [huggingface.co/ibm-granite](https://huggingface.co/ibm-granite/granite-20b-code-instruct-8k) [interactive version](https://whatmodel.sh/model/granite-20b-code-instruct-8k) · [JSON](https://whatmodel.sh/api?format=json&all=1)