codellama/CodeLlama-13b-Python-hf

# Key capabilities ## About this model This model is designed for general code synthesis and understanding. This is a static model trained on an offline dataset. Future versions of Code Llama - Instr…

azureFoundry/azureml-meta/CodeLlama-13b-Python-hf@10

Key capabilities

About this model

This model is designed for general code synthesis and understanding. 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.

Key model capabilities

  • Code completion.
  • Infilling.
  • Instructions / chat.
  • Python specialist.

Use cases

See Responsible AI for additional considerations for responsible use.

Key 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 use cases

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.

Pricing

Pricing is based on a number of factors, including deployment type and tokens used. See pricing details here.

Technical specs

Code Llama is an auto-regressive language model that uses an optimized transformer architecture. 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 version of the 34B parameters model.

Training cut-off date

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

Training time

In aggregate, training all 9 Code Llama models required 400K GPU hours of computation on hardware of type A100-80GB (TDP of 350-400W). We used custom training libraries. The training and fine-tuning of the released models have been performed Meta's Research Super Cluster.

Input formats

Models input text only.

Output formats

Models generate text only.

Supported languages

Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in languages other than English.

Sample JSON response

{
    "input_data": {
        "input_string": [
            "def fibonacci("
        ],
        "parameters": {
            "top_p": 0.9,
            "temperature": 0.2,
            "do_sample": true,
            "max_new_tokens": 100
        }
    }
}

Sample output:

[
  {
    "0": "def fibonacci(n):\n    if n == 0:\n        return 0\n    elif n == 1:\n        return 1\n    else:\n        return fibonacci(n-1) + fibonacci(n-2)\n\n\ndef main():\n    n = int(input(\"Enter a number: \"))\n    print(fibonacci(n))\n\n\nif __name__ == \"__main__\":\n    main()"
  }
]

Model architecture

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

Long context

The provider has not supplied this information.

Optimizing model performance

The provider has not supplied this information.

Additional assets

More information can be found in the paper "Code Llama: Open Foundation Models for Code" or its arXiv page.

Training disclosure

Training, testing and validation

All experiments reported here and the released models have been trained and fine-tuned using the same data as Llama 2 with different weights (see Section 2 and Table 1 in the research paper for details). Estimated total emissions were 65.3 tCO2eq, 100% of which were offset by Meta's sustainability program.

Distribution

Distribution channels

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

More information

Code Llama and its variants are a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Code Llama's potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate or objectionable responses to user prompts. Therefore, before deploying any applications of Code Llama, developers should perform safety testing and tuning tailored to their specific applications of the model.

Please see the Responsible Use Guide available available at https://ai.meta.com/llama/responsible-user-guide.

See evaluations for the main models and detailed ablations in Section 3 and safety evaluations in Section 4 of the research paper.

Specifications & capabilities

Input
text
Output
text
Published model ID
CodeLlama-13b-Python-hf

Evaluations

21–34 / 34

BigCode Models Leaderboard

42.89%

source id
bigCode
leaderboard name
humaneval-python
dimension
coding
metric
humaneval-python
rank
21
aggregation scope
status
published
direction
higherIsBetter
conditions
suite
BigCode
evaluation_sequence_length
16384
metric_kind
humaneval-python
rank_method
competition rank among reported evaluations in identical conditions, including unlinked observations
source_file
bigcode/bigcode-models-leaderboard/data/code_eval_board.csv
published_at
2024-11-11T20:36:38Z
source_revision
e9d7f58791a40b01c9477337f81d5d77602db07768042d96cbbb42e11a50ee09
metric_population
29
benchmark_evaluation
true
source model id
CodeLlama-13b-Python
Original result ↗

BigCode Models Leaderboard

30.19%

source id
bigCode
leaderboard name
Win Rate
dimension
coding
metric
Win Rate
rank
21
aggregation scope
status
published
direction
higherIsBetter
conditions
suite
BigCode
evaluation_sequence_length
16384
metric_kind
Win Rate
rank_method
competition rank among reported evaluations in identical conditions, including unlinked observations
source_file
bigcode/bigcode-models-leaderboard/data/code_eval_board.csv
published_at
2024-11-11T20:36:38Z
source_revision
e9d7f58791a40b01c9477337f81d5d77602db07768042d96cbbb42e11a50ee09
metric_population
29
benchmark_evaluation
true
source model id
CodeLlama-13b-Python
Original result ↗

BigCode Models Leaderboard

