Skip to main content
Browse Models

Meta

CodeLlama 13B

Released

2023-08-24

Family

Llama 2

Type

Fine-Tuned Model

Downloads

External Download

You are about to open a link to an external source. Verify the URL before continuing.

Download

4-bit GGUF (Q4_K_M)

GGUF · codellama-13b.Q4_K_M.gguf

5-bit GGUF (Q5_K_M)

GGUF · codellama-13b.Q5_K_M.gguf

6-bit GGUF (Q6_K)

GGUF · codellama-13b.Q6_K.gguf

8-bit GGUF (Q8_0)

GGUF · codellama-13b.Q8_0.gguf

Ollama Model (q4_K_M)

Ollama

Model Report

Overview

Code Llama 13B is a large language model (LLM) developed by Meta, purpose-built for programming tasks such as code generation, completion, and understanding. Introduced on August 24, 2023, this model is part of the broader Code Llama family, itself derived from the architecture of Llama 2. Code Llama 13B leverages domain-specific training on code and code-related data, providing robust support for a wide array of programming languages and use cases in software development.

Animated demonstration of Code Llama's debugging capabilities.

Figure 1. Code Llama 13B automatically fixes a bug in Python code and provides a detailed explanation of the correction, illustrating its utility in automated debugging and code understanding tasks.

Model Architecture and Training

Code Llama 13B utilizes an auto-regressive transformer-based architecture, building on the design of Llama 2. The model is specifically adapted for programming through continued pretraining on a mixture of source code, natural language about code, and technical documentation. This training process encompasses approximately 500 billion tokens primarily focused on popular programming languages such as Python, C++, Java, JavaScript (TypeScript), PHP, C#, and Bash.

The model's development took place on Meta's Research Super Cluster, utilizing proprietary training libraries and methods for large-scale optimization. Code Llama 13B incorporates fill-in-the-middle (FIM) training, which enables the model to insert code snippets into existing files—a capability crucial for effective code completion and automated refactoring. The model can process sequences up to 16,000 tokens during training, with support for context windows as large as 100,000 tokens during inference in certain configurations.

Technical Capabilities

Code Llama 13B is designed to address a broad spectrum of software engineering workflows. At its core, it generates source code based on user-supplied prompts—these may be written in natural language, code, or a combination of both. The model excels at:

  • Code Generation: Synthesizing functions, modules, or full scripts from descriptions or partial code.
  • Code Completion: Predicting code segments necessary to complete a partial file, including in the middle of existing code.
  • Code Understanding: Producing natural language explanations or summaries of complex source code.
  • Debugging Assistance: Identifying and amending code defects, then rationalizing the solution in human-readable language.
Animated demonstration of code explanation by Code Llama.

Figure 2. Code Llama 13B provides a natural language explanation of a Python function, exemplifying its capabilities for code understanding and education. (Prompt: '# Explain this code in natural language.')

Animated demonstration of code summarization.

Figure 3. Code Llama 13B generates a summary of a Python script, supporting developers in understanding and documenting codebases. (Prompt: '# Summarize this code.')

Performance and Benchmarks

Quantitative evaluation demonstrates that Code Llama 13B achieves strong accuracy across standard coding benchmarks. On metrics such as HumanEval, MBPP, and MultiPL-E, Code Llama models, including the 13B variant, consistently surpass prior open-source baselines and earlier versions of Llama. Detailed benchmarking data, as shown below, places Code Llama 13B among the top-performing publicly available models at the time of release, with especially competitive results in multilingual code tasks and Python specialization.

Benchmark comparison table for Code Llama models and competitors.

Figure 4. Comparison of Code Llama models and other LLMs on HumanEval, MBPP, and Multilingual HumanEval. Code Llama 13B achieves high accuracy scores, reflecting its capability in diverse coding tasks.

These benchmarks highlight Code Llama 13B's balance between computational efficiency and output quality. The model enables real-time assistance for code completion, debugging, and synthesis, without the higher latency associated with larger models such as the 34B or 70B parameter variants.

Applications and Use Cases

Code Llama 13B finds utility in a range of programming environments. As a productivity tool, it expedites workflows for professional developers by completing code, fixing bugs, generating documentation, and refactoring existing projects. Within educational settings, the model aids new programmers by offering clear explanations, generating robust boilerplate, and lowering barriers to software creation. Its design also supports more advanced applications, such as automated migration between programming languages and safe, instruction-following code generation.

Specialized versions within the Code Llama family, including instruction-tuned and Python-focused models, further enable adaptation to distinct use cases. For instance, the 'Instruct' variant is optimized for responding to user requests with aligned, safe behaviors, while the 'Python' variant is fine-tuned for Python development and evaluation as described in the model documentation.

Limitations and Responsible Use

As with all generative AI models, Code Llama 13B exhibits certain limitations. The model's outputs, while effective in many contexts, are not always perfectly accurate or fully predictable. Developers should not treat Code Llama 13B as a general-purpose language model, as its training and optimization are focused solely on code and code-related tasks.

Biases and risks inherent in the model's training data or generative process may result in unexpected or suboptimal outputs, especially when applied outside of intended software engineering tasks or in languages other than English. Safety evaluations documented in Meta's research indicate improved behavior over earlier models in code security scenarios, but the onus remains on users to institute rigorous safety checks and validation specific to their deployment context.

Code Llama models are provided under the Llama 2 community license, which enables both academic research and commercial application, while mandating compliance with the accompanying acceptable use policy.

Model Family and Release

Code Llama is offered in multiple parameter sizes—7B, 13B, 34B, and 70B—each available in base, instruction-tuned, and Python-specialized configurations. The 13B variant offers a balance between efficiency and accuracy, making it particularly suitable for latency-sensitive tasks and resource-constrained environments.

The initial release of Code Llama emerged on August 24, 2023, with subsequent updates broadening the range and parameter sizes of models in the series. The architecture, training methods, and licensing remain consistent across the family.

Illustration of Llama 2 model series.

Figure 5. A clean digital illustration referencing the Llama 2 series, highlighting its foundational role in the architecture of Code Llama models.

About Llama 2: The Llama 2 family, developed by Meta, comprises large language models ranging from 7 billion to 70 billion parameters, trained on 40% more data than their predecessors and featuring a doubled context length of 4,096 tokens.

More in the Llama 2 Family

Meta /

Llama 2 7B

7 billion parameter version of the 2nd iteration in Meta's Llama series of open source models.
codellama /

CodeLlama 7B

Fine-tuned version of Llama 7b, with training data optimized for code generation and completion tasks.
lmsys /

Vicuna 7B

Llama 7B fine-tuned on 125k GPT-4 conversations, with strong performance in chatbot and instruction following use-cases.
PygmalionAI /

Pygmalion 2 7B

Llama 7B fine-tuned for conversation, roleplaying, and storywriting.
openchat /

OpenChat 3.5 7B

Llama 2 7B fine-tuned using the C-RLFT strategy, with performance surpassing GPT 3.5 on some benchmarks.
Xwin-LM /

Xwin LM 7B

Llama 2 7B fine-tune using numerous emerging techniques including SFT, RM, and RLHF, achieving top results on AlpacaEval.
Meta /

Llama 2 13B

13 billion parameter version of the 2nd iteration in Meta's Llama series of open source models.
NousResearch /

Nous Hermes 13b

Llama 13b fine-tuned on over 300k curated GPT-4 outputs, known long high-quality outputs.
lmsys /

Vicuna 13B

Llama 13B fine-tuned on 125k GPT-4 conversations, with strong performance in chatbot and instruction following use-cases.
Gryphe /

MythoMax L2

An improved variant of MythoMix (MythoLogic-L2 and Huginn merge) using an experimental tensor-type merge technique. Originally a merge of multiple popular Llama 2 fine-tunes, including Hermes, Chronos, and Airoboros. Very popular for rich descriptions, storywriting, and roleplay.
WizardLM /

