whatmodel.sh / Code Llama 7B (base)
Code Llama 7B (base)
↗ share
+ contribute
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).
Score within the LMArena (text) comparison set only.
$ how it compares
The LLMs ranked either side of Code Llama 7B (base), out of 897 with a score, then more from Meta.
| # | model | score | where | ||
|---|---|---|---|---|---|
| 746 | 36±2 | comparison only | |||
| 747 | 36±1 | local | |||
| 748 | 36±1 | local | |||
| 749 | 36±1 | local | |||
| 750 | 35±1 | local | |||
| more from Meta | |||||
| 10 | 81±1 | Muse Code only | |||
| 20 | 78±1 | api $8.00/M | |||
| 31 | 76±1 | api $0.20/M | |||
$ what it's good at
coding▁▁▁▃▆▇█▆▆▃▃▁ #424 of 474 · 79% 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.
| test | result | vs the others in its run | counts |
|---|---|---|---|
| HumanEval +3 | 37.8% ✎ | ▁·▁▁▃▄▆▅█▃▁▁ beats 22/99 | 35% |
| HumanEval+ | 35.4% ✎ | ▁·▁▁▁▃▄▄▄█▃▁ beats 23/99 | 14% |
| MBPP +3 | 39.0% ✎ | █·▅▃▃▃▅▃▃▅·▅ beats 7/15 | 10% |
| HumanEvalSynthesize (HumanEvalPack, 6-language average) | 31.2% ✎ | ▁·▂▁▂▆▅█▄▄▁▂ beats 8/35 | 4.0% |
| MBPP+ | 46.8% ✎ | ▁···▁▁▂▅▇█▆▂ beats 16/75 | 3.2% |
| CRUXEval-I lab +1 | 35.9% ✎ | ▁··▁▅▃█▇▁··▁ beats 6/22 | 2.7% |
| CRUXEval-O lab +1 | 34.2% ✎ | ▁·▂▃▁█▁▂···▁ beats 6/22 | 2.4% |
| DS-1000 | 21.5% ✎ | ▄▄·▄██▄█·█·▄ beats 3/12 | 2.3% |
3 more tests
| test | result | vs the others in its run | counts |
|---|---|---|---|
| HumanEvalExplain (HumanEvalPack, 6-language average) | 13.9% ✎ | ▄▇█▃▄▇▄▁▇▃·▁ beats 7/35 | 2.1% |
| Tulu 2: CodexEval pass@10 | 58.7% ✎ | ▃▃▃·▆▃▃█▃▂▂▅ beats 10/25 | 1.9% |
| HumanEvalFix (HumanEvalPack, 6-language average) | 14.2% ✎ | ▁·▁▁▄██▄█▁▅▅ beats 13/35 | 1.7% |
math▁▁▃▅█▆▅█▄▁▁▁ #371 of 440 · 8.6% of its score · 2 tests
Beats GPT-3.5 Turbo (0125), DBRX Instruct, Command R Plus (04-2024) here, though they rank higher overall. Trails OPT-1.3B, OPT-2.7B, Gemma 2B (base) here, though they rank lower overall.
other tests11 not in a task · 12% of its score
| test | result | vs the others in its run | counts |
|---|---|---|---|
| BIG-Bench Hard | 43.4% ✎ | ▁·····▂█▂▅·▁ beats 4/25 | 3.0% |
| BigCodeBench (Complete) | 28.7% ✎ | ▂▁▁▄▂▅▇█▆▂▂▂ beats 8/58 | 2.5% |
| MMLU +1 | 33.8% ✎ | ▃▁▃▃▄█▄▁█··▁ beats 0/25 | 2.5% |
| ARC Challenge | 34.5% ✎ | ▄▁▁▂▁▄█▇▃▂▃▂ beats 35/140 | 1.2% |
| WinoGrande | 62.3% ✎ | ▁▁▁▁▂▁▁▅▇█▃▁ beats 45/131 | 0.7% |
| Natural Questions (closed book) | 11.0% ✎ | ▂▁▁▁▂▄▄▃▅█▅▁ beats 28/68 | 0.6% |
| HellaSwag | 62.9% ✎ | ▁▁▁▂▂▂▄▆█▇▄▂ beats 49/135 | 0.5% |
| TriviaQA | 34.9% ✎ | ▁▁▂▂▄▄▃▆▅█▅▂ beats 31/80 | 0.4% |
$ where to run it
Memory is what a version takes in GPU memory (or a Mac's unified memory) with an 8k-token conversation. With less, it runs partly from system RAM, more slowly. Enter your machine to see what runs at full speed.
llama.cpp · recommended
version
- 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 | shWindowsirm https://llama.app/install.ps1 | iex - Run Code Llama 7B (base) · needs 5.8 GB memory, 4.08 GB download · from huggingface.co/TheBlokechat in the terminal
llama cli -hf TheBloke/CodeLlama-7B-GGUF:Q4_K_M - 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
- Install LM Studio · Open the app once before using the lms command.
- Run Code Llama 7B (base) · needs 5.8 GB memory, 4.08 GB download · from huggingface.co/TheBloke
- Or download it in the terminal
lms get https://huggingface.co/TheBloke/CodeLlama-7B-GGUF@Q4_K_M -y - Then run lms ls to see its name, and lms chat followed by that name
Ollama
version
- Install Ollama
download it (macOS / Windows) ↗
Linuxcurl -fsSL https://ollama.com/install.sh | sh - Run Code Llama 7B (base) · needs 5.8 GB memory, 4.08 GB download · from ollama.comchat in the terminal
ollama run codellama:7b-code-q4_K_M
MLX (Mac)
- Install MLX (Mac) · Apple silicon Macs only, text only.with uv
uv tool install mlx-lmorpip install mlx-lm - Run Code Llama 7B (base) · needs 5.5 GB memory, 3.79 GB download, Mac only · from huggingface.co/mlx-communitychat in the terminal
mlx_lm.chat --model mlx-community/CodeLlama-7b-hf-4bit-mlx - Or start an OpenAI-compatible server at http://localhost:8080/v1
mlx_lm.server --model mlx-community/CodeLlama-7b-hf-4bit-mlx
Model repository and documentation: huggingface.co/codellama ↗
$ how the score was worked out · EvalPlus / EvalPerf published… 37%, Granite Code Models: A Family… 15%, StarCoder 2 and The Stack v2:… 15% 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
| source | results | share of the score |
|---|---|---|
| 3 | 37% | |
| 8 | 15% | |
| 4 | 15% | |
| 12 | 11% | |
| 2 | 9% | |
| 5 | 8% | |
| 1 | 2% | |
| 2 | 2% | |
| prior · pull toward the middle | 0% | |
| weighted average | = 35.7 |
$ 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