18.35%

source id
bigCode
leaderboard name
r
dimension
coding
metric
r
rank
21
aggregation scope
status
published
direction
higherIsBetter
conditions
suite
BigCode
evaluation_sequence_length
16384
metric_kind
r
rank_method
competition rank among reported evaluations in identical conditions, including unlinked observations
source_file
bigcode/bigcode-models-leaderboard/data/code_eval_board.csv
published_at
2024-11-11T20:36:38Z
source_revision
e9d7f58791a40b01c9477337f81d5d77602db07768042d96cbbb42e11a50ee09
metric_population
29
benchmark_evaluation
true
source model id
CodeLlama-13b-Python
Original result ↗

BigCode Models Leaderboard

29.32%

source id
bigCode
leaderboard name
rust
dimension
coding
metric
rust
rank
22
aggregation scope
status
published
direction
higherIsBetter
conditions
suite
BigCode
evaluation_sequence_length
16384
metric_kind
rust
rank_method
competition rank among reported evaluations in identical conditions, including unlinked observations
source_file
bigcode/bigcode-models-leaderboard/data/code_eval_board.csv
published_at
2024-11-11T20:36:38Z
source_revision
e9d7f58791a40b01c9477337f81d5d77602db07768042d96cbbb42e11a50ee09
metric_population
29
benchmark_evaluation
true
source model id
CodeLlama-13b-Python
Original result ↗

BigCode Models Leaderboard

25.85%

source id
bigCode
leaderboard name
swift
dimension
coding
metric
swift
rank
23
aggregation scope
status
published
direction
higherIsBetter
conditions
suite
BigCode
evaluation_sequence_length
16384
metric_kind
swift
rank_method
competition rank among reported evaluations in identical conditions, including unlinked observations
source_file
bigcode/bigcode-models-leaderboard/data/code_eval_board.csv
published_at
2024-11-11T20:36:38Z
source_revision
e9d7f58791a40b01c9477337f81d5d77602db07768042d96cbbb42e11a50ee09
metric_population
29
benchmark_evaluation
true
source model id
CodeLlama-13b-Python
Original result ↗

BigCode Models Leaderboard

29.9%

source id
bigCode
leaderboard name
lua
dimension
coding
metric
lua
rank
24
aggregation scope
status
published
direction
higherIsBetter
conditions
suite
BigCode
evaluation_sequence_length
16384
metric_kind
lua
rank_method
competition rank among reported evaluations in identical conditions, including unlinked observations
source_file
bigcode/bigcode-models-leaderboard/data/code_eval_board.csv
published_at
2024-11-11T20:36:38Z
source_revision
e9d7f58791a40b01c9477337f81d5d77602db07768042d96cbbb42e11a50ee09
metric_population
29
benchmark_evaluation
true
source model id
CodeLlama-13b-Python
Original result ↗

BigCode Models Leaderboard

9.82%

source id
bigCode
leaderboard name
d
dimension
coding
metric
d
rank
27
aggregation scope
status
published
direction
higherIsBetter
conditions
suite
BigCode
evaluation_sequence_length
16384
metric_kind
d
rank_method
competition rank among reported evaluations in identical conditions, including unlinked observations
source_file
bigcode/bigcode-models-leaderboard/data/code_eval_board.csv
published_at
2024-11-11T20:36:38Z
source_revision
e9d7f58791a40b01c9477337f81d5d77602db07768042d96cbbb42e11a50ee09
metric_population
29
benchmark_evaluation
true
source model id
CodeLlama-13b-Python
Original result ↗

Open LLM Leaderboard v1

8.643%

