[whatmodel.sh](../../README.md) / Code Llama 13B Instruct # Code Llama 13B Instruct Meta · released 2023-08 · 13.02B params · llama2 **score 40.2** ±0.7 · #563 of 732 · from 14 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 Code Llama 13B Instruct among every model on that task or test, worst to best.
task    vs the others          rank  counts  tests
coding  ▁▁▁▃●▇█▇▅▄▃▁    #387 of 469     63%      6
math    ▁▁▃●█▆▄█▄▂▁▁   #348 of 431*    3.8%      1
coding · #387 of 469 · 63% of its score Beats [LFM2.5 8B-A1B](lfm2-5-8b-a1b.md), [DeepSeek R1 Distill Qwen 7B](deepseek-r1-distill-qwen-7b.md), [Tulu 2 70B](tulu-2-70b.md) here, though they rank higher overall. Trails [Qwen2.5 1.5B Instruct](qwen2-5-1-5b.md), [WizardLM 13B V1.2](wizardlm-13b-v1-2.md), [Falcon3 3B Instruct](falcon3-3b.md) here, though they rank lower overall.
test                                result  vs the others in its run  difficulty        counts  why
HumanEval                            48.8%  ▁█▄▅▇●·▄▇▅▄▄ beats 19/42  easy · avg 75%       36%  sharp · at its level · several runs
HumanEvalSynthesize (HumanEvalPac…   39.4%  ▁·▂▁▂▆▅●▄▄▁▂ beats 17/35  medium · avg 62%    8.4%  at its level
MBPP (maker)                         49.4%  ▃▃▃●··▃▅··▅▃ beats 5/11   easy · avg 71%      6.1%  at its level
HumanEvalExplain (HumanEvalPack, …   27.7%  ▄▇█▃▄●▄▁▇▃·▁ beats 23/35  medium · avg 46%    4.9%  typical
HumanEvalFix (HumanEvalPack, 6-la…   15.8%  ▁·▁▁▄█●▄█▁▅▅ beats 15/35  medium · avg 51%    4.5%  sharp
Tulu 2: CodexEval pass@10            69.2%  ▃▃▃·▆▃▃●▃▂▂▅ beats 17/25  easy · avg 83%      3.4%  sharp · at its level
math · #348 of 431 · 3.8% of its score Beats [Athene-70B](athene-70b.md), [Gemma 2 9B IT](gemma-2-9b.md), [GPT-3.5 Turbo (0125)](gpt-3-5-turbo-0125.md) here, though they rank higher overall. Trails [Gemma 2B (base)](gemma-2b-base.md), [Stable Code 3B](stable-code-3b.md), [Zephyr 7B beta](zephyr-7b-beta.md) here, though they rank lower overall.
test   result  vs the others in its run  difficulty      counts  why
GSM8K   23.0%  ▆▂●█▅▅▃▆···▂ beats 6/25   easy · avg 72%    3.8%  sharp · at its level
other tests (6)
test                                result  vs the others in its run  difficulty        counts  why
EvoEval (overall)                    33.8%  ▂▂▃▄▄●▁▄▅▃▁▃ beats 23/42  medium · avg 52%     12%  at its level
BIG-Bench Hard                       48.0%  ▁·····▂●▂▅·▁ beats 7/25   easy · avg 74%      6.9%  sharp · at its level
BigCodeBench (Complete)              29.7%  ▂▁▁●▂▅▇█▆▂▂▂ beats 11/58  medium · avg 48%    5.1%  at its level
BigCodeBench (Instruct)              28.2%  ▃▂·●▆██▆▅▃▃▃ beats 4/33   medium · avg 39%    4.8%  at its level
MMLU                                 43.3%  ▁▁▃●▄█▄▁█··▁ beats 4/25   medium · avg 73%    3.1%  at its level
Tulu 2: TyDiQA gold passage, 1-sh…   37.8%  ▂··▁●▂▂▂█▅▁▂ beats 4/25   medium · avg 59%    0.8%  blunt · 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
Top Leaderboard Ranking = Top Coding Pr…        2   35% ▇▇▇▇
Code Llama: Open Foundation Models for …        2   19% ▇▇
Tulu 2                                          5   18% ▇▇
Granite Code Models: A Family of Open F…        3   18% ▇▇
BigCodeBench paper                              2   10% ▇
prior: pull toward the middle                        0% ▇
weighted average                                   = 40.2
Licences: Top Leaderboard Ranking = Top Coding Proficiency ([CC BY 4.0](../../licenses/paper-2403.19114v1-CC-BY-4.0.txt)) · Code Llama: Open Foundation Models for Code ([CC BY 4.0](../../licenses/paper-2308.12950v3-CC-BY-4.0.txt)) · Tulu 2 ([CC BY 4.0](../../licenses/CC-BY-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 Code Llama 13B Instruct (Q4_K_M, needs ~7.9 GB, from [huggingface.co/TheBloke](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/tree/82f1dd9567b9b20b7e8f8aa9ecf3d2f121e5d415)) ```sh llama cli -hf TheBloke/CodeLlama-13B-Instruct-GGUF:Q4_K_M ``` 3. Or start a local server and open the address it prints (http://localhost:9931) ```sh llama serve -hf TheBloke/CodeLlama-13B-Instruct-GGUF:Q4_K_M ``` Other versions: Q8_0 (~13.8 GB) `llama cli -hf TheBloke/CodeLlama-13B-Instruct-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 Code Llama 13B Instruct (Q4_K_M, needs ~7.9 GB, from [huggingface.co/TheBloke](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/tree/82f1dd9567b9b20b7e8f8aa9ecf3d2f121e5d415)) ```sh lms get https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-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 (~13.8 GB) `lms get https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF@Q8_0 -y` · 8bit (~13.8 GB, Mac only) `lms get https://huggingface.co/mlx-community/CodeLlama-13b-Instruct-hf-8bit-mlx -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 Code Llama 13B Instruct (Q4_K_M, needs ~7.9 GB, from [ollama.com](https://ollama.com/library/codellama/tags)) ```sh ollama run codellama:13b-instruct-q4_K_M ``` Other versions: Q8_0 (~14 GB) `ollama run codellama:13b-instruct-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 Code Llama 13B Instruct (8bit, needs ~13.8 GB, Mac only, from [huggingface.co/mlx-community](https://huggingface.co/mlx-community/CodeLlama-13b-Instruct-hf-8bit-mlx/tree/e87538682c2189e6cd58adfe7a975db7a3438ca5)) ```sh mlx_lm.chat --model mlx-community/CodeLlama-13b-Instruct-hf-8bit-mlx ``` 3. Or start an OpenAI-compatible server at http://localhost:8080/v1 ```sh mlx_lm.server --model mlx-community/CodeLlama-13b-Instruct-hf-8bit-mlx ``` Model repository and documentation: [huggingface.co/codellama](https://huggingface.co/codellama/CodeLlama-13b-Instruct-hf) [interactive version](https://whatmodel.sh/model/codellama-13b-instruct) · [JSON](https://whatmodel.sh/api?format=json&all=1)