Model reference · open weights

CodeLlama

LLMs codellama Text gen 1 build Open, with conditions 258k dl/mo

CodeLlama is an open-weight language model from codellama. CodeLlama-7b-hf (BF16) weighs 13.5 GB; the smallest configuration that runs it is 2× RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • CodeLlama is a 6.7 billion parameter generative text model designed for general code synthesis and understanding.
  • It supports a context length of 16,384 tokens and operates under the llama2 license.
  • The model is an auto-regressive transformer that generates text outputs for code completion and infilling tasks.

Summary of the codellama/CodeLlama-7b-hf model card, 2026-10-01

What it is

Released bycodellama
Released2023-08-24
Parameters6.7B
VRAM13.5 GB for the weights

What it runs on

Memory and cards for CodeLlama-7b-hf (BF16)

13.5 GBweights, file size
524 MBcache per 1K tokens
620 MBruntime overhead, at least
16,384 tokenscontext max
CardRequests at onceContext maxMemory
8K each
RTX 3060 12 GB11.6 GB
RTX 4060 Ti 16 GB2K15.4 GB
RTX 3090 24 GB2all 16K23.4 GB
RTX 4090 24 GB2all 16K23.4 GB
RTX 5090 32 GB3all 16K31.0 GB
L40S 48 GB6all 16K44.0 GB
A100 80 GB14all 16K78.2 GB
H100 80 GB14all 16K78.1 GB
RTX PRO 6000 Blackwell 96 GB17all 16K93.8 GB
DGX Spark (GB10) 128 GB unified21all 16K107 GB
H200 141 GB28all 16K138 GB
B200 180 GB36all 16K176 GB
2× RTX 3060 12 GB
tensor parallel
115K11.6 GB a card
2× RTX 4060 Ti 16 GB
tensor parallel
3all 16K15.4 GB a card
2× RTX 5090 32 GB
tensor parallel
11all 16K31.0 GB a card
2× L40S 48 GB
tensor parallel
17all 16K44.0 GB a card
4× RTX 4090 24 GB
tensor parallel
18all 16K23.4 GB a card
4× RTX 3090 24 GB
tensor parallel
18all 16K23.4 GB a card
Memory needed at each load
Requests at once8K tokens each
118.4 GB
535.6 GB
848.5 GB
1682.8 GB
32152 GB
64289 GB

One card, with vLLM's small-card settings.

From the model card

What codellama says about CodeLlama

Read the model card

Code Llama is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 34 billion parameters. This is the repository for the base 7B version in the Hugging Face Transformers format. This model is designed for general code synthesis and understanding. Links to other models can be found in the index at the bottom.

[!NOTE] This is a non-official Code Llama repo. You can find the official Meta repository in the Meta Llama organization.

Base ModelPythonInstruct
7Bcodellama/CodeLlama-7b-hfcodellama/CodeLlama-7b-Python-hfcodellama/CodeLlama-7b-Instruct-hf
13Bcodellama/CodeLlama-13b-hfcodellama/CodeLlama-13b-Python-hfcodellama/CodeLlama-13b-Instruct-hf
34Bcodellama/CodeLlama-34b-hfcodellama/CodeLlama-34b-Python-hfcodellama/CodeLlama-34b-Instruct-hf
70Bcodellama/CodeLlama-70b-hfcodellama/CodeLlama-70b-Python-hfcodellama/CodeLlama-70b-Instruct-hf

Model Use

To use this model, please make sure to install transformers from main until the next version is released:

pip install transformers accelerate

Model capabilities:

  • [x] Code completion.
  • [x] Infilling.
  • [ ] Instructions / chat.
  • [ ] Python specialist.
from transformers import AutoTokenizer
import transformers
import torch

model = "codellama/CodeLlama-7b-hf"

tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

sequences = pipeline(
    'import socket\n\ndef ping_exponential_backoff(host: str):',
    do_sample=True,
    top_k=10,
    temperature=0.1,
    top_p=0.95,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
    max_length=200,
)
for seq in sequences:
    print(f"Result: {seq['generated_text']}")

Model Details

*Note: Use of this model is governed by the Meta license. Meta developed and publicly released the Code Llama family of large language models (LLMs).

Model Developers Meta

Variations Code Llama comes in three model sizes, and three variants:

  • Code Llama: base models designed for general code synthesis and understanding
  • Code Llama - Python: designed specifically for Python
  • Code Llama - Instruct: for instruction following and safer deployment

All variants are available in sizes of 7B, 13B and 34B parameters.

This repository contains the base model of 7B parameters.

Input Models input text only.

Output Models generate text only.

Model Architecture Code Llama is an auto-regressive language model that uses an optimized transformer architecture.

Model Dates Code Llama and its variants have been trained between January 2023 and July 2023.

Status This is a static model trained on an offline dataset. Future versions of Code Llama - Instruct will be released as we improve model safety with community feedback.

License A custom commercial license is available at: https://ai.meta.com/resources/models-and-libraries/llama-downloads/

Research Paper More information can be found in the paper "Code Llama: Open Foundation Models for Code" or it's arXiv page.

Intended Use

Intended Use Cases Code Llama and its variants is intended for commercial and research use in English and relevant programming languages. The base model Code Llama can be adapted for a variety of code synthesis and understanding tasks, Code Llama - Python is designed specifically to handle the Python programming language, and Code Llama - Instruct is intended to be safer to use for code assistant and generation applications.

Out-of-Scope Uses Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in languages other than English. Use in any other way that is prohibited by the Acceptable Use Policy and Licensing Agreement for Code Llama and its variants.

Hardware and Software

Training Factors We used custom training libraries. The training and fine-tuning of the released models have been performed Meta’s Research Super Cluster.

Carbon Footprint In aggregate, training all 9 Code Llama models required 400K GPU hours of computation on hardware of type A100-80GB (TDP of 350-400W). Estimated total emissions were 65.3 tCO2eq, 100% of which were offset by Meta’s sustainability program.

Training Data

All experiments reported here and the released models have been trained and fine-tuned using the same data as Llama 2 with

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms