Model Overview
Model Features
Model Capabilities
Use Cases
🚀 Llama 4 Models
The Llama 4 collection offers natively multimodal AI models, enabling text and multimodal experiences with industry - leading performance in text and image understanding.
🚀 Quick Start
Please, make sure you have transformers
v4.51.0
installed, or upgrade using pip install -U transformers
.
from transformers import AutoProcessor, Llama4ForConditionalGeneration
import torch
model_id = "meta-llama/Llama-4-Maverick-17B-128E-Instruct"
processor = AutoProcessor.from_pretrained(model_id)
model = Llama4ForConditionalGeneration.from_pretrained(
model_id,
attn_implementation="flex_attention",
device_map="auto",
torch_dtype=torch.bfloat16,
)
url1 = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/0052a70beed5bf71b92610a43a52df6d286cd5f3/diffusers/rabbit.jpg"
url2 = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/datasets/cat_style_layout.png"
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": url1},
{"type": "image", "url": url2},
{"type": "text", "text": "Can you describe how these two images are similar, and how they differ?"},
]
},
]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
)
response = processor.batch_decode(outputs[:, inputs["input_ids"].shape[-1]:])[0]
print(response)
print(outputs[0])
✨ Features
- Multimodal Capability: The Llama 4 models are natively multimodal, supporting both text and image inputs and outputs.
- Mixture - of - Experts Architecture: Leveraging this architecture to offer industry - leading performance in text and image understanding.
- Multilingual Support: Supports Arabic, English, French, German, Hindi, Indonesian, Italian, Portuguese, Spanish, Tagalog, Thai, and Vietnamese.
- Commercial and Research Use: Suitable for a wide range of commercial and research applications.
📚 Documentation
Model Information
The Llama 4 collection of models are natively multimodal AI models that enable text and multimodal experiences. These models leverage a mixture - of - experts architecture to offer industry - leading performance in text and image understanding.
These Llama 4 models mark the beginning of a new era for the Llama ecosystem. Two efficient models are launched in the Llama 4 series: Llama 4 Scout, a 17 - billion parameter model with 16 experts, and Llama 4 Maverick, a 17 - billion parameter model with 128 experts.
Property | Details |
---|---|
Model Developer | Meta |
Model Architecture | Auto - regressive language models using a mixture - of - experts (MoE) architecture and incorporating early fusion for native multimodality |
Supported Languages | Arabic, English, French, German, Hindi, Indonesian, Italian, Portuguese, Spanish, Tagalog, Thai, and Vietnamese |
Model Release Date | April 5, 2025 |
Status | A static model trained on an offline dataset. Future versions of the tuned models may be released with community feedback |
License | A custom commercial license, the Llama 4 Community License Agreement, available at: [https://github.com/meta - llama/llama - models/blob/main/models/llama4/LICENSE](https://github.com/meta - llama/llama - models/blob/main/models/llama4/LICENSE) |
Where to Send Questions or Comments | Instructions on how to provide feedback or comments on the model can be found in the Llama [README](https://github.com/meta - llama/llama - models/blob/main/README.md). For more technical information about generation parameters and recipes for how to use Llama 4 in applications, please go [here](https://github.com/meta - llama/llama - cookbook) |
Model Name | Training Data | Params | Input modalities | Output modalities | Context length | Token count | Knowledge cutoff |
---|---|---|---|---|---|---|---|
Llama 4 Scout (17Bx16E) | A mix of publicly available, licensed data and information from Meta's products and services. This includes publicly shared posts from Instagram and Facebook and people's interactions with Meta AI. Learn more in our Privacy Center | 17B (Activated) 109B (Total) |
Multilingual text and image | Multilingual text and code | 10M | ~40T | August 2024 |
Llama 4 Maverick (17Bx128E) | 17B (Activated) 400B (Total) |
Multilingual text and image | Multilingual text and code | 1M | ~22T | August 2024 |
Intended Use
Intended Use Cases: Llama 4 is intended for commercial and research use in multiple languages. Instruction - tuned models are intended for assistant - like chat and visual reasoning tasks, whereas pretrained models can be adapted for natural language generation. For vision, Llama 4 models are also optimized for visual recognition, image reasoning, captioning, and answering general questions about an image. The Llama 4 Community License allows for these use cases.
Out - of - scope: Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in any other way that is prohibited by the Acceptable Use Policy and Llama 4 Community License. Use in languages or capabilities beyond those explicitly referenced as supported in this model card.
⚠️ Important Note
- Llama 4 has been trained on a broader collection of languages than the 12 supported languages (pre - training includes [200 total languages](https://ai.meta.com/research/no - language - left - behind/)). Developers may fine - tune Llama 4 models for languages beyond the 12 supported languages provided they comply with the Llama 4 Community License and the Acceptable Use Policy. Developers are responsible for ensuring that their use of Llama 4 in additional languages is done in a safe and responsible manner.
- Llama 4 has been tested for image understanding up to 5 input images. If leveraging additional image understanding capabilities beyond this, Developers are responsible for ensuring that their deployments are mitigated for risks and should perform additional testing and tuning tailored to their specific applications.
Hardware and Software
Training Factors: Custom training libraries, Meta's custom - built GPU clusters, and production infrastructure were used for pretraining. Fine - tuning, quantization, annotation, and evaluation were also performed on production infrastructure.
Training Energy Use: Model pre - training utilized a cumulative of 7.38M GPU hours of computation on H100 - 80GB (TDP of 700W) type hardware. Training time is the total GPU time required for training each model and power consumption is the peak power capacity per GPU device used, adjusted for power usage efficiency.
Training Greenhouse Gas Emissions: Estimated total location - based greenhouse gas emissions were 1,999 tons CO2eq for training. Since 2020, Meta has maintained net zero greenhouse gas emissions in its global operations and matched 100% of its electricity use with clean and renewable energy; therefore, the total market - based greenhouse gas emissions for training were 0 tons CO2eq.
Model Name | Training Time (GPU hours) | Training Power Consumption (W) | Training Location - Based Greenhouse Gas Emissions (tons CO2eq) | Training Market - Based Greenhouse Gas Emissions (tons CO2eq) |
---|---|---|---|---|
Llama 4 Scout | 5.0M | 700 | 1,354 | 0 |
Llama 4 Maverick | 2.38M | 700 | 645 | 0 |
Total | 7.38M | - | 1,999 | 0 |
The methodology used to determine training energy use and greenhouse gas emissions can be found here. Since Meta is openly releasing these models, the training energy use and greenhouse gas emissions will not be incurred by others.
Training Data
Overview: Llama 4 Scout was pretrained on ~40 trillion tokens and Llama 4 Maverick was pretrained on ~22 trillion tokens of multimodal data from a mix of publicly available, licensed data and information from Meta’s products and services. This includes publicly shared posts from Instagram and Facebook and people’s interactions with Meta AI.
Data Freshness: The pretraining data has a cutoff of August 2024.
Benchmarks
Pre - trained models
Pre - trained models | |||||||
---|---|---|---|---|---|---|---|
Category | Benchmark | # Shots | Metric | Llama 3.1 70B | Llama 3.1 405B | Llama 4 Scout | Llama 4 Maverick |
Reasoning & Knowledge | MMLU | 5 | macro_avg/acc_char | 79.3 | 85.2 | 79.6 | 85.5 |
MMLU - Pro | 5 | macro_avg/em | 53.8 | 61.6 | 58.2 | 62.9 | |
MATH | 4 | em_maj1@1 | 41.6 | 53.5 | 50.3 | 61.2 | |
Code | MBPP | 3 | pass@1 | 66.4 | 74.4 | 67.8 | 77.6 |
Multilingual | TydiQA | 1 | average/f1 | 29.9 | 34.3 | 31.5 | 31.7 |
Image | ChartQA | 0 | relaxed_accuracy | No multimodal support | 83.4 | 85.3 | |
DocVQA | 0 | anls | 89.4 | 91.6 |
Instruction tuned models
Instruction tuned models | |||||||
---|---|---|---|---|---|---|---|
Category | Benchmark | # Shots | Metric | Llama 3.3 70B | Llama 3.1 405B | Llama 4 Scout | Llama 4 Maverick |
Image Reasoning | MMMU | 0 | accuracy | No multimodal support | 69.4 | 73.4 | |
MMMU Pro^ | 0 | accuracy | 52.2 | 59.6 | |||
MathVista | 0 | accuracy | 70.7 | 73.7 | |||
Image Understanding | ChartQA | 0 | relaxed_accuracy | 88.8 | 90.0 | ||
DocVQA (test) | 0 | anls | 94.4 | 94.4 | |||
Coding | LiveCodeBench (10/01/2024 - 02/01/2025) | 0 | pass@1 | 33.3 | 27.7 | 32.8 | 43.4 |
Reasoning & Knowledge | MMLU Pro | 0 | macro_avg/em | 68.9 | 73.4 | 74.3 | 80.5 |
GPQA Diamond | 0 | accuracy | 50.5 | 49.0 | 57.2 | 69.8 | |
Multilingual | MGSM | 0 | average/em | 91.1 | 91.6 | 90.6 | 92.3 |
Long context | MTOB (half book) eng->kgv/kgv->eng | - | chrF | Context window is 128K | 42.2/36.6 | 54.0/46.4 |
License
A custom commercial license, the Llama 4 Community License Agreement, is available at: [https://github.com/meta - llama/llama - models/blob/main/models/llama4/LICENSE](https://github.com/meta - llama/llama - models/blob/main/models/llama4/LICENSE).
⚠️ Important Note
LLAMA 4 COMMUNITY LICENSE AGREEMENT
Llama 4 Version Effective Date: April 5, 2025
"Agreement" means the terms and conditions for use, reproduction, distribution and modification of the Llama Materials set forth herein.
"Documentation" means the specifications, manuals and documentation accompanying Llama 4 distributed by Meta at https://www.llama.com/docs/overview.
"Licensee" or "you" means you, or your employer or any other person or entity (if you are entering into this Agreement on such person or entity’s behalf), of the age required under applicable laws, rules or regulations to provide legal consent and that has legal authority to bind your employer or such other person or entity if you are entering in this Agreement on their behalf.
"Llama 4" means the foundational large language models and software and algorithms, including machine - learning model code, trained model weights, inference - enabling code, training - enabling code, fine - tuning enabling code and other elements of the foregoing distributed by Meta at [https://www.llama.com/llama - downloads](https://www.llama.com/llama - downloads).
"Llama Materials" means, collectively, Meta’s proprietary Llama 4 and Documentation (and any portion thereof) made available under this Agreement.
"Meta" or "we" means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your principal place of business is in the EEA or Switzerland) and Meta Platforms, Inc. (if you are located outside of the EEA or Switzerland).
By clicking "I Accept" below or by using or distributing any portion or element of the Llama Materials, you agree to be bound by this Agreement.
- License Rights and Redistribution.
a. Grant of Rights. You are granted a non - exclusive, worldwide, non - transferable and royalty - free limited license under Meta’s intellectual property or other rights owned by Meta embodied in the Llama Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the Llama Materials.
b. Redistribution and Use.
i. If you distribute or make available the Llama Materials (or any derivative works thereof), or a product or service (including another AI model) that contains any of them, you shall (A) provide a copy of this Agreement with any such Llama Materials; and (B) prominently display "Built with Llama" on a related website, user interface, blogpost, about page, or product documentation. If you use the Llama Materials or any outputs or results of the Llama Materials to create, train, fine tune, or otherwise improve an AI model, which is distributed or made available, you shall also include "Llama" at the beginning of any such AI model name.
ii. If you receive Llama Materials, or any derivative works thereof, from a Licensee as part of an integrated end user product, then Section 2 of this Agreement will not apply to you.
iii. You must retain in all copies of the Llama Materials that you distribute the following attribution notice within a "Notice" text file distributed as a part of such copies: "Llama 4 is licensed under the Llama 4 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved."
iv. Your use of the Llama Materials must comply with applicable laws and regulations (including trade compliance laws and regulations) and adhere to the Acceptable Use Policy for the Llama Materials (available at [https://www.llama.com/llama4/use - policy](https://www.llama.com/llama4/use - policy)), which is hereby incorporated by reference into this Agreement.
Additional Commercial Terms. If, on the Llama 4 version release date, the monthly active users of the products or services made available by or for Licensee, or Licensee’s affiliates, is greater than 700 million monthly active users in the preceding calendar month, you must request a license from Meta, which Meta may grant to you in its sole discretion, and you are not authorized to exercise any of the rights under this Agreement unless or until Meta otherwise expressly grants you such rights.
Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE LLAMA MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON - INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE LLAMA MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA MATERIALS AND ANY OUTPUT AND RESULTS.
Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
Intellectual Property.
a. No trademark licenses are granted under this Agreement, and in connection with the Llama Materials, neither Meta nor Licensee may use any name or mark owned by or associated with the other or any of its affiliates, except as required for reasonable and customary use in describing and redistributing the Llama Materials or as set forth in this Section 5(a). Meta hereby grants you a license to use "Llama" (the "Mark") solely as required to comply with the last sentence of Section 1.b.i. You will comply with Meta’s brand guidelines (currently accessible at [https://about.meta.com/brand/resources/meta/company - brand/](https://about.meta.com/brand/resources/meta/company - brand/)). All goodwill arising out of your use of the Mark will inure to the benefit of Meta.
b. Subject to Meta’s ownership of Llama Materials and derivatives made by or for Meta, with respect to any derivative works and modifications of the Llama Materials that are made by you, as between you and Meta, you are and will be the owner of such derivative works and modifications.
c. If you institute litigation or other proceedings against Meta or any entity (including a cross - claim or counterclaim in a lawsuit) alleging that the Llama Materials or Llama 4 outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by you, then any licenses granted to you under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Meta from and against any claim by any third party arising out of or related to your use or distribution of the Llama Materials.
Term and Termination. The term of this Agreement will commence upon your acceptance of this Agreement or access to the Llama Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete and cease use of the Llama Materials. Sections 3, 4 and 7 shall survive the termination of this Agreement.
Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of the State of California without regard to choice of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The courts of California shall have exclusive jurisdiction of any dispute arising out of this Agreement.







