---
title: "Code Llama: Meta’s state-of-the-art LLM for coding"
description: "Code Llama is a code-specialized family of Llama 2 models, built by further training Llama 2 on 500B tokens of code (1T for the 70B model)."
url: "https://swe.quest/articles/code-llama-meta-s-state-of-the-art-llm-for-coding-c2f826fd04e42ba1"
canonical: "https://ai.meta.com/blog/code-llama-large-language-model-coding/"
source: "Meta Engineering"
published: "2023-08-24"
difficulty: "easy"
kind: "Announcement"
reading_minutes: 7
tags: ["llms","ai-coding","model-training"]
---

# Code Llama: Meta’s state-of-the-art LLM for coding

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2023-08-24, 7 min read, Announcement. Original: [https://ai.meta.com/blog/code-llama-large-language-model-coding/](https://ai.meta.com/blog/code-llama-large-language-model-coding/)

## Summary

Code Llama is a code-specialized family of Llama 2 models, built by further training Llama 2 on 500B tokens of code (1T for the 70B model). It ships in 7B, 13B, 34B and 70B sizes, as base, Python-specialized and instruction-tuned variants. The 7B and 13B models support fill-in-the-middle for code completion and are suited to low-latency use. The larger models give better results, and all models handle up to 100K tokens of context despite training on 16K sequences. Code Llama 34B scored 53.7% on HumanEval and 56.2% on MBPP, on par with ChatGPT. The models are free for research and commercial use, and the Instruct variants are recommended for code generation.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)

## Prerequisites

- large language models basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

Code Llama, Llama 2, HumanEval, MBPP, fill-in-the-middle

## Related posts

- [Code Llama: Llama 2 learns to code](https://swe.quest/articles/code-llama-llama-2-learns-to-code-bbc6e9367fb26138.md): Hugging Face · 2023-08-25 · Medium · 12 min read · LLMs, AI for coding, Inference & serving, Python, Evaluation
  Code Llama is a family of 7B, 13B and 34B Llama 2 derivatives trained on 500B tokens of code.
- [StarCoder: A State-of-the-Art LLM for Code](https://swe.quest/articles/starcoder-a-state-of-the-art-llm-for-code-ae224d2374e67db4.md): Hugging Face · 2023-05-04 · Easy · 5 min read · LLMs, AI for coding, Evaluation, Open source
  StarCoder and StarCoderBase are ~15B-parameter code LLMs trained on 1 trillion tokens of permissively licensed GitHub data from The Stack 1.2, covering 80+ languages, commits, issues and notebooks, with StarCoder further fine-tuned on 35B Python tokens.
- [Replit’s new AI Model now available on Hugging Face](https://swe.quest/articles/replit-s-new-ai-model-now-available-on-hugging-face-3b96faee1bd121e8.md): Replit · 2023-10-10 · Easy · 2 min read · LLMs, AI for coding, Model training, Open source
  Replit Code V1.5 3B is an open code-completion model released on Hugging Face under a license that allows commercial use.
- [CodeGemma - an official Google release for code LLMs](https://swe.quest/articles/codegemma-an-official-google-release-for-code-llms-3ae6555e4222e566.md): Hugging Face · 2024-04-09 · Medium · 8 min read · LLMs, AI for coding, Inference & serving
  CodeGemma is a family of Gemma-based code models from Google: a 2B base model trained only on fill-in-the-middle infilling for fast, low-latency completion, a 7B base model mixing infilling (80%) with natural language, and a 7B instruct model for conversational coding.
- [Beat GPT-4o at Python by searching with 100 dumb LLaMAs](https://swe.quest/articles/beat-gpt-4o-at-python-by-searching-with-100-dumb-llamas-907f6997678a8d61.md): Modal · 2024-08-05 · Medium · 7 min read · LLMs, Inference & serving, Evaluation, AI for coding, Serverless
  Sampling LLaMA 3.1 8B Instruct many times and checking each candidate against HumanEval's unit tests raises pass@k from 66.4% at k=1 to 90.5% at k=100, matching GPT-4o's reported 90.2% pass@1, and to 95.1% at k=1000.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
