Text Generation
Transformers
Safetensors
English
nemotron_h
nvidia
nemotron-cascade-2
reasoning
general-purpose
SFT
RL
conversational
custom_code
Eval Results
Instructions to use nvidia/Nemotron-Cascade-2-30B-A3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/Nemotron-Cascade-2-30B-A3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nvidia/Nemotron-Cascade-2-30B-A3B", 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/Nemotron-Cascade-2-30B-A3B", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("nvidia/Nemotron-Cascade-2-30B-A3B", trust_remote_code=True, device_map="auto") 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/Nemotron-Cascade-2-30B-A3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/Nemotron-Cascade-2-30B-A3B" # 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/Nemotron-Cascade-2-30B-A3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nvidia/Nemotron-Cascade-2-30B-A3B
- SGLang
How to use nvidia/Nemotron-Cascade-2-30B-A3B 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/Nemotron-Cascade-2-30B-A3B" \ --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/Nemotron-Cascade-2-30B-A3B", "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/Nemotron-Cascade-2-30B-A3B" \ --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/Nemotron-Cascade-2-30B-A3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nvidia/Nemotron-Cascade-2-30B-A3B with Docker Model Runner:
docker model run hf.co/nvidia/Nemotron-Cascade-2-30B-A3B
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,384 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: other
|
| 4 |
+
license_name: nvidia-open-model-license
|
| 5 |
+
license_link: >-
|
| 6 |
+
https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
language:
|
| 9 |
+
- en
|
| 10 |
+
tags:
|
| 11 |
+
- nvidia
|
| 12 |
+
- nemotron-cascade-2
|
| 13 |
+
- reasoning
|
| 14 |
+
- general-purpose
|
| 15 |
+
- SFT
|
| 16 |
+
- RL
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# Nemotron-Cascade-2-30B-A3B
|
| 20 |
+
|
| 21 |
+
<p align="center">
|
| 22 |
+
|
| 23 |
+
[](REPORT_LINK)
|
| 24 |
+
[](https://huggingface.co/datasets/nvidia/Nemotron-Cascade-2-SFT)
|
| 25 |
+
[](https://huggingface.co/datasets/nvidia/Nemotron-Cascade-2-RL)
|
| 26 |
+
[](https://huggingface.co/nvidia/Nemotron-Cascade-2-30B-A3B)
|
| 27 |
+
</p>
|
| 28 |
+
|
| 29 |
+
<img src="fig/nemotron-cascade-2-results.png" alt="main_fig" style="width: 1000px; max-width: 100%;" />
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
## Introduction
|
| 33 |
+
We're excited to introduce [Nemotron-Cascade-2-30B-A3B](https://huggingface.co/nvidia/Nemotron-Cascade-2-30B-A3B), an open 30B MoE model with 3B activated parameters that delivers strong reasoning and agentic capabilities. It is post-trained from the [Nemotron-3-Nano-30B-A3B-Base](https://huggingface.co/nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16). Nemotron-Cascade-2-30B-A3B achieves ***gold medal*** performance in both the 2025 International Mathematical Olympiad (IMO) and the International Olympiad in Informatics (IOI). It operates in both **thinking** and **instruct** (non-reasoning) modes.
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
## Benchmark Results
|
| 37 |
+
|
| 38 |
+
<table style="width: 100%; border-collapse: collapse; font-family: sans-serif;">
|
| 39 |
+
<thead>
|
| 40 |
+
<tr style="color: #76B900; text-align: center;">
|
| 41 |
+
<th style="padding: 8px; text-align: left;">Benchmark Metric: pass@1</th>
|
| 42 |
+
<th style="padding: 8px; text-align: center">Nemotron-3-Nano-30B-A3B</th>
|
| 43 |
+
<th style="padding: 8px; text-align: center">Nemotron-3-Super-120B-A12B</th>
|
| 44 |
+
<th style="padding: 8px; text-align: center">Qwen3.5-35B-A3B</th>
|
| 45 |
+
<th style="padding: 8px; text-align: center">Nemotron-Cascade-2-30B-A3B</th>
|
| 46 |
+
</tr>
|
| 47 |
+
</thead>
|
| 48 |
+
<tbody style="text-align: center;">
|
| 49 |
+
<tr style="text-align: left; font-weight: bold;">
|
| 50 |
+
<td colspan="5" style="padding: 8px; color: #76B900">Math</td>
|
| 51 |
+
</tr>
|
| 52 |
+
<tr>
|
| 53 |
+
<td style="text-align: left; padding: 4px 8px;">IMO 2025</td>
|
| 54 |
+
<td>-</td><td>-</td><td>-</td><td>🏅 <b>35 pts</b></td>
|
| 55 |
+
</tr>
|
| 56 |
+
<tr>
|
| 57 |
+
<td style="text-align: left; padding: 4px 8px;">IMO AnswerBench</td>
|
| 58 |
+
<td>70.4‡</td><td>77.2‡</td><td>74.8‡</td><td>79.3</td>
|
| 59 |
+
</tr>
|
| 60 |
+
<tr>
|
| 61 |
+
<td style="text-align: left; padding: 4px 8px;">IMO ProofBench</td>
|
| 62 |
+
<td>-</td><td>-</td><td>-</td><td>72.9</td>
|
| 63 |
+
</tr>
|
| 64 |
+
<tr>
|
| 65 |
+
<td style="text-align: left; padding: 4px 8px;">AIME 2025</td>
|
| 66 |
+
<td>89.1</td><td>90.2</td><td>91.9‡</td><td>92.4 (98.6)†</td>
|
| 67 |
+
</tr>
|
| 68 |
+
<tr>
|
| 69 |
+
<td style="text-align: left; padding: 4px 8px;">AIME 2026</td>
|
| 70 |
+
<td>89.9‡</td><td>89.8‡</td><td>91.1‡</td><td>90.9 (95.0)†</td>
|
| 71 |
+
</tr>
|
| 72 |
+
<tr>
|
| 73 |
+
<td style="text-align: left; padding: 4px 8px;">HMMT Feb25</td>
|
| 74 |
+
<td>84.6‡</td><td>93.7</td><td>89.0</td><td>94.6</td>
|
| 75 |
+
</tr>
|
| 76 |
+
<tr style="text-align: left; font-weight: bold;">
|
| 77 |
+
<td colspan="5" style="padding: 8px; color: #76B900">Code Reasoning</td>
|
| 78 |
+
</tr>
|
| 79 |
+
<tr>
|
| 80 |
+
<td style="text-align: left; padding: 4px 8px;">IOI 2025</td>
|
| 81 |
+
<td>-</td><td>-</td><td>348.6‡</td><td>🏅 <b>438.9</b></td>
|
| 82 |
+
</tr>
|
| 83 |
+
<tr>
|
| 84 |
+
<td style="text-align: left; padding: 4px 8px;">ICPC World Finals 2025</td>
|
| 85 |
+
<td>-</td><td>-</td><td>-</td><td>🏅 <b>10/12</b></td>
|
| 86 |
+
</tr>
|
| 87 |
+
<tr>
|
| 88 |
+
<td style="text-align: left; padding: 4px 8px;">LiveCodeBench v6 (2408-2505)</td>
|
| 89 |
+
<td>68.3</td><td>78.7</td><td>74.6</td><td>87.2 (88.4)†</td>
|
| 90 |
+
</tr>
|
| 91 |
+
<tr>
|
| 92 |
+
<td style="text-align: left; padding: 4px 8px;">LiveCodeBenchPro 25Q2 (Easy)</td>
|
| 93 |
+
<td>54.5‡</td><td>81.7‡</td><td>81.1‡</td><td>87.0 (89.3)†</td>
|
| 94 |
+
</tr>
|
| 95 |
+
<tr>
|
| 96 |
+
<td style="text-align: left; padding: 4px 8px;">LiveCodeBenchPro 25Q2 (Med)</td>
|
| 97 |
+
<td>3.50‡</td><td>23.2‡</td><td>17.8‡</td><td>27.6 (36.8)†</td>
|
| 98 |
+
</tr>
|
| 99 |
+
<tr>
|
| 100 |
+
<td style="text-align: left; padding: 4px 8px;">SciCode</td>
|
| 101 |
+
<td>33.3</td><td>42.1</td><td>38.0</td><td>36.4</td>
|
| 102 |
+
</tr>
|
| 103 |
+
<tr style="text-align: left; font-weight: bold;">
|
| 104 |
+
<td colspan="5" style="padding: 8px; color: #76B900">Knowledge & STEM</td>
|
| 105 |
+
</tr>
|
| 106 |
+
<tr>
|
| 107 |
+
<td style="text-align: left; padding: 4px 8px;">MMLU-Redux</td>
|
| 108 |
+
<td>-</td><td>-</td><td>93.3</td><td>86.3</td>
|
| 109 |
+
</tr>
|
| 110 |
+
<tr>
|
| 111 |
+
<td style="text-align: left; padding: 4px 8px;">MMLU-Pro</td>
|
| 112 |
+
<td>78.3</td><td>83.7</td><td>85.3</td><td>79.8</td>
|
| 113 |
+
</tr>
|
| 114 |
+
<tr>
|
| 115 |
+
<td style="text-align: left; padding: 4px 8px;">GPQA-Diamond</td>
|
| 116 |
+
<td>73.0</td><td>79.2</td><td>84.2</td><td>76.1</td>
|
| 117 |
+
</tr>
|
| 118 |
+
<tr>
|
| 119 |
+
<td style="text-align: left; padding: 4px 8px;">HLE (no tool)</td>
|
| 120 |
+
<td>10.6</td><td>18.3</td><td>22.4</td><td>17.7</td>
|
| 121 |
+
</tr>
|
| 122 |
+
<tr style="text-align: left; font-weight: bold;">
|
| 123 |
+
<td colspan="5" style="padding: 8px; color: #76B900">Alignment & Instruction Following</td>
|
| 124 |
+
</tr>
|
| 125 |
+
<tr>
|
| 126 |
+
<td style="text-align: left; padding: 4px 8px;">ArenaHard v2 (Avg.)</td>
|
| 127 |
+
<td>67.7</td><td>-</td><td>65.4‡</td><td>83.5</td>
|
| 128 |
+
</tr>
|
| 129 |
+
<tr>
|
| 130 |
+
<td style="text-align: left; padding: 4px 8px;"> – Hard Prompt</td>
|
| 131 |
+
<td>72.1</td><td>73.9</td><td>64.5‡</td><td>88.2</td>
|
| 132 |
+
</tr>
|
| 133 |
+
<tr>
|
| 134 |
+
<td style="text-align: left; padding: 4px 8px;"> – Creative Writing</td>
|
| 135 |
+
<td>63.2</td><td>-</td><td>66.3‡</td><td>78.7</td>
|
| 136 |
+
</tr>
|
| 137 |
+
<tr>
|
| 138 |
+
<td style="text-align: left; padding: 4px 8px;">IFBench (prompt)</td>
|
| 139 |
+
<td>71.5</td><td>72.6</td><td>70.2</td><td>82.9</td>
|
| 140 |
+
</tr>
|
| 141 |
+
<tr>
|
| 142 |
+
<td style="text-align: left; padding: 4px 8px;">Scale AI Multi-Challenge</td>
|
| 143 |
+
<td>38.5</td><td>55.2</td><td>60.0</td><td>45.3</td>
|
| 144 |
+
</tr>
|
| 145 |
+
<tr style="text-align: left; font-weight: bold;">
|
| 146 |
+
<td colspan="5" style="padding: 8px; color: #76B900">Long Context & Context Learning</td>
|
| 147 |
+
</tr>
|
| 148 |
+
<tr>
|
| 149 |
+
<td style="text-align: left; padding: 4px 8px;">AA-LCR</td>
|
| 150 |
+
<td>35.9</td><td>58.3</td><td>58.5</td><td>39.1</td>
|
| 151 |
+
</tr>
|
| 152 |
+
<tr>
|
| 153 |
+
<td style="text-align: left; padding: 4px 8px;">LongBench v2</td>
|
| 154 |
+
<td>39.6</td><td>-</td><td>59.0</td><td>40.3</td>
|
| 155 |
+
</tr>
|
| 156 |
+
<tr>
|
| 157 |
+
<td style="text-align: left; padding: 4px 8px;">NIAH@1M (RULER Subset)</td>
|
| 158 |
+
<td>94.8</td><td>98.3</td><td>94.3‡</td><td>99.0</td>
|
| 159 |
+
</tr>
|
| 160 |
+
<tr>
|
| 161 |
+
<td style="text-align: left; padding: 4px 8px;">CL-Bench</td>
|
| 162 |
+
<td>12.0‡</td><td>-</td><td>15.5‡</td><td>12.2</td>
|
| 163 |
+
</tr>
|
| 164 |
+
<tr style="text-align: left; font-weight: bold;">
|
| 165 |
+
<td colspan="5" style="padding: 8px; color: #76B900">Agentic</td>
|
| 166 |
+
</tr>
|
| 167 |
+
<tr>
|
| 168 |
+
<td style="text-align: left; padding: 4px 8px;">BFCL v4</td>
|
| 169 |
+
<td>53.8</td><td>-</td><td>67.3</td><td>52.9</td>
|
| 170 |
+
</tr>
|
| 171 |
+
<tr>
|
| 172 |
+
<td style="text-align: left; padding: 4px 8px;">𝜏²-Bench</td>
|
| 173 |
+
<td>49.0</td><td>61.2</td><td>81.2</td><td>58.9</td>
|
| 174 |
+
</tr>
|
| 175 |
+
<tr>
|
| 176 |
+
<td style="text-align: left; padding: 4px 8px;">Terminal Bench 2.0</td>
|
| 177 |
+
<td>8.5</td><td>31.0</td><td>40.5</td><td>21.1</td>
|
| 178 |
+
</tr>
|
| 179 |
+
<tr>
|
| 180 |
+
<td style="text-align: left; padding: 4px 8px;">SWE Verified (OpenHands)</td>
|
| 181 |
+
<td>38.8</td><td>60.5</td><td>69.2</td><td>50.2</td>
|
| 182 |
+
</tr>
|
| 183 |
+
<tr style="text-align: left; font-weight: bold;">
|
| 184 |
+
<td colspan="5" style="padding: 8px; color: #76B900">Multilingual</td>
|
| 185 |
+
</tr>
|
| 186 |
+
<tr>
|
| 187 |
+
<td style="text-align: left; padding: 4px 8px;">MMLU-ProX</td>
|
| 188 |
+
<td>59.5</td><td>79.4</td><td>81.0</td><td>72.5</td>
|
| 189 |
+
</tr>
|
| 190 |
+
<tr>
|
| 191 |
+
<td style="text-align: left; padding: 4px 8px;">WMT24++ (en -> xx)</td>
|
| 192 |
+
<td>86.2</td><td>86.7</td><td>87.6‡</td><td>84.1</td>
|
| 193 |
+
</tr>
|
| 194 |
+
</tbody>
|
| 195 |
+
</table>
|
| 196 |
+
|
| 197 |
+
<p style="margin-top:12px;font-size:11px;opacity:0.7">
|
| 198 |
+
* † Numbers in brackets refers to Tool-Integrated Reasoning (TIR) results.<br>
|
| 199 |
+
* ‡ For the baseline models, we use official numbers when available, otherwise evaluate them using the recommended settings.<br>
|
| 200 |
+
</p>
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
## Quick Start
|
| 204 |
+
|
| 205 |
+
- Nemotron-Cascade-2-30B-A3B follows the ChatML template and supports both thinking and instruct (non-reasoning) modes. Reasoning content is enclosed within `<think>` and `</think>` tags. To activate the instruct (non-reasoning) mode, we prepend `<think></think>` to the beginning of the assistant’s response.
|
| 206 |
+
|
| 207 |
+
- To reduce the context length in a multi-turn conversation, when the previous user turn involves thinking mode, only the final summary of the model's output will be added to the conversation history.
|
| 208 |
+
|
| 209 |
+
- Note that we do not define a separate `tool` role for tool responses; instead, we place them under the `user` role and warp them with `<tool_response>` and `</tool_response>`.
|
| 210 |
+
|
| 211 |
+
- We recommend setting the sampling parameters to temperature = 1.0 and top_p = 0.95.
|
| 212 |
+
|
| 213 |
+
### Chat Template
|
| 214 |
+
|
| 215 |
+
```python
|
| 216 |
+
from transformers import AutoTokenizer
|
| 217 |
+
|
| 218 |
+
model_name = 'nvidia/Nemotron-Cascade-2-30B-A3B'
|
| 219 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 220 |
+
|
| 221 |
+
'''
|
| 222 |
+
single-turn example
|
| 223 |
+
'''
|
| 224 |
+
messages = [
|
| 225 |
+
{"role": "system", "content": "You are a helpful and harmless assistant.\n\nYou are not allowed to use any tools"},
|
| 226 |
+
{"role": "user", "content": "calculate 1+1?"}
|
| 227 |
+
]
|
| 228 |
+
|
| 229 |
+
# thinking mode
|
| 230 |
+
prompt_thinking = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=True)
|
| 231 |
+
# prompt_thinking = '<|im_start|>system\nYou are a helpful and harmless assistant.\n\nYou are not allowed to use any tools<|im_end|>\n<|im_start|>user\ncalculate 1+1?<|im_end|>\n<|im_start|>assistant\n<think>\n'
|
| 232 |
+
|
| 233 |
+
# instruct mode
|
| 234 |
+
prompt_instruct = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
|
| 235 |
+
# prompt_instruct = '<|im_start|>system\nYou are a helpful and harmless assistant.\n\nYou are not allowed to use any tools<|im_end|>\n<|im_start|>user\ncalculate 1+1?<|im_end|>\n<|im_start|>assistant\n<think></think>'
|
| 236 |
+
|
| 237 |
+
'''
|
| 238 |
+
multi-turn example
|
| 239 |
+
'''
|
| 240 |
+
messages = [
|
| 241 |
+
{"role": "system", "content": "You are a helpful and harmless assistant.\n\nYou are not allowed to use any tools"},
|
| 242 |
+
{"role": "user", "content": "calculate 1+1?"},
|
| 243 |
+
{"role": "assistant", "content": "<think>THINKING_CONTENT</think>\nTo calculate \\(1 + 1\\):\n\n1. **Identify the operation**: This is a basic addition problem involving two integers.\n2. **Perform the addition**: \n \\(1 + 1 = 2\\).\n\n**Result**: \\(\\boxed{2}\\)",},
|
| 244 |
+
{"role": "user", "content": "what about 2+2"}
|
| 245 |
+
]
|
| 246 |
+
|
| 247 |
+
# thinking mode
|
| 248 |
+
prompt_thinking = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=True)
|
| 249 |
+
# prompt_thinking = '<|im_start|>system\nYou are a helpful and harmless assistant.\n\nYou are not allowed to use any tools<|im_end|>\n<|im_start|>user\ncalculate 1+1?<|im_end|>\n<|im_start|>assistant\n<think></think>\nTo calculate \\(1 + 1\\):\n\n1. **Identify the operation**: This is a basic addition problem involving two integers.\n2. **Perform the addition**: \n \\(1 + 1 = 2\\).\n\n**Result**: \\(\\boxed{2}\\)<|im_end|>\n<|im_start|>user\nwhat about 2+2<|im_end|>\n<|im_start|>assistant\n<think>\n'
|
| 250 |
+
|
| 251 |
+
# instruct mode
|
| 252 |
+
prompt_instruct = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
|
| 253 |
+
# prompt_instruct = '<|im_start|>system\nYou are a helpful and harmless assistant.\n\nYou are not allowed to use any tools<|im_end|>\n<|im_start|>user\ncalculate 1+1?<|im_end|>\n<|im_start|>assistant\n<think></think>\nTo calculate \\(1 + 1\\):\n\n1. **Identify the operation**: This is a basic addition problem involving two integers.\n2. **Perform the addition**: \n \\(1 + 1 = 2\\).\n\n**Result**: \\(\\boxed{2}\\)<|im_end|>\n<|im_start|>user\nwhat about 2+2<|im_end|>\n<|im_start|>assistant\n<think></think>'
|
| 254 |
+
```
|
| 255 |
+
|
| 256 |
+
### Python Tool Use
|
| 257 |
+
|
| 258 |
+
```python
|
| 259 |
+
model_name = 'nvidia/Nemotron-Cascade-2-30B-A3B'
|
| 260 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 261 |
+
|
| 262 |
+
SYSTEM_PROMPT = """# Tools
|
| 263 |
+
|
| 264 |
+
You have access to the following functions:
|
| 265 |
+
|
| 266 |
+
<tools>
|
| 267 |
+
<function>
|
| 268 |
+
<name>stateful_python_code_exec</name>
|
| 269 |
+
<description>Call this function to execute Python code in a stateful Jupyter notebook environment. Python will respond with the output of the execution or time out after 120.0 seconds.</description>
|
| 270 |
+
<parameters>
|
| 271 |
+
<parameter>
|
| 272 |
+
<name>code</name>
|
| 273 |
+
<type>string</type>
|
| 274 |
+
<description>Code to execute</description>
|
| 275 |
+
</parameter>
|
| 276 |
+
<required>["code"]</required>
|
| 277 |
+
</parameters>
|
| 278 |
+
</function>
|
| 279 |
+
</tools>
|
| 280 |
+
|
| 281 |
+
If you choose to call a function ONLY reply in the following format with NO suffix:
|
| 282 |
+
|
| 283 |
+
<tool_call>
|
| 284 |
+
<function=example_function_name>
|
| 285 |
+
<parameter=example_parameter_1>
|
| 286 |
+
value_1
|
| 287 |
+
</parameter>
|
| 288 |
+
<parameter=example_parameter_2>
|
| 289 |
+
This is the value for the second parameter
|
| 290 |
+
that can span
|
| 291 |
+
multiple lines
|
| 292 |
+
</parameter>
|
| 293 |
+
</function>
|
| 294 |
+
</tool_call>
|
| 295 |
+
|
| 296 |
+
<IMPORTANT>
|
| 297 |
+
Reminder:
|
| 298 |
+
- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags
|
| 299 |
+
- Required parameters MUST be specified
|
| 300 |
+
- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after
|
| 301 |
+
- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls
|
| 302 |
+
</IMPORTANT>"""
|
| 303 |
+
|
| 304 |
+
messages = [
|
| 305 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 306 |
+
{"role": "user", "content": "Solve the following math problem. Put your answer inside \\boxed{}.\n\nIn a school with 2008 students, each student is a member of certain committees. Each committee has at most 1004 members, and every two students are in at least one common committee. Determine the smallest possible number of committees in the school."}
|
| 307 |
+
]
|
| 308 |
+
|
| 309 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=True)
|
| 310 |
+
print(prompt)
|
| 311 |
+
```
|
| 312 |
+
|
| 313 |
+
### Agentic Usage
|
| 314 |
+
|
| 315 |
+
```python
|
| 316 |
+
model_name = 'nvidia/Nemotron-Cascade-2-30B-A3B'
|
| 317 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 318 |
+
|
| 319 |
+
SYSTEM_PROMPT = """You are a customer service agent that helps the user. The policy that determines how you should respond to requests from users is described below between the <policy> and </policy> tags.
|
| 320 |
+
|
| 321 |
+
In each turn you can either:
|
| 322 |
+
- Send a message to the user.
|
| 323 |
+
- Make a tool call.
|
| 324 |
+
You cannot do both at the same time.
|
| 325 |
+
|
| 326 |
+
<policy>
|
| 327 |
+
_NEED_TO_ADD_POLICY_HERE_
|
| 328 |
+
</policy>
|
| 329 |
+
|
| 330 |
+
Try to be helpful and always follow the policy.
|
| 331 |
+
|
| 332 |
+
# Tools
|
| 333 |
+
|
| 334 |
+
You have access to the following functions:
|
| 335 |
+
|
| 336 |
+
<tools>
|
| 337 |
+
<function>
|
| 338 |
+
<name>_NEED_TO_ADD_FUNCTION_NAME_1_</name>
|
| 339 |
+
<description>_FUNCTION_DESCRIPTION_</description>
|
| 340 |
+
<parameters>
|
| 341 |
+
<parameter>
|
| 342 |
+
<name>_NEED_TO_ADD_PARAMETER_NAME_1_</name>
|
| 343 |
+
<type>_PARAMETER_TYPE_</type>
|
| 344 |
+
<description>_PARAMETER_DESCRIPTION_</description>
|
| 345 |
+
<title>_PARAMETER_TITLE_</title>
|
| 346 |
+
</parameter>
|
| 347 |
+
<parameter>
|
| 348 |
+
<name>_NEED_TO_ADD_PARAMETER_NAME_2_</name>
|
| 349 |
+
<type>_PARAMETER_TYPE_</type>
|
| 350 |
+
<description>_PARAMETER_DESCRIPTION_</description>
|
| 351 |
+
<title>_PARAMETER_TITLE_</title>
|
| 352 |
+
</parameter>
|
| 353 |
+
...... (_MORE_PARAMETERS_TO_ADD_)
|
| 354 |
+
<parameters>
|
| 355 |
+
</function>
|
| 356 |
+
...... (_MORE_FUNCTIONS_TO_ADD_)
|
| 357 |
+
</tools>
|
| 358 |
+
"""
|
| 359 |
+
|
| 360 |
+
messages = [
|
| 361 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 362 |
+
{"role": "user", "content": "Hello, I'm calling regarding my upcoming stay at your hotel. My guest ID is G90920 and booking ID is B11246 for a Deluxe room on June 5th. I'm traveling with three 6-month-old triplets and need to request three infant cribs for our room. It's currently 30 hours before check-in—could you please confirm if this is feasible and if there are quiet room options available for families with infants?"}
|
| 363 |
+
]
|
| 364 |
+
|
| 365 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=True)
|
| 366 |
+
print(prompt)
|
| 367 |
+
```
|
| 368 |
+
|
| 369 |
+
## Release Date
|
| 370 |
+
Mar 19, 2026
|
| 371 |
+
|
| 372 |
+
|
| 373 |
+
## License
|
| 374 |
+
Your use of this model is governed by the [NVIDIA Open Model License](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/).
|
| 375 |
+
|
| 376 |
+
|
| 377 |
+
## Citation
|
| 378 |
+
```
|
| 379 |
+
@article{Nemotron_Cascade_2,
|
| 380 |
+
title={Nemotron-Cascade 2: Post-Training LLMs with Cascade RL and Multi-Domain On-Policy Distillation},
|
| 381 |
+
author={Yang, Zhuolin and Liu, Zihan and Chen, Yang and Dai, Wenliang and Wang, Boxin and Lin, Sheng-Chieh and Lee, Chankyu and Chen, Yangyi and Jiang, Dongfu and He, Jiafan and Pi, Renjie and Lam, Grace and Lee, Nayeon and Bukharin, Alexander and Shoeybi, Mohammad and Catanzaro, Bryan and Ping, Wei},
|
| 382 |
+
year={2026}
|
| 383 |
+
}
|
| 384 |
+
```
|