source id
openLLMLeaderboardV1
leaderboard name
Open LLM v1 GSM8K
dimension
math
metric
Accuracy
rank
5154
aggregation scope
suite
Open LLM v1
status
archived
precision
4bit
task_count
6
metric_kind
Accuracy
rank_method
Derived competition rank over published evaluations with reported scores, including variants and source flags
weight_type
Original
published_at
2024-06-25T14:11:42Z
chat_template
false
suite_version
1
model_revision
ea1b775799b477fe22e64f8ac9107f28950b5c87
source_flagged
true
missing_metrics
    dataset_revision
    791ca1c841030008c6c266562c2b88c9b7196550
    metric_population
    7260
    ranking_population
    7260
    source_flag_anomaly
    true
    evaluated at
    2023-10-16T12:46:18.000Z
    source model id
    codellama/CodeLlama-13b-Python-hf
    Original result ↗

    Open LLM Leaderboard v1

    44.588%

    source id
    openLLMLeaderboardV1
    leaderboard name
    Open LLM v1 TruthfulQA
    dimension
    knowledge
    metric
    Accuracy
    rank
    5183
    aggregation scope
    suite
    Open LLM v1
    status
    archived
    precision
    4bit
    task_count
    6
    metric_kind
    Accuracy
    rank_method
    Derived competition rank over published evaluations with reported scores, including variants and source flags
    weight_type
    Original
    published_at
    2024-06-25T14:11:42Z
    chat_template
    false
    suite_version
    1
    model_revision
    ea1b775799b477fe22e64f8ac9107f28950b5c87
    source_flagged
    true
    missing_metrics
      dataset_revision
      791ca1c841030008c6c266562c2b88c9b7196550
      metric_population
      7170
      ranking_population
      7260
      source_flag_anomaly
      true
      evaluated at
      2023-10-16T12:46:18.000Z
      source model id
      codellama/CodeLlama-13b-Python-hf
      Original result ↗

      Open LLM Leaderboard v1

      65.036%

      source id
      openLLMLeaderboardV1
      leaderboard name
      Open LLM v1 Winogrande
      dimension
      reasoning
      metric
      Accuracy
      rank
      5935
      aggregation scope
      suite
      Open LLM v1
      status
      archived
      precision
      4bit
      task_count
      6
      metric_kind
      Accuracy
      rank_method
      Derived competition rank over published evaluations with reported scores, including variants and source flags
      weight_type
      Original
      published_at
      2024-06-25T14:11:42Z
      chat_template
      false
      suite_version
      1
      model_revision
      ea1b775799b477fe22e64f8ac9107f28950b5c87
      source_flagged
      true
      missing_metrics
        dataset_revision
        791ca1c841030008c6c266562c2b88c9b7196550
        metric_population
        7260
        ranking_population
        7260
        source_flag_anomaly
        true
        evaluated at
        2023-10-16T12:46:18.000Z
        source model id
        codellama/CodeLlama-13b-Python-hf
        Original result ↗

        Open LLM Leaderboard v1

        27.227%

        source id
        openLLMLeaderboardV1
        leaderboard name
        Open LLM v1 MMLU
        dimension
        knowledge
        metric
        Accuracy
        rank
        6181
        aggregation scope
        suite
        Open LLM v1
        status
        archived
        precision
        4bit
        task_count
        6
        metric_kind
        Accuracy
        rank_method
        Derived competition rank over published evaluations with reported scores, including variants and source flags
        weight_type
        Original
        published_at
        2024-06-25T14:11:42Z
        chat_template
        false
        suite_version
        1
        model_revision
        ea1b775799b477fe22e64f8ac9107f28950b5c87
        source_flagged
        true
        missing_metrics
          dataset_revision
          791ca1c841030008c6c266562c2b88c9b7196550
          metric_population
          7260
          ranking_population
          7260
          source_flag_anomaly
          true
          evaluated at
          2023-10-16T12:46:18.000Z
          source model id
          codellama/CodeLlama-13b-Python-hf
          Original result ↗

          Open LLM Leaderboard v1

          37.004%

          source id
          openLLMLeaderboardV1
          leaderboard name
          Open LLM v1 Average
          dimension
          general
          metric
          Six-task average
          rank
          6322
          aggregation scope
          suite
          Open LLM v1
          status
          archived
          precision
          4bit
          task_count
          6
          metric_kind
          Six-task average
          rank_method
          Derived competition rank over published evaluations with reported scores, including variants and source flags
          weight_type
          Original
          published_at
          2024-06-25T14:11:42Z
          chat_template
          false
          suite_version
          1
          model_revision
          ea1b775799b477fe22e64f8ac9107f28950b5c87
          source_flagged
          true
          missing_metrics
            dataset_revision
            791ca1c841030008c6c266562c2b88c9b7196550
            metric_population
            7170
            ranking_population
            7260
            source_flag_anomaly
            true
            evaluated at
            2023-10-16T12:46:18.000Z
            source model id
            codellama/CodeLlama-13b-Python-hf
            Original result ↗

            Open LLM Leaderboard v1

            32.594%

            source id
            openLLMLeaderboardV1
            leaderboard name
            Open LLM v1 ARC
            dimension
            reasoning
            metric
            Accuracy
            rank
            6462
            aggregation scope
            suite
            Open LLM v1
            status
            archived
            precision
            4bit
            task_count
            6
            metric_kind
            Accuracy
            rank_method
            Derived competition rank over published evaluations with reported scores, including variants and source flags
            weight_type
            Original
            published_at
            2024-06-25T14:11:42Z
            chat_template
            false
            suite_version
            1
            model_revision
            ea1b775799b477fe22e64f8ac9107f28950b5c87
            source_flagged
            true
            missing_metrics
              dataset_revision
              791ca1c841030008c6c266562c2b88c9b7196550
              metric_population
              7260
              ranking_population
              7260
              source_flag_anomaly
              true
              evaluated at
              2023-10-16T12:46:18.000Z
              source model id
              codellama/CodeLlama-13b-Python-hf
              Original result ↗

              Open LLM Leaderboard v1

              43.935%

              source id
              openLLMLeaderboardV1
              leaderboard name
              Open LLM v1 HellaSwag
              dimension
              reasoning
              metric
              Accuracy
              rank
              6626
              aggregation scope
              suite
              Open LLM v1
              status
              archived
              precision
              4bit
              task_count
              6
              metric_kind
              Accuracy
              rank_method
              Derived competition rank over published evaluations with reported scores, including variants and source flags
              weight_type
              Original
              published_at
              2024-06-25T14:11:42Z
              chat_template
              false
              suite_version
              1
              model_revision
              ea1b775799b477fe22e64f8ac9107f28950b5c87
              source_flagged
              true
              missing_metrics
                dataset_revision
                791ca1c841030008c6c266562c2b88c9b7196550
                metric_population
                7260
                ranking_population
                7260
                source_flag_anomaly
                true
                evaluated at
                2023-10-16T12:46:18.000Z
                source model id
                codellama/CodeLlama-13b-Python-hf
                Original result ↗

                Provider specifications & access

                1–3 / 3

                codellama/CodeLlama-13b-Python-hf ↗

                source model id
                azureml-meta/CodeLlama-13b-Python-hf@10
                hosting
                foundry-managed-compute
                platforms
                • Microsoft Foundry
                license
                llama2
                architecture
                input_modalities
                • text
                output_modalities
                • text
                capabilities

                  codellama/CodeLlama-13b-Python-hf ↗

                  source model id
                  azureml-meta/CodeLlama-13b-Python-hf@11
                  hosting
                  foundry-managed-compute
                  platforms
                  • Microsoft Foundry
                  license
                  llama2
                  architecture
                  input_modalities
                  • text
                  output_modalities
                  • text
                  capabilities

                    codellama/CodeLlama-13b-Python-hf ↗

                    source model id
                    HuggingFace/codellama-codellama-13b-python-hf@1
                    hosting
                    foundry-managed-compute
                    platforms
                    • Microsoft Foundry
                    license
                    llama2
                    architecture
                    input_modalities
                    • text
                    output_modalities
                    • text
                    capabilities

                      Safety assessments

                      1–1 / 1

                      Foundation Model Transparency Index 2025 ↗

                      31 / 100

                      source id
                      stanfordFMTI
                      canonical model id
                      azureFoundry/azureml-meta/CodeLlama-13b-Python-hf@10
                      taxonomy
                      transparency
                      hazard category
                      transparency
                      hazard name
                      Organization transparency
                      policy area
                      Meta
                      assessment type
                      organization-level disclosure
                      metric
                      disclosure_score
                      result label
                      31 / 100
                      sample size
                      100
                      updated at
                      2026-11-09T18:08:05.227Z

                      Original sources

                      1–10 / 10

                      Hugging Face · Model repository ↗

                      Microsoft Foundry · Model page ↗

                      Microsoft Foundry · Model page ↗

                      Microsoft Foundry · Model page ↗

                      Microsoft Foundry · Model documentation ↗

                      GitHub · Catalog ↗

                      Hugging Face · Catalog ↗

                      Hugging Face · Catalog ↗

                      Hugging Face · Catalog ↗

                      Microsoft Foundry · Catalog ↗

                      Source links

                      1–5 / 5

                      Explore more models

                      Models

                      Loading
                      EVIDENCE / COMPARISON

                      Benchmarks

                      Explore every benchmark

                      Loading

                      These charts contain model-linked results. The charts above also include unlinked source profiles. Compare scores within each evaluation. Model quality, usage, transparency and system performance measure different things.

                      Install TensorTrace