Instructions to use nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1
- SGLang
How to use nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1 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 "nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1 with Docker Model Runner:
docker model run hf.co/nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1
Question about warning when loading model
#1
by harpreetsahota - opened
Hi,
When I load the model, I see this warning:
No pretrained configuration specified for vit_huge_patch16_224 model. Using a default. Please add a config to the model pretrained_cfg registry or pass explicitly.
Some weights of Llama_Nemotron_Nano_VL were not initialized from the model checkpoint at <path> and are newly initialized: ['vision_model.radio_model.summary_idxs']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
Just wanted to make sure this is ok
Cheers
Hi. Yes, that should be okay. We don't use summary_idxs for this model.
harpreetsahota changed discussion status to closed