AI/TLDR

Code Llama 70B

Meta's largest open-weight code model — built on Llama 2, trained on 1T tokens of code.

Overview

Code Llama 70B is the largest model in Meta's Code Llama family, released on January 29, 2024. It is fine-tuned from Llama 2 and specialized for generating, explaining and completing code. The 70B tier was added after the original 7B, 13B and 34B models and was trained on roughly 1 trillion tokens of code and code-related data — about double the 500B tokens used for the smaller sizes.

Meta shipped three 70B variants: Code Llama 70B (the foundation model), Code Llama - Python 70B (further tuned on Python), and Code Llama - Instruct 70B (tuned to follow natural-language instructions and to be safer and more helpful in chat). All three support large inputs — the models are trained on 16k-token sequences and show improvements on contexts up to 100k tokens — and they handle popular languages including Python, C++, Java, PHP, TypeScript, C# and Bash.

Code Llama 70B is released under the Llama 2 Community License, which permits both research and commercial use. The weights are openly available, so the model is most commonly self-hosted or run through community tooling such as Ollama (codellama:70b) and Hugging Face rather than a first-party paid API. It has since been superseded by Meta's general-purpose Llama 3 family for many coding tasks, but it remains a notable open-weight code model.

Released2024-01-29
LicenseLlama 2 Community License
WeightsOpen weights
Parameters70B
Context100K
Max outputNot specified by Meta
ArchitectureDense transformer (decoder-only), fine-tuned from Llama 2 70B and specialized for code. Released in three 70B variants: a foundation model (Code Llama 70B), a Python-specialized model (Code Llama - Python 70B), and an instruction-tuned model (Code Llama - Instruct 70B). All were trained on 16k-token sequences and show improvements on inputs up to 100k tokens; the 7B/13B/70B variants also support code infilling.
Knowledge cutoffNot disclosed by Meta
ModalitiesText
StatusAvailable (open weights)

Benchmarks

  1. HumanEval (pass@1) — Code Llama - Instruct 70B67.8%
  2. MBPP (pass@1) — Code Llama - Instruct 70B62.2%
  3. HumanEval (pass@1) — Code Llama - Python 70B57.3%
  4. MBPP (pass@1) — Code Llama - Python 70B65.6%
  5. HumanEval (pass@1) — Code Llama 70B (base)53%
  6. MBPP (pass@1) — Code Llama 70B (base)62.4%

Scores on a 0–100 scale (25-point gridlines); higher is better. Each benchmark links to its published source.

Pricing

InputFree (open weights — self-hosted) / 1M tokens
OutputFree (open weights — self-hosted) / 1M tokens

Meta does not sell Code Llama 70B through a first-party API. The weights are released for free under the Llama 2 Community License and can be self-hosted (e.g. via Ollama or Hugging Face); third-party hosted inference prices vary by provider.

Pricing source ↗

Strengths

  • Largest open-weight model in the Code Llama line, with strong HumanEval/MBPP results among open models at release
  • Three variants let you pick the right fit: foundation, Python-specialized, or instruction-tuned for chat-style coding
  • Permissive Llama 2 Community License allows commercial use
  • Handles large inputs — trained on 16k-token sequences with improvements up to 100k tokens
  • Open weights mean it can be fully self-hosted (Ollama, Hugging Face, llama.cpp) with no per-token API cost

Best for

  • Local or on-prem code generation and autocompletion where data can't leave your infrastructure
  • Code explanation, review and debugging assistance via the Instruct variant
  • Python-heavy workloads using the Code Llama - Python 70B variant
  • Fine-tuning a code model on a private codebase from an openly licensed base
  • Research and benchmarking of open code models

How to access

ProviderModel ID
Hugging Face (Code Llama - Instruct 70B) ↗codellama/CodeLlama-70b-Instruct-hf
Hugging Face (Code Llama 70B base) ↗codellama/CodeLlama-70b-hf
Ollama ↗codellama:70b

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.

VersionReleasedContextLicense
Code Llama 70Bcurrent2024-01-29Open weights
Code Llama2023-08-24Open weights

FAQ

When was Code Llama 70B released?

Meta released Code Llama 70B on January 29, 2024, as the largest model in the Code Llama family, which previously offered 7B, 13B and 34B sizes.

What are the three Code Llama 70B variants?

There are three: Code Llama 70B (the foundation code model), Code Llama - Python 70B (specialized for Python), and Code Llama - Instruct 70B (tuned to follow natural-language instructions). On HumanEval, the Instruct variant scores 67.8%.

Is Code Llama 70B free and open source?

The weights are released for free under the Llama 2 Community License, which allows both research and commercial use. You can download and self-host it, for example via Hugging Face or Ollama. Meta does not offer it through a paid first-party API.

What context length does Code Llama 70B support?

The 70B models are trained on sequences of 16,000 tokens and show improvements on inputs of up to 100,000 tokens, according to Meta's research paper.