Meta Llama 3.1 is a suite of multilingual, large language models (LLMs) available in 8B,70B, and 405B sizes optimized for text.
MAX Models are popular open-source models converted to MAX’s native graph format. Anything with the label is either SOTA or being worked on. Learn more about MAX Models.
Browse all MAX Models
MAX GITHUB
Modular / MAX
BASE MODEL
meta-llama
meta-llama/Llama-3.1-8B-Instruct
QUANTIZED BY
bartowski
bartowski/Meta-Llama-3.1-8B-Instruct-GGUF
QUESTIONS ABOUT THIS MODEL?
Leave a comment
PROBLEMS WITH THE CODE?
File an Issue
TAGS
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
Choose Version
(3 versions)
Install our magic
package manager:
curl -ssL https://magic.modular.com/ | bash
Then run the source
command that's printed in your terminal.
Install Max Pipelines in order to run this model.
magic global install max-pipelines && magic global update
Start a local endpoint for Llama-3.1-Instruct/8B-Q4_K_M:
max-pipelines serve --huggingface-repo-id=meta-llama/Llama-3.1-8B-Instruct \
--weight-path=bartowski/Meta-Llama-3.1-8B-Instruct-GGUF/Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf
The endpoint is ready when you see the URI printed in your terminal:
Server ready on http://0.0.0.0:8000 (Press CTRL+C to quit)
Now open another terminal to send a request using curl
:
curl -N http://0.0.0.0:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "meta-llama/Llama-3.1-8B-Instruct",
"stream": true,
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the World Series in 2020?"}
]
}' | grep -o '"content":"[^"]*"' | sed 's/"content":"//g' | sed 's/"//g' | tr -d '
' | sed 's/\n//g'
🎉 Hooray! You’re running Generative AI. Our goal is to make this as easy as possible.
The Meta Llama 3.1 collection is a suite of multilingual, large language models (LLMs) available in 8B,70B, and 405B sizes, optimized for text input and output. These instruction-tuned models, driven by an optimized transformer architecture, excel in multilingual dialogue and outperform many existing chat models on industry benchmarks.
Model Developer: Meta
Model Architecture: Auto-regressive language model with optimized transformer architecture, leveraging supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to enhance alignment with human preferences.
Training Data | Parameters | Input Modalities | Output Modalities | Context Length | GQA | Token Count | Knowledge Cutoff | |
Llama 3.1 (text only) | New mix of publicly available online data. | 8B | Multilingual Text | Multilingual Text and code | 128k | Yes | 15T+ | December 2023 |
70B | Multilingual Text | Multilingual Text and code | 128k | Yes | ||||
405B | Multilingual Text | Multilingual Text and code | 128k | Yes |
Supported Languages: English, German, French, Italian, Portuguese, Hindi, Spanish, and Thai.
Model Release Date: July 23, 2024.
Status: Static model trained on offline data. Future versions will enhance safety based on community feedback.
License: The Llama 3.1 Community License is a custom commercial license available [here](https: //github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE).
For feedback or questions, refer to the model README. Further technical details can be found here.
Intended Use Cases: Llama 3.1 is designed for commercial and research applications across multiple languages. Its instruction-tuned models are ideal for chat applications, while the pretrained versions can handle various natural language tasks.
Out-of-Scope Uses: Any application that contravenes laws or regulations, especially those not covered by the Acceptable Use Policy and license terms.
Note: Though trained on various languages, developers bear responsibility for safe deployment when using additional languages, adhering to the community license and policies.
Llama 3.1 models are trained using Meta's custom GPU clusters and proprietary infrastructure, clocking a cumulative 39.3M GPU hours on H100-80GB systems (700W TDP). Estimated greenhouse gas emissions were 11,390 tons CO2eq, counteracted by Meta's net-zero global emissions policy since 2020.
Training Details | Llama 3.1 8B | Llama 3.1 70B | Llama 3.1 405B | Total |
---|---|---|---|---|
GPU hours | 1.46M | 7.0M | 30.84M | 39.3M |
Emissions (tons CO2eq) | 420 | 2,040 | 8,930 | 11,390 |
The methodology for these estimations aligns with standard scientific practices (reference).
Overview: Llama 3.1's pretraining dataset comprises approximately 15 trillion tokens from publicly accessible sources. Fine-tuning involved over 25M synthetically generated examples.
Data Freshness: The training data's knowledge cutoff is December 2023.
Category | Benchmark | Shots | Metric | Llama 3 8B | Llama 3.1 8B | Llama 3 70B | Llama 3.1 70B | Llama 3.1 405B |
---|---|---|---|---|---|---|---|---|
General | MMLU | 5 | macro_avg/acc_char | 66.7 | 66.7 | 79.5 | 79.3 | 85.2 |
General | AGIEval English | 3-5 | average/acc_char | 47.1 | 47.8 | 63.0 | 64.6 | 71.6 |
Category | Benchmark | Shots | Metric | Llama 3 8B Instruct | Llama 3.1 8B Instruct | Llama 3 70B Instruct | Llama 3.1 70B Instruct | Llama 3.1 405B Instruct |
---|---|---|---|---|---|---|---|---|
General | MMLU | 5 | macro_avg/acc | 68.5 | 69.4 | 82.0 | 83.6 | 87.3 |
Code | HumanEval | 0 | pass@1 | 60.4 | 72.6 | 81.7 | 80.5 | 89.0 |
Category | Benchmark | Language | Llama 3.1 8B | Llama 3.1 70B | Llama 3.1 405B |
---|---|---|---|---|---|
General | MMLU (5-shot, macro_avg/acc) | Portuguese | 62.12 | 80.13 | 84.95 |
Meta's Llama models encourage secure deployment with features like Llama Guard 3, Prompt Guard, and Code Shield to maintain system safety. Developers are expected to integrate these as needed into their specific systems.
Focus on Safety: Safety mechanisms, such as refusal tones and safety data strategies, were refined for this model, alongside adversarial prompt handling capabilities.
Our evaluation strategy encompasses typical use cases and capability-specific tests, employing dedicated adversarial datasets. Red teaming efforts involve cybersecurity experts, ensuring the wide-ranging integrity of Llama 3.1.
Though Llama 3.1 aims for inclusivity and helpfulness, developers must undertake application-specific safety checks due to potential unpredictable outputs in some contexts. Resources like the Responsible Use Guide provide further guidance.
Meta actively collaborates through initiatives like the Llama Impact Grants, supporting diverse AI applications. Further, a bug bounty program and community platforms ensure ongoing refinement and feedback integration.
Citations:
For precise citations and additional technical details, refer to the original model documentation and related resources.
version | 3 |
tensor_count | 292 |
kv_count | 33 |
general.architecture | llama |
general.type | model |
general.name | Meta Llama 3.1 8B Instruct |
general.finetune | Instruct |
general.basename | Meta-Llama-3.1 |
general.size_label | 8B |
general.license | llama3.1 |
general.tags.0 | |
general.tags.1 | meta |
general.tags.2 | pytorch |
general.tags.3 | llama |
general.tags.4 | llama-3 |
general.tags.5 | text-generation |
general.languages.0 | en |
general.languages.1 | de |
general.languages.2 | fr |
general.languages.3 | it |
general.languages.4 | pt |
general.languages.5 | hi |
general.languages.6 | es |
general.languages.7 | th |
llama.block_count | 32 |
llama.context_length | 131072 |
llama.embedding_length | 4096 |
llama.feed_forward_length | 14336 |
llama.attention.head_count | 32 |
llama.attention.head_count_kv | 8 |
llama.rope.freq_base | 500000 |
llama.attention.layer_norm_rms_epsilon | 0.000009999999747378752 |
general.file_type | 15 |
llama.vocab_size | 128256 |
llama.rope.dimension_count | 128 |
general.quantization_version | 2 |
quantize.imatrix.file | /models_out/Meta-Llama-3.1-8B-Instruct-GGUF/Meta-Llama-3.1-8B-Instruct.imatrix |
quantize.imatrix.dataset | /training_dir/calibration_datav3.txt |
quantize.imatrix.entries_count | 224 |
quantize.imatrix.chunks_count | 125 |
Version: 8B CPU Q4_K_M
You can quickly deploy Llama-3.1-Instruct-8B
to an endpoint using our MAX container.
It includes the latest version of MAX with GPU support and our Python-based inference server called MAX Serve.
With the following Docker command, you’ll get an OpenAI-compatible endpoint running Llama-3.1-Instruct-8B
:
docker run --gpus 1 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_HUB_ENABLE_HF_TRANSFER=1" \
--env "HF_TOKEN=" \
-p 8000:8000 \
docker.modular.com/modular/max-openai-api:nightly \
--huggingface-repo-id meta-llama/Llama-3.1-8B-Instruct \
--weight-path=bartowski/Meta-Llama-3.1-8B-Instruct-GGUF/Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf
In order to download the model from Hugging Face, you just need to fill in the
HF_TOKEN
value with your access token,
unless the model is from https://huggingface.co/modularai
.
For more information about the container image, see the MAX container documentation.
To learn more about how to deploy MAX to the cloud, check out our MAX Serve tutorials.
LLAMA 3.1 COMMUNITY LICENSE AGREEMENT Llama 3.1 Version Release Date: July 23, 2024
“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 3.1 distributed by Meta at https://llama.meta.com/doc/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 3.1” 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://llama.meta.com/llama-downloads.
“Llama Materials” means, collectively, Meta’s proprietary Llama 3.1 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.
1. 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 3.1 is licensed under the Llama 3.1 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://llama.meta.com/llama3_1/use-policy), which is hereby incorporated by reference into this Agreement.
2. Additional Commercial Terms. If, on the Llama 3.1 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.
3. 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.
4. 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.
5. 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/ ). 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 3.1 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.
6. 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.
7. 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.
DETAILS
MAX Models are popular open-source models converted to MAX’s native graph format. Anything with the label is either SOTA or being worked on. Learn more about MAX Models.
Browse all MAX Models
MAX GITHUB
Modular / MAX
BASE MODEL
meta-llama
meta-llama/Llama-3.1-8B-Instruct
QUANTIZED BY
bartowski
bartowski/Meta-Llama-3.1-8B-Instruct-GGUF
QUESTIONS ABOUT THIS MODEL?
Leave a comment
PROBLEMS WITH THE CODE?
File an Issue
TAGS
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
ENTERPRISES
@ Copyright - Modular Inc - 2025