[whatmodel.sh](../../README.md) / Code Llama 13B (base) # Code Llama 13B (base) Meta · released 2023-08 · 13.02B params · llama2 **score 38.4** ±0.5 · #588 of 732 · from 23 benchmark results across 7 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 (base) among every model on that task or test, worst to best.
task    vs the others          rank  counts  tests
coding  ▁▁▁▃●▇█▇▅▄▃▁    #408 of 469     87%     11
math    ▁▁▃▅●▆▄█▄▂▁▁   #326 of 431*    4.7%      1
coding · #408 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 [EXAONE 3.5 2.4B Instruct](exaone-3-5-2-4b.md), [Code Llama 7B Instruct](codellama-7b-instruct.md), [Qwen2.5 1.5B Instruct](qwen2-5-1-5b.md) here, though they rank lower overall.
test                                result  vs the others in its run  difficulty        counts  why
HumanEval                            42.7%  ▁·▁▁▃●▆▅█▃▁▁ beats 25/99  easy · avg 76%       37%  sharp · at its level · several runs
HumanEval+                           38.4%  ▁·▁▁▁▃●▄▄█▃▁ beats 28/99  easy · avg 70%       16%  sharp · at its level
MBPP                                 30.6%  ●·▅▃▃▃▅▃▃▅·▅ beats 2/15   easy · avg 71%       10%  at its level · several runs
HumanEvalSynthesize (HumanEvalPac…   37.8%  ▁·▂▁▂▆●█▄▄▁▂ beats 15/35  medium · avg 62%    4.6%  at its level
MBPP+                                52.6%  ▁···▁▁▂▅●█▆▂ beats 23/75  easy · avg 66%      3.4%  at its level
CRUXEval-I (maker)                   42.5%  ▁··▁▅▂●▇▁··▁ beats 14/22  medium · avg 56%    3.0%  at its level · several runs
DS-1000                              25.1%  ▄▄·▄██●█·█·▄ beats 7/12   medium · avg 49%    2.7%  at its level
CRUXEval-O (maker)                   39.7%  ▁·▂▃▁●▁▂···▁ beats 9/22   medium · avg 54%    2.6%  blunt · at its level · several runs
HumanEvalExplain (HumanEvalPack, …   15.0%  ▄▇●▃▄▇▄▁▇▃·▁ beats 10/35  medium · avg 46%    2.6%  typical
HumanEvalFix (HumanEvalPack, 6-la…    9.5%  ▁·▁▁●██▄█▁▅▅ beats 5/35   medium · avg 51%    2.3%  sharp
Tulu 2: CodexEval pass@10            69.8%  ▃▃▃·▆▃▃●▃▂▂▅ beats 18/25  easy · avg 83%      2.0%  sharp · at its level
math · #326 of 431 · 4.7% 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. Trails [Stable Code 3B](stable-code-3b.md), [Qwen3 0.6B](qwen3-0-6b.md), [StarCoder2 7B](starcoder2-7b.md) here, though they rank lower overall.
test   result  vs the others in its run  difficulty      counts  why
GSM8K   22.0%  ▆▂●█▅▅▃▆···▂ beats 5/25   easy · avg 75%    4.7%  sharp · at its level · several runs
other tests (4)
test                                result  vs the others in its run  difficulty        counts  why
BIG-Bench Hard                       49.5%  ▁·····▂●▂▅·▁ beats 13/25  easy · avg 74%      3.7%  sharp · at its level
BigCodeBench (Complete)              32.0%  ▂▁▁▄●▅▇█▆▂▂▂ beats 13/58  medium · avg 48%    2.8%  at its level
MMLU                                 37.5%  ▁●▃▃▄█▄▁█··▁ beats 1/25   medium · avg 73%    1.7%  at its level
Tulu 2: TyDiQA gold passage, 1-sh…   52.1%  ▂··▁▃▂▂▂●▅▁▂ beats 15/25  medium · avg 59%    0.4%  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
EvalPlus / EvalPerf published evaluatio…        3   42% ▇▇▇▇▇
StarCoder 2 and The Stack v2: The Next …        4   17% ▇▇
Granite Code Models: A Family of Open F…        6   16% ▇▇
Code Llama: Open Foundation Models for …        2   10% ▇
Tulu 2                                          5   10% ▇
BigCodeBench paper                              1    3% ▇
CRUXEval published evaluation results (…        2    2% ▇
prior: pull toward the middle                        0% ▇
weighted average                                   = 38.4
Licences: EvalPlus / EvalPerf published evaluation runs ([Apache-2.0](../../licenses/evalplus-published-runs-Apache-2.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)) · 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)) · BigCodeBench paper ([CC BY 4.0](http://creativecommons.org/licenses/by/4.0/)) · CRUXEval published evaluation results ([MIT](../../licenses/cruxeval-published-results-MIT.txt)) ## 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 (base) (Q4_K_M, needs ~7.9 GB, from [huggingface.co/TheBloke](https://huggingface.co/TheBloke/CodeLlama-13B-GGUF/tree/dc64dd5ad4c82364e7b0fe119d544b131dfdb8bc)) ```sh llama cli -hf TheBloke/CodeLlama-13B-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-GGUF:Q4_K_M ``` Other versions: Q8_0 (~13.8 GB) `llama cli -hf TheBloke/CodeLlama-13B-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 (base) (Q4_K_M, needs ~7.9 GB, from [huggingface.co/TheBloke](https://huggingface.co/TheBloke/CodeLlama-13B-GGUF/tree/dc64dd5ad4c82364e7b0fe119d544b131dfdb8bc)) ```sh lms get https://huggingface.co/TheBloke/CodeLlama-13B-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-GGUF@Q8_0 -y` · 4bit (~7.3 GB, Mac only) `lms get https://huggingface.co/mlx-community/CodeLlama-13b-hf-4bit-mlx -y` · 8bit (~13.8 GB, Mac only) `lms get https://huggingface.co/mlx-community/CodeLlama-13b-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 (base) (Q4_K_M, needs ~7.9 GB, from [ollama.com](https://ollama.com/library/codellama/tags)) ```sh ollama run codellama:13b-code-q4_K_M ``` Other versions: Q8_0 (~14 GB) `ollama run codellama:13b-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 Code Llama 13B (base) (4bit, needs ~7.3 GB, Mac only, from [huggingface.co/mlx-community](https://huggingface.co/mlx-community/CodeLlama-13b-hf-4bit-mlx/tree/c788ee3719beb0c8315340bd312e02fa563bca06)) ```sh mlx_lm.chat --model mlx-community/CodeLlama-13b-hf-4bit-mlx ``` 3. Or start an OpenAI-compatible server at http://localhost:8080/v1 ```sh mlx_lm.server --model mlx-community/CodeLlama-13b-hf-4bit-mlx ``` Other versions: 8bit (~13.8 GB, Mac only) `mlx_lm.chat --model mlx-community/CodeLlama-13b-hf-8bit-mlx` Model repository and documentation: [huggingface.co/codellama](https://huggingface.co/codellama/CodeLlama-13b-hf) [interactive version](https://whatmodel.sh/model/codellama-13b) · [JSON](https://whatmodel.sh/api?format=json&all=1)