Instructions to use meta-llama/Llama-4-Scout-17B-16E with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use meta-llama/Llama-4-Scout-17B-16E with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="meta-llama/Llama-4-Scout-17B-16E") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("meta-llama/Llama-4-Scout-17B-16E") model = AutoModelForMultimodalLM.from_pretrained("meta-llama/Llama-4-Scout-17B-16E") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use meta-llama/Llama-4-Scout-17B-16E with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "meta-llama/Llama-4-Scout-17B-16E" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meta-llama/Llama-4-Scout-17B-16E", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/meta-llama/Llama-4-Scout-17B-16E
- SGLang
How to use meta-llama/Llama-4-Scout-17B-16E with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "meta-llama/Llama-4-Scout-17B-16E" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meta-llama/Llama-4-Scout-17B-16E", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "meta-llama/Llama-4-Scout-17B-16E" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meta-llama/Llama-4-Scout-17B-16E", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use meta-llama/Llama-4-Scout-17B-16E with Docker Model Runner:
docker model run hf.co/meta-llama/Llama-4-Scout-17B-16E
Access rejected
Hi, I've requested access and it was rejected. what is the reason for the reject?
Anyone else ran into this?
same i am facing this issue also
I'm finding it frustrating that I'm not receiving a response regarding the reason for the refusal of access to models 3.1, 3.2, 3.3, and 4. As an independent researcher/developer, I was expecting a more straightforward process. I simply provided my first and last name in the form as requested, and I'm certain I didn't make any mistakes. It's disappointing to be left without any feedback or explanation. Furthermore, I don't see a way to resubmit my request or correct any potential errors. It's worth noting that I do have access to the models on the Meta website, but using Hugging Face is more convenient for installation and integration into my projects. Could you please provide some insight into what might have gone wrong? I'm looking forward to understanding the issue and potentially resolving it.
Got the problem that the request access has been rejected. i have successfully managed to apply 1-3 LLAMA series but was rejected by LLAMA 4 without any explanation.
Ditto. Have access to multiple previous versions but was rejected for Llama 4. Have no idea why and have no idea how to resolve. Anybody know of an up-to-date script to convert the Meta checkpoints (.pth) to HF format (.safetensors)?
I was rejected without any explanation. My colleague sitting next to me got approved right away.
Is there any way I can reapply?
I was rejected without any explanation. My colleague sitting next to me got approved right away.
Is there any way I can reapply?
Lol, it's like in one of those movie scenes where the security guy lets in pretty girls, but then a bunch of guys he doesn't like show up and he instantly goes from: 🥰 to: 😡 and is like "Stop right there, you're not cool enough for this club!"
Same here I am also rejected and unable to find any issue with the form submitted.