Instructions to use nvidia/NVIDIA-Nemotron-Nano-9B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/NVIDIA-Nemotron-Nano-9B-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nvidia/NVIDIA-Nemotron-Nano-9B-v2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nvidia/NVIDIA-Nemotron-Nano-9B-v2", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("nvidia/NVIDIA-Nemotron-Nano-9B-v2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nvidia/NVIDIA-Nemotron-Nano-9B-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/NVIDIA-Nemotron-Nano-9B-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/NVIDIA-Nemotron-Nano-9B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nvidia/NVIDIA-Nemotron-Nano-9B-v2
- SGLang
How to use nvidia/NVIDIA-Nemotron-Nano-9B-v2 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/NVIDIA-Nemotron-Nano-9B-v2" \ --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": "nvidia/NVIDIA-Nemotron-Nano-9B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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/NVIDIA-Nemotron-Nano-9B-v2" \ --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": "nvidia/NVIDIA-Nemotron-Nano-9B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nvidia/NVIDIA-Nemotron-Nano-9B-v2 with Docker Model Runner:
docker model run hf.co/nvidia/NVIDIA-Nemotron-Nano-9B-v2
TemporalMesh Transformer: 29.4 PPL at 48% compute — beats Mamba, new open-source architecture
#38 opened about 1 month ago
by
vigneshwar234
Update Nemotron vLLM tool parser examples
#37 opened 2 months ago
by
dongwng
Fix modeling_nemotron_h.py
#28 opened 9 months ago
by
rrs1616
NVIDIA-Nemotron-Nano-9B-v2 with Docker
🤗 1
#27 opened 10 months ago
by
MOHASOFT
Add Streaming Tool Calling support
#26 opened 10 months ago
by
crisafullifr
What inference setting for coding?
1
#25 opened 10 months ago
by
akierum
Can we have more detailed instructions on installing dependencies?
➕ 2
1
#24 opened 10 months ago
by
steveheh
Update README.md
#23 opened 11 months ago
by
sudoping01
Any plans to release the training recipe?
👍👀 5
2
#21 opened 11 months ago
by
nskwal
Request: DOI
#19 opened 11 months ago
by
itsAmmar
feat: Add CPU support
#18 opened 11 months ago
by
gabegoodhart
I think yall can afford to benchmark Qwen 3 8B
👍 1
1
#17 opened 11 months ago
by
owenqwenllmwine
Slower than Qwen3-8B despite claimed 3x inference speedup
9
#16 opened 11 months ago
by
coszeros
sad! no tool calls in streaming mode.
#15 opened 11 months ago
by
j4ys0n
HybridMambaAttentionDynamicCache is not valid?
➕ 2
2
#14 opened 11 months ago
by
GentleLiu
Any plans for MLX support?
1
#12 opened 11 months ago
by
Alealejandrooo
some problem when I asked the model: 你是谁?
🤯 2
3
#8 opened 11 months ago
by
wenzel94
OOM with vllm==0.10.1 on GPU L40S
2
#7 opened 11 months ago
by
qingfu
GGUF support
❤️ 4
18
#4 opened 11 months ago
by
RedEyed
This just trades general performance for domain specific gains.
🔥👍 16
11
#3 opened 11 months ago
by
phil111