Llama 4

Models & AI Labs 💻 Python ⚖️ Other 🔴 No recent commits
7.7k stars

Llama is an accessible, open large language model (LLM) designed for developers, researchers, and businesses to build, experiment, and responsibly scale their generative AI ideas. It provides open access to cutting-edge models, a broad ecosystem, and a focus on trust and safety. The repository includes model weights, tokenizers, and scripts for running inference.

✨ Key features

  • Open access to cutting-edge large language models
  • Broad ecosystem with hundreds of millions of downloads
  • Trust and safety tools and guidelines
  • Multiple model sizes and context lengths
  • CLI for downloading and managing models
  • Support for FP8 and Int4 quantization

🎯 Use cases

  • Build generative AI applications
  • Experiment with state-of-the-art language models
  • Run inference on chat and completion tasks
  • Deploy models with reduced memory using quantization
  • Integrate with Hugging Face transformers

📦 Installation

🧰 Requirements: Python environment with pip, PyTorch, and at least 4 GPUs for full precision inference; access to Meta Llama website for model weights.

pip install llama-models

For running models from the repository:

pip install .[torch]

🚀 Usage

NGPUS=4
CHECKPOINT_DIR=~/.llama/checkpoints/Llama-4-Scout-17B-16E-Instruct
PYTHONPATH=$(git rev-parse --show-toplevel) \
  torchrun --nproc_per_node=$NGPUS \
  -m models.llama4.scripts.chat_completion $CHECKPOINT_DIR \
  --world_size $NGPUS

⚠️ Good to know

Testing conducted to date has not covered all scenarios, and the models carry potential risks with use.

❓ FAQ

How do I download the model weights?

Visit the Meta Llama website, accept the license, and you'll receive a signed URL via email. Then use the CLI: llama-model download --source meta --model-id CHOSEN_MODEL_ID.

What are the hardware requirements for running Llama 4?

Llama 4 models require at least 4 GPUs to run inference at full (bf16) precision. With FP8 quantization, 2 GPUs with 80GB memory are needed; with Int4, a single GPU with 80GB memory suffices.

Can I use the models with Hugging Face?

Yes, you can download weights from Hugging Face and use them with transformers. The snippet in the README shows how to load and generate with Llama4ForConditionalGeneration.

What is the context length for Llama 4 models?

Llama 4 Scout has a context length of 10 million tokens, and Maverick has 1 million tokens.

📊 Repository

Stars★ 7,688
Forks🍴 1,409
Open issues🐛 217
Last commit🕒 Feb 11, 2026
Created📅 Jun 2024
Language💻 Python
License⚖️ Other

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.