Model Overview
Model Features
Model Capabilities
Use Cases
🚀 Llama-3.1-Nemotron-Nano-4B-v1.1
Llama-3.1-Nemotron-Nano-4B-v1.1 is a large language model offering a great balance between accuracy and efficiency. It's suitable for reasoning, chat, and various AI - powered applications.
🚀 Quick Start
Prerequisites
Our code requires the transformers
package version to be 4.44.2
or higher.
Reasoning Mode Control
The reasoning mode (ON/OFF) is controlled via the system prompt, which must be set as shown in the examples below. All instructions should be contained within the user prompt.
Usage Recommendations
- Reasoning ON mode: We recommend setting temperature to
0.6
, and Top P to0.95
. - Reasoning OFF mode: We recommend using greedy decoding.
Example of “Reasoning On”
import torch
import transformers
model_id = "nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1"
model_kwargs = {"torch_dtype": torch.bfloat16, "device_map": "auto"}
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token_id = tokenizer.eos_token_id
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
tokenizer=tokenizer,
max_new_tokens=32768,
temperature=0.6,
top_p=0.95,
**model_kwargs
)
# Thinking can be "on" or "off"
thinking = "on"
print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"}, {"role": "user", "content": "Solve x*(sin(x)+2)=0"}]))
Example of “Reasoning Off”
import torch
import transformers
model_id = "nvidia/Llama-3.1-Nemotron-Nano-4B-v1"
model_kwargs = {"torch_dtype": torch.bfloat16, "device_map": "auto"}
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token_id = tokenizer.eos_token_id
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
tokenizer=tokenizer,
max_new_tokens=32768,
do_sample=False,
**model_kwargs
)
# Thinking can be "on" or "off"
thinking = "off"
print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"}, {"role": "user", "content": "Solve x*(sin(x)+2)=0"}]))
Preventing Unwanted Thinking
For some prompts, even though thinking is disabled, the model may prefer to think before responding. You can prevent it by pre - filling the assistant response.
import torch
import transformers
model_id = "nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1"
model_kwargs = {"torch_dtype": torch.bfloat16, "device_map": "auto"}
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token_id = tokenizer.eos_token_id
# Thinking can be "on" or "off"
thinking = "off"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
tokenizer=tokenizer,
max_new_tokens=32768,
do_sample=False,
**model_kwargs
)
print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"}, {"role": "user", "content": "Solve x*(sin(x)+2)=0"}, {"role":"assistant", "content":"<think>\n</think>"}]))
✨ Features
- High Efficiency: The model fits on a single RTX GPU and can be used locally.
- Large Context Length: Supports a context length of up to 131,072 tokens.
- Multi - language Support: Intended for use in English and coding languages, also supports non - English languages like German, French, Italian, Portuguese, Hindi, Spanish, and Thai.
- Tool - call Support: Supports tool calling and can be used with a vLLM server.
📦 Installation
No specific installation steps are provided in the original document.
💻 Usage Examples
Running a vLLM Server with Tool - call Support
Llama-3.1-Nemotron-Nano-4B-v1.1 supports tool calling. You can use the following methods to launch a vLLM server.
Using Docker
#!/bin/bash
CWD=$(pwd)
PORT=5000
git clone https://huggingface.co/nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1
docker run -it --rm \
--runtime=nvidia \
--gpus all \
--shm-size=16GB \
-p ${PORT}:${PORT} \
-v ${CWD}:${CWD} \
vllm/vllm-openai:v0.6.6 \
--model $CWD/Llama-3.1-Nemotron-Nano-4B-v1.1 \
--trust-remote-code \
--seed 1 \
--host "0.0.0.0" \
--port $PORT \
--served-model-name "Llama-Nemotron-Nano-4B-v1.1" \
--tensor-parallel-size 1 \
--max-model-len 131072 \
--gpu-memory-utilization 0.95 \
--enforce-eager \
--enable-auto-tool-choice \
--tool-parser-plugin "${CWD}/Llama-3.1-Nemotron-Nano-4B-v1.1/llama_nemotron_nano_toolcall_parser.py" \
--tool-call-parser "llama_nemotron_json" \
--chat-template "${CWD}/Llama-3.1-Nemotron-Nano-4B-v1.1/llama_nemotron_nano_generic_tool_calling.jinja"
Using a Virtual Environment
$ git clone https://huggingface.co/nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1
$ conda create -n vllm python=3.12 -y
$ conda activate vllm
$ python -m vllm.entrypoints.openai.api_server \
--model Llama-3.1-Nemotron-Nano-4B-v1.1 \
--trust-remote-code \
--seed 1 \
--host "0.0.0.0" \
--port 5000 \
--served-model-name "Llama-Nemotron-Nano-4B-v1.1" \
--tensor-parallel-size 1 \
--max-model-len 131072 \
--gpu-memory-utilization 0.95 \
--enforce-eager \
--enable-auto-tool-choice \
--tool-parser-plugin "Llama-3.1-Nemotron-Nano-4B-v1.1/llama_nemotron_nano_toolcall_parser.py" \
--tool-call-parser "llama_nemotron_json" \
--chat-template "Llama-3.1-Nemotron-Nano-4B-v1.1/llama_nemotron_nano_generic_tool_calling.jinja"
Calling the vLLM Server with Tool - call Support
>>> from openai import OpenAI
>>> client = OpenAI(
base_url="http://0.0.0.0:5000/v1",
api_key="dummy",
)
>>> completion = client.chat.completions.create(
model="Llama-Nemotron-Nano-4B-v1.1",
messages=[
{"role": "system", "content": "detailed thinking on"},
{"role": "user", "content": "My bill is $100. What will be the amount for 18% tip?"},
],
tools=[
{"type": "function", "function": {"name": "calculate_tip", "parameters": {"type": "object", "properties": {"bill_total": {"type": "integer", "description": "The total amount of the bill"}, "tip_percentage": {"type": "integer", "description": "The percentage of tip to be applied"}}, "required": ["bill_total", "tip_percentage"]}}},
{"type": "function", "function": {"name": "convert_currency", "parameters": {"type": "object", "properties": {"amount": {"type": "integer", "description": "The amount to be converted"}, "from_currency": {"type": "string", "description": "The currency code to convert from"}, "to_currency": {"type": "string", "description": "The currency code to convert to"}}, "required": ["from_currency", "amount", "to_currency"]}}},
],
)
>>> completion.choices[0].message.content
'<think>\nOkay, let\'s see. The user has a bill of $100 and wants to know the amount of a 18% tip. So, I need to calculate the tip amount. The available tools include calculate_tip, which requires bill_total and tip_percentage. The parameters are both integers. The bill_total is 100, and the tip percentage is 18. So, the function should multiply 100 by 18% and return 18.0. But wait, maybe the user wants the total including the tip? The question says "the amount for 18% tip," which could be interpreted as the tip amount itself. Since the function is called calculate_tip, it\'s likely that it\'s designed to compute the tip, not the total. So, using calculate_tip with bill_total=100 and tip_percentage=18 should give the correct result. The other function, convert_currency, isn\'t relevant here. So, I should call calculate_tip with those values.\n</think>\n\n'
>>> completion.choices[0].message.tool_calls
[ChatCompletionMessageToolCall(id='chatcmpl-tool-2972d86817344edc9c1e0f9cd398e999', function=Function(arguments='{"bill_total": 100, "tip_percentage": 18}', name='calculate_tip'), type='function')]
📚 Documentation
Model Overview
Llama-3.1-Nemotron-Nano-4B-v1.1 is a large language model (LLM) derived from nvidia/Llama-3.1-Minitron-4B-Width-Base, which is created from Llama 3.1 8B using our LLM compression technique. It offers improvements in model accuracy and efficiency. It's a reasoning model post - trained for reasoning, human chat preferences, and tasks like RAG and tool calling.
This model is part of the Llama Nemotron Collection. You can find other models in this family here:
This model is ready for commercial use.
License/Terms of Use
GOVERNING TERMS: Your use of this model is governed by the NVIDIA Open Model License. Additional Information: Llama 3.1 Community License Agreement. Built with Llama.
Model Developer: NVIDIA
Model Dates: Trained between August 2024 and May 2025
Data Freshness: The pretraining data has a cutoff of June 2023.
Use Case
Suitable for developers designing AI Agent systems, chatbots, RAG systems, and other AI - powered applications. Also appropriate for typical instruction - following tasks, offering a balance between model accuracy and compute efficiency.
Release Date
5/20/2025
References
- [2408.11796] LLM Pruning and Distillation in Practice: The Minitron Approach
- [2502.00203] Reward - aware Preference Optimization: A Unified Mathematical Framework for Model Alignment
- [2505.00949] Llama - Nemotron: Efficient Reasoning Models
Model Architecture
Property | Details |
---|---|
Architecture Type | Dense decoder - only Transformer model |
Network Architecture | Llama 3.1 Minitron Width 4B Base |
Intended Use
Llama-3.1-Nemotron-Nano-4B-v1.1 is a general - purpose reasoning and chat model for English and coding languages. It also supports other non - English languages (German, French, Italian, Portuguese, Hindi, Spanish, and Thai).
Input
Property | Details |
---|---|
Input Type | Text |
Input Format | String |
Input Parameters | One - Dimensional (1D) |
Other Properties Related to Input | Context length up to 131,072 tokens |
Output
Property | Details |
---|---|
Output Type | Text |
Output Format | String |
Output Parameters | One - Dimensional (1D) |
Other Properties Related to Output | Context length up to 131,072 tokens |
Model Version
1.1 (5/20/2025)
Software Integration
- Runtime Engine: NeMo 24.12
- Recommended Hardware Microarchitecture Compatibility:
- NVIDIA Hopper
- NVIDIA Ampere
Inference
Property | Details |
---|---|
Engine | Transformers |
Test Hardware (BF16) | 1x RTX 50 Series GPUs, 1x RTX 40 Series GPUs, 1x RTX 30 Series GPUs, 1x H100 - 80GB GPU, 1x A100 - 80GB GPU |
Preferred/Supported Operating System(s) | Linux |
Training Datasets
A large variety of training data was used for the post - training pipeline, including manually annotated data and synthetic data.
The data for the multi - stage post - training phases for improvements in Code, Math, and Reasoning is a compilation of SFT and RL data that supports improvements of math, code, general reasoning, and instruction - following capabilities of the original Llama instruct model.
Prompts were sourced from either public and open corpus or synthetically generated. Responses were synthetically generated by a variety of models, with some prompts containing responses for both Reasoning On and Off modes, to train the model to distinguish between the two modes.
Data Collection for Training Datasets: Hybrid: Automated, Human, Synthetic Data Labeling for Training Datasets: N/A
Evaluation Datasets
The document seems incomplete here. It mentions using datasets to evaluate the model but doesn't list them fully.
🔧 Technical Details
This model underwent a multi - phase post - training process to enhance both its reasoning and non - reasoning capabilities. This includes a supervised fine - tuning stage for Math, Code, Reasoning, and Tool Calling as well as multiple reinforcement learning (RL) stages using Reward - aware Preference Optimization (RPO) algorithms for both chat and instruction - following. The final model checkpoint is obtained after merging the final SFT and RPO checkpoints.
📄 License
This model is governed by the NVIDIA Open Model License. Additional Information: Llama 3.1 Community License Agreement.

