Meta’s Llama, one of the most famous and widely used ope-source AI model, has just got a whole new fresh release of its versions, the Llama-4 Scout and Llama-4 Maverick models. These models seamlessly integrate text and image processing, enabling a richer and more intuitive user experience. Leveraging a sophisticated mixture-of-experts (MoE) architecture, they activate only the most relevant parameters for each task, ensuring unparalleled efficiency and performance. Llama 4 Scout, with 17 billion active parameters distributed across 16 experts, offers an impressive 10-million-token context window, facilitating complex tasks such as multi-document summarization and comprehensive codebase analysis. On the other hand, Llama 4 Maverick expands this capability further with 128 experts, maintaining the same active parameter count but enhancing specialization and depth in understanding.
In this article, we are ready to dive into the Llama-4 Scout 17B 16E. We’ll see everything from minimum prerequisites to run this model efficiently, and finally get this model up and running and generating response for our prompt.
Benchmarks
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 | | | | | | | |
---|
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/acc | 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 |
| MTOB (full book) eng->kgv/kgv->eng | – | chrF | | | 39.7/36.3 | 50.8/46.7 |
Prerequisites
The minimum system requirements for this use case are:
- GPUs: 1x H200 or 2x H100
- Disk Space: 700 GB+
- VRAM: At least 120 GB (multiple nodes combined)
- Anaconda installed
Step-by-step process to install and run Llama-4 Scout locally
For the purpose of this tutorial, we’ll use a GPU-powered Virtual Machine by NodeShift since it provides high compute Virtual Machines at a very affordable cost on a scale that meets GDPR, SOC2, and ISO27001 requirements. Also, it offers an intuitive and user-friendly interface, making it easier for beginners to get started with Cloud deployments. However, feel free to use any cloud provider of your choice and follow the same steps for the rest of the tutorial.
Step 1: Setting up a NodeShift Account
Visit app.nodeshift.com and create an account by filling in basic details, or continue signing up with your Google/GitHub account.
If you already have an account, login straight to your dashboard.
Step 2: Create a GPU Node
After accessing your account, you should see a dashboard (see image), now:
- Navigate to the menu on the left side.
- Click on the GPU Nodes option.
- Click on Start to start creating your very first GPU node.
These GPU nodes are GPU-powered virtual machines by NodeShift. These nodes are highly customizable and let you control different environmental configurations for GPUs ranging from H100s to A100s, CPUs, RAM, and storage, according to your needs.
Step 3: Selecting configuration for GPU (model, region, storage)
- For this tutorial, we’ll be using the H200 GPU; however, you can choose any GPU of your choice based on the prerequisites.
- Similarly, we’ll opt for 2TB storage by sliding the bar. You can also select the region where you want your GPU to reside from the available ones.
Step 4: Choose GPU Configuration and Authentication method
- After selecting your required configuration options, you’ll see the available GPU nodes in your region and according to (or very close to) your configuration. In our case, we’ll choose a 2x H200 140GB GPU node with 192vCPUs/504GB RAM/2TB SSD.
2. Next, you’ll need to select an authentication method. Two methods are available: Password and SSH Key. We recommend using SSH keys, as they are a more secure option. To create one, head over to our official documentation.
Step 5: Choose an Image
The final step would be to choose an image for the VM, which in our case is Nvidia Cuda, where we’ll deploy and run the inference of our model.
That’s it! You are now ready to deploy the node. Finalize the configuration summary, and if it looks good, click Create to deploy the node.
Step 6: Connect to active Compute Node using SSH
- As soon as you create the node, it will be deployed in a few seconds or a minute. Once deployed, you will see a status Running in green, meaning that our Compute node is ready to use!
- Once your GPU shows this status, navigate to the three dots on the right and click on Connect with SSH. This will open a pop-up box with the Host details. Copy and paste that in your local terminal to connect to the remote server via SSH.
As you copy the details, follow the below steps to connect to the running GPU VM via SSH:
- Open your terminal, paste the SSH command, and run it.
2. In some cases, your terminal may take your consent before connecting. Enter ‘yes’.
3. A prompt will request a password. Type the SSH password, and you should be connected.
Output:
Next, If you want to check the GPU details, run the following command in the terminal:
!nvidia-smi
Step 7: Set up the project environment with dependencies
- Create a virtual environment using Anaconda.
conda create -n scout python=3.11 && conda activate scout
Output:
2. Once you’re inside the environment, install project dependencies as mentioned in below.
pip install torch torchvision torchaudio einops timm pillow
pip install git+https://github.com/huggingface/transformers
pip install git+https://github.com/huggingface/accelerate
pip install huggingface_hub huggingface_hub[hf_xet]
Output:
3. Since this is a gated mode, we’ll need to first login to huggingface-cli
with our access token.
(replace <YOUR_HF_TOKEN>
with your HF READ Token)
huggingface-cli login --token=<YOUR_HF_TOKEN>
4. Install and run jupyter notebook.
conda install -c conda-forge --override-channels notebook -y
conda install -c conda-forge --override-channels ipywidgets -y
jupyter notebook --allow-root
5. If you’re on a remote machine (e.g., NodeShift GPU), you’ll need to do SSH port forwarding in order to access the jupyter notebook session on your local browser.
Run the following command in your local terminal after replacing:
<YOUR_SERVER_PORT>
with the PORT allotted to your remote server (For the NodeShift server – you can find it in the deployed GPU details on the dashboard).
<PATH_TO_SSH_KEY>
with the path to the location where your SSH key is stored.
<YOUR_SERVER_IP>
with the IP address of your remote server.
ssh -L 8888:localhost:8888 -p <YOUR_SERVER_PORT> -i <PATH_TO_SSH_KEY> root@<YOUR_SERVER_IP>
Output:
After this copy the URL you received in your remote server:
And paste this on your local browser to access the Jupyter Notebook session.
Step 8: Download and Run the model
- Open a Python notebook inside Jupyter.
2. Download model checkpoints.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "meta-llama/Llama-4-Scout-17B-16E"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto",
)
Output:
The model is quite huge and heavy, so it can take some time to download.
3. Finally, run the model with your desired prompt (and image).
prompt = "Explain Newton's laws of motion to a five year old."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=200,
do_sample=True,
top_p=0.9,
temperature=0.7
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print("\nResponse:\n", response)
Output:
Conclusion
In this article, we’ve explored the advanced capabilities of Meta’s Llama 4 Scout model, highlighting its sophisticated mixture-of-experts architecture and native multimodal processing that enable unparalleled performance in text and image understanding. Deploying such a high-capacity model requires robust and scalable infrastructure. NodeShift’s AI cloud platform plays a crucial role in this context, offering heavy yet affordable GPU resources to easily run huge model like Llama 4 Scout, in a fully private and secure environment. By abstracting the complexities of AI infrastructure, NodeShift ensures that enterprises, developers, and researchers can efficiently harness the power of Llama 4 Scout without compromising on privacy or incurring heavy costs.