whatmodel.sh / Code Llama 7B (base)

Code Llama 7B (base) is an open-weights language model from Meta, released August 2023. Its published size is 6.74B parameters and a 16k-token context window. Licence: llama2.

Catalogue identity notes

Maker repo codellama/CodeLlama-7b-hf @6c284d1: licence tag llama2. 6,738,546,688 parameters from the Hugging Face safetensors metadata (dense, so active = total). Released 2023-08: month the maker's Hugging Face repo was created (createdAt 2023-08-24). Pretrained Code Llama; not the Python or Instruct variant. Ollama tags codellama:7b-code-q4_K_M, codellama:7b-code-q8_0 (sizes as listed on the tags page, observed 2026-09-29).

33.9±0.5#609 of 719 LLMsfrom 37 benchmark results across 8 sources

$ how it compares

The LLMs ranked either side of Code Llama 7B (base), out of 828 with a score, then more from Meta.

#modelscorewhereRAMreleased
702Granite 3.1 3B-A800M Instruct IBM35±2local~3.6GB2024-12
703Llama 2 13B (base) Meta34±1local~9.3GB2023-07
704Code Llama 7B (base) Meta34±1local~5.5GB2023-08
705Nous-Hermes-13b Nous Research34±2local~9.8GB2023-06
706ChatGLM3 6B 128K Zhipu AI (THUDM)34±4local~5.8GB2024-01
more from Meta
24Muse Spark 1.3 Meta77±1api $2.00/M2026-09
40Muse Spark 1.2 Meta75±1api $2.00/M2026-08
43Muse Spark 1.1 Meta75±1api $2.00/M2026-07

see all LLMs · find the ones that fit your machine

$ what it's good at

coding▁▁▁▃▆██▇▆▄▃▁ #410 of 458 · 80% of its score · 11 tests

Beats DeepSeek R1 Distill Qwen 7B, Qwen3.5 2B, DeepSeek R1 Distill Llama 8B here, though they rank higher overall. Trails Llama 3.2 1B Instruct, SmolLM2 1.7B Instruct here, though they rank lower overall.

testresultvs the others in its rundifficultycountswhy
HumanEval +337.8% ✎▁·▁▁▃▄▆▅█▃▁▁ beats 22/99easy · avg 79%▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 36%sharp · at its level · several runs
HumanEval+35.4% ✎▁·▁▁▁▃▄▄▄█▃▁ beats 23/99easy · avg 74%▇▇▇▇▇▇ 14%sharp · at its level
MBPP +339.0% ✎█·▅▃▃▃▅▃▃▅·▅ beats 7/15easy · avg 82%▇▇▇▇ 9.4%at its level · several runs
HumanEvalSynthesize (HumanEvalPack, 6-language average)31.2% ✎▁·▂▁▂▆▅█▄▄▁▂ beats 8/35medium · avg 64%▇▇ 3.9%at its level
MBPP+46.8% ✎▁···▁▁▂▅▇█▆▂ beats 16/75easy · avg 68%▇ 3.0%at its level
CRUXEval-I lab +135.9% ✎▁··▁▅▃█▇▁··▁ beats 6/22medium · avg 59%▇ 2.7%at its level · several runs
DS-100021.5% ✎▄▄·▄██▄█·█·▄ beats 3/12medium · avg 52%▇ 2.3%typical
CRUXEval-O lab +134.2% ✎▁·▂▃▁█▁▂···▁ beats 6/22medium · avg 55%▇ 2.3%blunt · at its level · several runs
3 more tests
testresultvs the others in its rundifficultycountswhy
HumanEvalExplain (HumanEvalPack, 6-language average)13.9% ✎▄▇█▃▄▇▄▁▇▃·▁ beats 7/35medium · avg 49%▇ 2.1%typical
Tulu 2: CodexEval pass@1058.7% ✎▃▃▃·▆▃▃█▃▂▂▅ beats 10/25very easy · avg 86%▇ 2.0%sharp · at its level
HumanEvalFix (HumanEvalPack, 6-language average)14.2% ✎▁·▁▁▄██▄█▁▅▅ beats 13/35medium · avg 56%▇ 1.7%sharp
math▁▃▃▅▆▅▄█▄▁▁▁ #391 of 398 · 6.6% of its score · 2 tests

Trails Qwen2 0.5B Instruct, Granite 3.0 1B-A400M Instruct, Granite 3.1 1B-A400M Instruct here, though they rank lower overall.

