Image-Text-to-Text
Transformers
Safetensors
PyTorch
llama4
facebook
meta
llama
conversational
text-generation-inference
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
test pr - will close
#47 opened about 1 month ago
by
SECONDACCOUNT69
Request: DOI
1
#45 opened 6 months ago
by
Hanwen9560
Scout and the quiet architecture of perception
#44 opened 8 months ago
by
elly99
Error while deserializing header
#43 opened 8 months ago
by
lexipalmer13
Throwing error on image url as input
1
#42 opened 9 months ago
by
adityaraaz2611
Request: Permission
#40 opened 12 months ago
by
dsuram
Request: DOI
#39 opened about 1 year ago
by
bayarjargal
My access request is pending since last 14 hours. Please help.
👍 1
4
#37 opened about 1 year ago
by
brando
Access request pending
#36 opened about 1 year ago
by
saprativa
Update README.md
#35 opened about 1 year ago
by
kkkkkkjjjj
Model does not load evenly on all available GPUs device_map= auto leading to OOM
2
#34 opened about 1 year ago
by
sugunav14
Running into a tensor size error
2
#33 opened about 1 year ago
by
AaronVogler
Can't run on a single H100
➕ 1
6
#27 opened about 1 year ago
by
jvieirasobrinho
Cannot generate with BS > 1
1
#25 opened about 1 year ago
by
chenjiel
Unable to run with vllm
➕ 8
#24 opened about 1 year ago
by
rdodev
Confirm prohibited EU hosting
👍 3
2
#20 opened about 1 year ago
by
andrej-schreiner
🔥🔥🔥中文测评视频
🔥 1
#19 opened about 1 year ago
by
leo009
Access rejected
8
#18 opened about 1 year ago
by
sruthikesh
[request for feedback] Faster downloads with Xet
#17 opened about 1 year ago
by
clem
Are these the pre-trained or mid-trained models?
#16 opened about 1 year ago
by
deltanym
Thanks!
🤝 1
#15 opened about 1 year ago
by
FalconNet
License
1
#14 opened about 1 year ago
by
mrfakename