WizardLM 13B

Llama 2 13B model fine-tuned to follow complex instructions using the WizardLM training methodology.
PygmalionAI /

Pygmalion 2 13B

Llama 13B fine-tuned for conversation, roleplaying, and storywriting.
PygmalionAI /

Mythalion 13B

Merge of two popular fine-tunes: Pygmalion and Mythomax L2, resulting in a model that is good at roleplaying and instruction-following.
Xwin-LM /

Xwin LM 13B

Llama 2 13B fine-tune using numerous emerging techniques including SFT, RM, and RLHF, achieving top results on AlpacaEval.
Meta /

CodeLlama 34B

Fine-tuned version of unreleased Llama 2 34b, with training data optimized for code generation and completion tasks.
Meta /

Llama 2 70B

70 billion parameter version of the 2nd iteration in Meta's Llama series of open source models.
Meta /

CodeLlama 70B

Fine-tuned version of Llama 70b, with training data optimized for code generation and completion tasks.
Xwin-LM /

Xwin 70B

Llama 2 70B fine-tune using numerous emerging techniques including SFT, RM, and RLHF, achieving top results on AlpacaEval.
WizardLM /

WizardLM 70B

Llama 2 70B model fine-tuned to follow complex instructions using the WizardLM training methodology.
NousResearch /

Nous Hermes Llama 2 70B

Llama 2 70B fine-tuned on over 300k curated GPT-4 outputs.

More from Meta

Meta /

LLaMA 7B

A 7-billion parameter transformer language model trained on one trillion tokens from publicly available datasets for natural language processing research.
Meta /

LLaMA 13B

A 13-billion parameter transformer-based language model trained on 1.4 trillion tokens from publicly available datasets, demonstrating competitive performance on various benchmarks.
Meta /

LLaMA 33B

A 32.5 billion parameter transformer-based language model trained on 1.4 trillion tokens of publicly available data with competitive benchmark performance.
Meta /

LLaMA 65B

A 65.2-billion parameter transformer language model trained on 1.4 trillion tokens from publicly available datasets for research applications.
Meta /

Llama 4 Scout (17Bx16E)

A natively multimodal transformer with mixture-of-experts architecture supporting 10 million token context and multilingual text-image understanding capabilities.
Meta /

Llama 4 Maverick (17Bx128E)

Multimodal instruction-tuned model with 17 billion active parameters from 400 billion total, trained on 22 trillion tokens across 200 languages.
Meta /

Llama 3 8B

Large language model with 8 billion parameters featuring transformer architecture, trained on 15 trillion tokens for text generation and coding tasks.
Meta /

Llama 3 70B

State-of-the-art 70B foundation model from Meta, trained on over 15 trillion tokens.
Meta /

Llama 3.1 8B

Llama 3.1 is a new state-of-the-art large language model from Meta.
Meta /

Llama 3.1 70B

The Llama 3.1 series of open models rivals top closed models in performance. It was trained on over 15 trillion tokens using over 16K H100 GPUs. These models display state-of-the-art capabilities in general knowledge, steerability, math, tool use, and translation.
Meta /

Llama 3.2 3B

The next iteration in the Llama series of open models. This lightweight model was designed to run on edge devices, even mobile.
Meta /

Llama 3.3 70B

Llama 3.3 is a text-only 70B instruction-tuned model that provides enhanced performance relative to Llama 3.1 70B and to Llama 3.2 90B when used for text-only applications. For some applications, Llama 3.3 70B approaches the performance of Llama 3.1 405B.
Meta /

MusicGen

MusicGen is a text-to-music autoregressive transformer model capable of generating music samples conditioned on text descriptions or audio prompts.
Meta /

Magnet

Magnet is a single-stage, non-autoregressive transformer model for text-to-music and text-to-audio generation, with faster generation that MusicGen.
Meta /

Seamless

Seamless is a MMMMT (Massively Multilingual and Multimodal Machine Translation) model that can translate and generate audio in over 100 languages.