testresultvs the others in its rundifficultycountswhy
GSM8K +312.0% ✎▆▂▅█▅▅▃▆···▂ beats 1/25easy · avg 75%▇▇ 4.7%sharp · at its level · several runs
MATH +14.1% ✎▃·▃····▃···█ beats 1/5hard · avg 30%▇ 1.9%several runs
other tests11 not in a task · 13% of its score
testresultvs the others in its rundifficultycountswhy
BIG-Bench Hard43.4% ✎▁·····▂█▂▅·▁ beats 4/25easy · avg 77%▇ 3.0%sharp
BigCodeBench (Complete)28.7% ✎▂▁▁▄▂▅▇█▆▂▂▂ beats 8/58medium · avg 50%▇ 2.3%at its level
MMLU +133.8% ✎▃▁▃▃▄█▄▁█··▁ beats 0/25easy · avg 74%▇ 2.1%at its level · several runs
ARC Challenge34.5% ✎▆▁▁▂▂▅▇█▄▃▃▂ beats 29/97easy · avg 80%▇ 1.5%sharp · at its level
WinoGrande62.3% ✎▁···▂▁▁▅█▇▃▁ beats 30/87easy · avg 87%▇ 0.9%at its level
Natural Questions (closed book)11.0% ✎▁·▁·▁▂▁▂▃▄▃█ beats 10/33medium · avg 57%▇ 0.9%typical
HellaSwag62.9% ✎▁▁▁▁▂▂▃▇█▆▅▃ beats 27/85very easy · avg 90%▇ 0.6%at its level
TriviaQA34.9% ✎▁·▁▁▄▁▂▂▅▁▂█ beats 16/38easy · avg 85%▇ 0.5%at its level · noisy
3 more tests
testresultvs the others in its rundifficultycountswhy
ARC Easy59.4% ✎▁▂▃▂▃▅▇█▇▆▄▆ beats 20/65easy · avg 88%▇ 0.4%at its level
Tulu 2: TyDiQA gold passage, 1-shot F147.6% ✎▂··▁▃▂▂▃█▅▁▂ beats 11/25medium · avg 61%▇ 0.4%blunt · at its level
PIQA72.8% ✎▁▁▁▃▃▄▇█▄▃▁▁ beats 24/83easy · avg 87%▇ 0.3%blunt · at its level

$ where to run it

llama.cpp · recommended

version

  1. Install llama.cpp · Homebrew and winget installs name the commands llama-cli and llama-server instead.
    macOS / Linux
    curl -LsSf https://llama.app/install.sh | sh
    Windows
    irm https://llama.app/install.ps1 | iex

    other ways to install ↗

  2. Run Code Llama 7B (base) · needs ~4.1 GB · from huggingface.co/TheBloke
    chat in the terminal
    llama cli -hf TheBloke/CodeLlama-7B-GGUF:Q4_K_M
  3. Or start a local server and open the address it prints (http://localhost:9931)
    llama serve -hf TheBloke/CodeLlama-7B-GGUF:Q4_K_M

LM Studio

version

  1. Install LM Studio · Open the app once before using the lms command.

    download it (macOS / Windows / Linux) ↗

  2. Run Code Llama 7B (base) · needs ~4.1 GB · from huggingface.co/TheBloke

    open in LM Studio ↗

  3. Or download it in the terminal
    lms get https://huggingface.co/TheBloke/CodeLlama-7B-GGUF@Q4_K_M -y
  4. Then run lms ls to see its name, and lms chat followed by that name

Ollama

version

  1. Install Ollama

    download it (macOS / Windows) ↗

    Linux
    curl -fsSL https://ollama.com/install.sh | sh
  2. Run Code Llama 7B (base) · needs ~4.1 GB · from ollama.com
    chat in the terminal
    ollama run codellama:7b-code-q4_K_M

MLX (Mac)

  1. Install MLX (Mac) · Apple silicon Macs only, text only.
    with uv
    uv tool install mlx-lm
    or
    pip install mlx-lm
  2. Run Code Llama 7B (base) · needs ~3.8 GB, Mac only · from huggingface.co/mlx-community
    chat in the terminal
    mlx_lm.chat --model mlx-community/CodeLlama-7b-hf-4bit-mlx
  3. Or start an OpenAI-compatible server at http://localhost:8080/v1
    mlx_lm.server --model mlx-community/CodeLlama-7b-hf-4bit-mlx

Weights and documentation: huggingface.co/codellama ↗

$ how the score was worked out · EvalPlus / EvalPerf published… 39%, Granite Code Models: A Family… 15%, StarCoder 2 and The Stack v2:… 14% and 5 more

Each result implies a score on its own, after adjusting for how hard its test is and who ran it. The 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's added up by who ran the tests. How it works

$ improve this page

Use a short GitHub form or edit the data through a pull request. Every number needs a source; here's which ones we can use.

data updated · sources and licences · json