Overview
Code Llama is Meta's family of open-weight large language models specialized for programming, released on August 24, 2023. It is fine-tuned from the Llama 2 foundation models on code-heavy data and originally shipped in three sizes — Code Llama 7B, 13B and 34B — with a larger Code Llama 70B following on January 29, 2024. The models are distributed under the same Llama 2 Community License, free for both research and commercial use.
Each size comes in three flavors: Code Llama (the foundational code model), Code Llama - Python (further trained on ~100B tokens of Python for stronger Python performance), and Code Llama - Instruct (tuned to follow natural-language instructions and produce safer, more helpful responses). The 7B and 13B base and Instruct models were also trained with fill-in-the-middle (FIM) capability, letting them insert code into an existing file for completion tasks rather than only continuing from the end.
Code Llama is text-only and supports many popular languages, including Python, C++, Java, PHP, TypeScript/JavaScript, C# and Bash. All variants were trained on 16K-token sequences and show stable generations on inputs of up to roughly 100K tokens, which made it well suited to working over large files and repositories. At launch it was among the strongest open code models available, and it seeded a large ecosystem of community fine-tunes (such as Phind-CodeLlama and WizardCoder).
| Released | 2023-08-24 |
|---|---|
| License | Llama 2 Community License (custom; free for research and commercial use) |
| Weights | Open weights |
| Parameters | 7B, 13B and 34B (initial release); a 70B variant was added 2024-01-29 |
| Context | Trained on 16K-token sequences; stable generations on inputs up to ~100K tokens |
| Architecture | Auto-regressive, decoder-only transformer (optimized transformer architecture), fine-tuned from the Llama 2 base models on code-heavy data. Base models trained on ~500B tokens of code and code-related data (the later 70B on ~1T). The Code Llama - Python variant adds ~100B tokens of Python. The 7B and 13B base and Instruct models additionally support fill-in-the-middle (FIM) infilling for code completion. |
| Knowledge cutoff | Trained on data between January 2023 and July 2023 |
| Modalities | text |
| Status | Legacy / superseded. The initial 7B, 13B and 34B models shipped 2023-08-24 (70B added 2024-01-29). Meta's official codellama inference-code repository was archived (read-only) on 2025-07-01, and the line has effectively been succeeded by code-capable Llama 3 / 3.1 models. Weights remain downloadable. |
Benchmarks
- HumanEval (pass@1, Code Llama - Python 34B)53.7%
- MBPP (pass@1, Code Llama - Python 34B)56.2%
- HumanEval (pass@1, Code Llama 34B base)48.8%
- MBPP (pass@1, Code Llama 34B base)55%
- MBPP (pass@1, Code Llama - Instruct 34B)57%
- HumanEval (pass@1, Code Llama 7B base)33.5%
- HumanEval (pass@1, Code Llama 13B base)36%
Scores on a 0–100 scale (25-point gridlines); higher is better. Each benchmark links to its published source.
Strengths
- Open weights under a permissive Llama 2 license, free for commercial use and self-hosting
- Fill-in-the-middle (FIM) infilling on the 7B and 13B models for in-editor code completion
- Long input handling — trained on 16K tokens, stable up to ~100K — good for large files and repos
- Multiple specializations (base, Python, Instruct) and sizes (7B/13B/34B) to fit different latency and hardware budgets
- Broad language coverage (Python, C++, Java, PHP, TypeScript/JavaScript, C#, Bash, and more)
- Strong, well-documented baseline that spawned a large ecosystem of community fine-tunes
Best for
- Local or self-hosted code completion and autocomplete in IDEs (especially the FIM-enabled 7B/13B)
- Code generation from natural-language prompts with Code Llama - Instruct
- Python-heavy generation and refactoring with the Code Llama - Python variant
- Code explanation, documentation, and debugging assistance over large files
- A base model for building custom, domain-specific coding assistants via fine-tuning
- Offline / privacy-sensitive coding workflows where a hosted API is not acceptable
Code Llama — every version
The full lineage of the Code Llama line, newest first. Every version has its own page — click any to compare specs, benchmarks and pricing.
| Version | Released | Context | License |
|---|---|---|---|
| Code Llama 70Bcurrent | 2024-01-29 | — | Open weights |
| Code Llama | 2023-08-24 | — | Open weights |
FAQ
Is Code Llama free and open source?
Code Llama's weights are openly available and free to download under the Llama 2 Community License, which permits both research and commercial use. It is commonly called open-weight rather than strictly open source, because the license includes acceptable-use terms and is not a standard OSI license.
What sizes and variants does Code Llama come in?
The initial August 2023 release shipped 7B, 13B and 34B models (a 70B was added in January 2024). Each size has three flavors: Code Llama (base), Code Llama - Python (Python-specialized), and Code Llama - Instruct (instruction-following). The 7B and 13B base and Instruct models also support fill-in-the-middle infilling.
How does Code Llama perform on coding benchmarks?
In Meta's paper, Code Llama - Python 34B scored 53.7% pass@1 on HumanEval and 56.2% on MBPP, the strongest among open models at the time and roughly on par with ChatGPT (GPT-3.5). The base 34B scored 48.8% on HumanEval and 55.0% on MBPP. Smaller models score lower (for example, base 7B reaches 33.5% HumanEval).
Is Code Llama still maintained or has it been replaced?
Code Llama is now a legacy line. Meta's official codellama inference-code repository was archived (made read-only) on July 1, 2025, and Meta's more recent code-capable Llama 3 and 3.1 models have effectively superseded it. The Code Llama weights remain available for download.