# NVIDIA Nemotron 3 Nano - 运行指南

NVIDIA 发布 **Nemotron-3-Nano-4B**，一款遵循 [Nemotron-3-Super-120B-A12B](https://unsloth.ai/docs/zh/mo-xing/nemotron-3/nemotron-3-super) 和 Nemotron-3-Nano-30B-A3B 的 4B 开源混合 MoE 模型。Nemotron 家族专为快速、准确的编程、数学和智能体工作负载而设计。它们具有 **100 万 token 上下文** 窗口，并在推理、聊天和吞吐量基准测试中表现出竞争力。

Nemotron-3-Nano-4B 运行在 **5GB** 的 RAM、VRAM 或统一内存上。Nemotron-3-Nano-30A3B 运行在 **24GB** RAM 上。Nemotron 3 现在可以通过 [Unsloth](https://github.com/unslothai/unsloth)在本地进行微调。感谢 NVIDIA 为 Unsloth 提供首日支持。

<a href="#run-nemotron-3-nano-4b" class="button primary">Nemotron-3-Nano-4B</a><a href="#run-nemotron-3-nano-30b-a3b" class="button primary">Nemotron-3-Nano-30B-A3B</a><a href="https://docs.unsloth.ai/models/nemotron-3#fine-tuning-nemotron-3-nano-and-rl" class="button secondary">Nemotron 3 的微调</a>

| [Nemotron-3-Nano-**4B**-GGUF](https://huggingface.co/unsloth/NVIDIA-Nemotron-3-Nano-4B-GGUF) | [Nemotron-3-**Nano-30B-A3B**-GGUF](https://huggingface.co/unsloth/Nemotron-3-Nano-30B-A3B-GGUF) |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |

### ⚙️ 使用指南

NVIDIA 建议以下推理设置：

{% columns %}
{% column %}
**通用聊天/指令（默认）：**

* `temperature = 1.0`
* `top_p = 1.0`
  {% endcolumn %}

{% column %}
**工具调用用例：**

* `temperature = 0.6`
* `top_p = 0.95`
  {% endcolumn %}
  {% endcolumns %}

**对于大多数本地使用，请设置：**

* `max_new_tokens` = `32,768` 为 `262,144` 用于最大 100 万 token 的标准提示词
* 根据你的 RAM/VRAM 允许的范围，可增加用于深度推理或长文本生成。

聊天模板格式可在使用以下内容时找到：

{% code overflow="wrap" %}

```python
tokenizer.apply_chat_template([
    {"role" : "user", "content" : "1+1 等于多少？"},
    {"role" : "assistant", "content" : "2"},
    {"role" : "user", "content" : "2+2 等于多少？"}
    ], add_generation_prompt = True, tokenize = False,
)
```

{% endcode %}

{% hint style="success" %}
由于该模型使用 NoPE 训练，你只需要更改 `max_position_embeddings`。该模型不使用显式位置嵌入，因此不需要 YaRN。
{% endhint %}

#### Nemotron 3 聊天模板格式：

{% hint style="info" %}
Nemotron 3 使用 `<think>` ，其 token ID 为 12，以及 `</think>` ，其 token ID 为 13，用于推理。使用 `--special` 查看 llama.cpp 的 token。你可能还需要 `--verbose-prompt` 来查看 `<think>` ，因为它是前置添加的。
{% endhint %}

{% code overflow="wrap" lineNumbers="true" %}

```
<|im_start|>system\n<|im_end|>\n<|im_start|>user\n1+1 等于多少？<|im_end|>\n<|im_start|>assistant\n<think></think>2<|im_end|>\n<|im_start|>user\n2+2 等于多少？<|im_end|>\n<|im_start|>assistant\n<think>\n
```

{% endcode %}

## 🖥️ 运行 Nemotron-3-Nano-4B

根据你的使用场景，你需要使用不同的设置。由于模型架构（如 [gpt-oss](https://unsloth.ai/docs/zh/mo-xing/gpt-oss-how-to-run-and-fine-tune)）的某些维度不能被 128 整除，因此某些部分无法量化到更低位。

该模型的 4 位版本需要约 3GB RAM。8 位需要 5GB。

### 🦥 Unsloth Studio 指南

Nemotron 3 可以在 [Unsloth Studio](https://unsloth.ai/docs/zh/xin-zeng/studio)中运行和微调，这是我们新推出的本地 AI 开源 Web UI。使用 Unsloth Studio，你可以在以下平台本地运行模型： **MacOS、Windows**、Linux，以及：

{% columns %}
{% column %}

* 搜索、下载、 [运行 GGUF](https://unsloth.ai/docs/zh/xin-zeng/studio#run-models-locally) 和 safetensor 模型
* [**自我修复** 工具调用](https://unsloth.ai/docs/zh/xin-zeng/studio#execute-code--heal-tool-calling) + **网页搜索**
* [**代码执行**](https://unsloth.ai/docs/zh/xin-zeng/studio#run-models-locally) （Python、Bash）
* [自动推理](https://unsloth.ai/docs/zh/xin-zeng/studio#model-arena) 参数调优（temp、top-p 等）
* 通过 llama.cpp 实现快速 CPU + GPU 推理
* [训练 LLM](https://unsloth.ai/docs/zh/xin-zeng/studio#no-code-training) 速度提升 2 倍，VRAM 减少 70%
  {% endcolumn %}

{% column %}

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FFeQ0UUlnjXkDdqhcWglh%2Fskinny%20studio%20chat.png?alt=media&#x26;token=c2ee045f-c243-4024-a8e4-bb4dbe7bae79" alt=""><figcaption></figcaption></figure></div>
{% endcolumn %}
{% endcolumns %}

{% stepper %}
{% step %}

#### 安装 Unsloth

在你的终端中运行：

**MacOS、Linux、WSL：**

```bash
curl -fsSL https://unsloth.ai/install.sh | sh
```

**Windows PowerShell：**

```bash
irm https://unsloth.ai/install.ps1 | iex
```

{% endstep %}

{% step %}

#### 启动 Unsloth

**MacOS、Linux、WSL、Windows：**

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fd1yMMNa65Ccz50Ke0E7r%2FScreenshot%202026-03-17%20at%2012.32.38%E2%80%AFAM.png?alt=media&#x26;token=9369cfe7-35b1-4955-b8cb-42f7ecb43780" alt="" width="375"><figcaption></figcaption></figure></div>

**然后打开 `http://localhost:8888` 在你的浏览器中。**
{% endstep %}

{% step %}

#### 搜索并下载 Nemotron-3-Nano-4B

首次启动时，你需要创建密码以保护你的账户，并在之后重新登录。随后你会看到一个简短的新手引导向导，用于选择模型、数据集和基本设置。你可以随时跳过它。

然后前往 [Studio Chat](https://unsloth.ai/docs/zh/xin-zeng/studio/chat) 标签页，并在搜索栏中搜索 Nemotron-3-Nano-4B，然后下载你想要的模型和量化版本。

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F82jpCCGLO19X8ts986AW%2FScreenshot%202026-03-20%20at%201.26.43%E2%80%AFAM.png?alt=media&#x26;token=ef3d0a14-6b63-4421-afb2-ba1dffe9982f" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### 运行 Nemotron-3-Nano-4B

使用 Unsloth Studio 时，推理参数应会自动设置，不过你仍然可以手动更改。你也可以编辑上下文长度、聊天模板和其他设置。

更多信息，请查看我们的 [Unsloth Studio 推理指南](https://unsloth.ai/docs/zh/xin-zeng/studio/chat).

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FXPQGEEr1YoKofrTatAKK%2Ftoolcallingif.gif?alt=media&#x26;token=25d68698-fb13-4c46-99b2-d39fb025df08" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

### Llama.cpp 教程：

在 llama.cpp 中运行的说明（我们将使用 8 位以接近完整精度）：

{% stepper %}
{% step %}
获取最新的 `llama.cpp` 在 [GitHub 此处](https://github.com/ggml-org/llama.cpp)。你也可以按照下面的构建说明操作。将 `-DGGML_CUDA=ON` 为 `-DGGML_CUDA=OFF` 如果你没有 GPU，或者只想进行 CPU 推理。

{% code overflow="wrap" %}

```bash
apt-get update
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
git clone https://github.com/ggml-org/llama.cpp
cmake llama.cpp -B llama.cpp/build \\
    -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-mtmd-cli llama-server llama-gguf-split
cp llama.cpp/build/bin/llama-* llama.cpp
```

{% endcode %}
{% endstep %}

{% step %}
你可以直接从 Hugging Face 拉取。你可以根据 RAM/VRAM 的允许情况将上下文增加到 100 万。

按以下方式用于 **通用指令** 用例：

```bash
./llama.cpp/llama-cli \\
    -hf unsloth/NVIDIA-Nemotron-3-Nano-4B-GGUF:Q8_0 \\
    --ctx-size 16384 \\
    --temp 1.0 --top-p 1.0
```

按以下方式用于 **工具调用** 用例：

```bash
./llama.cpp/llama-cli \\
    -hf unsloth/NVIDIA-Nemotron-3-Nano-4B-GGUF:Q8_0 \\
    --ctx-size 32768 \\
    --temp 0.6 --top-p 0.95
```

{% endstep %}

{% step %}
通过（安装后）下载模型 `pip install huggingface_hub hf_transfer` ）。你可以选择 `Q8_0` 或其他量化版本。

```python
# !pip install huggingface_hub hf_transfer
import os
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
from huggingface_hub import snapshot_download
snapshot_download(
    repo_id = "unsloth/NVIDIA-Nemotron-3-Nano-4B-GGUF",
    local_dir = "unsloth/NVIDIA-Nemotron-3-Nano-4B-GGUF",
    allow_patterns = ["*Q8_0*"],
)
```

{% endstep %}

{% step %}
然后以对话模式运行模型：

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \\
    --model unsloth/NVIDIA-Nemotron-3-Nano-4B-GGUF/NVIDIA-Nemotron-3-Nano-4B-Q8_0.gguf \\
    --ctx-size 16384 \\
    --seed 3407 \\
    --prio 2 \\
    --temp 0.6 \\
    --top-p 0.95
```

{% endcode %}

另外，按需调整 **上下文窗口** 。确保你的硬件能够处理超过 256K 的上下文窗口。将其设置为 100 万可能会触发 CUDA OOM 并崩溃，因此默认值为 262,144。
{% endstep %}
{% endstepper %}

## 🖥️ 运行 Nemotron-3-Nano-30B-A3B

根据你的使用场景，你需要使用不同的设置。由于模型架构（如 [gpt-oss](https://unsloth.ai/docs/zh/mo-xing/gpt-oss-how-to-run-and-fine-tune)）的某些维度不能被 128 整除，因此某些部分无法量化到更低位。

该模型的 4 位版本需要约 24GB RAM。8 位需要 36GB。

### 🦥 Unsloth Studio 指南

在本教程中，我们将使用 [Unsloth Studio](https://unsloth.ai/docs/zh/xin-zeng/studio)，这是我们用于运行和训练 LLM 的新 Web UI。使用 Unsloth Studio，你可以在以下平台本地运行模型： **Mac、Windows**，以及 Linux，并且：

{% columns %}
{% column %}

* 搜索、下载、 [运行 GGUF](https://unsloth.ai/docs/zh/xin-zeng/studio#run-models-locally) 和 safetensor 模型
* **比较** 模型 **并排**
* [**自我修复** 工具调用](https://unsloth.ai/docs/zh/xin-zeng/studio#execute-code--heal-tool-calling) + **网页搜索**
* [**代码执行**](https://unsloth.ai/docs/zh/xin-zeng/studio#run-models-locally) （Python、Bash）
* [自动推理](https://unsloth.ai/docs/zh/xin-zeng/studio#model-arena) 参数调优（temp、top-p 等）
* [训练 LLM](https://unsloth.ai/docs/zh/xin-zeng/studio#no-code-training) 速度提升 2 倍，VRAM 减少 70%
  {% endcolumn %}

{% column %}

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FFeQ0UUlnjXkDdqhcWglh%2Fskinny%20studio%20chat.png?alt=media&#x26;token=c2ee045f-c243-4024-a8e4-bb4dbe7bae79" alt=""><figcaption></figcaption></figure></div>
{% endcolumn %}
{% endcolumns %}

{% stepper %}
{% step %}

#### 安装 Unsloth

**MacOS、Linux、WSL：**

```bash
curl -fsSL https://unsloth.ai/main/install.sh | sh
```

**Windows PowerShell：**

```bash
irm https://unsloth.ai/install.ps1 | iex
```

{% endstep %}

{% step %}

#### 设置 Unsloth Studio（一次性）

安装过程会自动安装 Node.js（通过 nvm）、构建前端、安装所有 Python 依赖，并使用 CUDA 支持构建 llama.cpp。

{% hint style="warning" %}
**首次安装可能需要 5-10 分钟。这是正常的，因为 `llama.cpp` 需要编译二进制文件。请**不要取消它。
{% endhint %}

{% hint style="info" %}
**WSL 用户：** 系统会提示你输入 `sudo` 密码以安装构建依赖（`cmake`, `git`, `libcurl4-openssl-dev`).
{% endhint %}
{% endstep %}

{% step %}

#### 启动 Unsloth

**MacOS、Linux、WSL：**

```bash
source unsloth_studio/bin/activate
unsloth studio -H 0.0.0.0 -p 8888
```

**Windows Powershell：**

```bash
& .\unsloth_studio\Scripts\unsloth.exe studio -H 0.0.0.0 -p 8888
```

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fd1yMMNa65Ccz50Ke0E7r%2FScreenshot%202026-03-17%20at%2012.32.38%E2%80%AFAM.png?alt=media&#x26;token=9369cfe7-35b1-4955-b8cb-42f7ecb43780" alt="" width="375"><figcaption></figcaption></figure></div>

**然后打开 `http://localhost:8888` 在你的浏览器中。**
{% endstep %}

{% step %}

#### 搜索并下载 Nemotron-3-Nano-30B-A3B

首次启动时，你需要创建密码以保护你的账户，并在之后重新登录。随后你会看到一个简短的新手引导向导，用于选择模型、数据集和基本设置。你可以随时跳过它。

然后前往 [Studio Chat](https://unsloth.ai/docs/zh/xin-zeng/studio/chat) 标签页，并在搜索栏中搜索 Nemotron-3-Nano-4B，然后下载你想要的模型和量化版本。

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FQUTU2gI4DNuscVEuiT8f%2FScreenshot%202026-03-20%20at%201.28.50%E2%80%AFAM.png?alt=media&#x26;token=74d5fd9e-a229-4ddc-a96d-abe68e1ca6a3" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### 运行 Nemotron-3-Nano-30B-A3B

使用 Unsloth Studio 时，推理参数应会自动设置，不过你仍然可以手动更改。你也可以编辑上下文长度、聊天模板和其他设置。

更多信息，请查看我们的 [Unsloth Studio 推理指南](https://unsloth.ai/docs/zh/xin-zeng/studio/chat).

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FXPQGEEr1YoKofrTatAKK%2Ftoolcallingif.gif?alt=media&#x26;token=25d68698-fb13-4c46-99b2-d39fb025df08" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

### Llama.cpp 教程：

在 llama.cpp 中运行的说明（注意我们将使用 4 位以适配大多数设备）：

{% stepper %}
{% step %}
获取最新的 `llama.cpp` 在 [GitHub 此处](https://github.com/ggml-org/llama.cpp)。你也可以按照下面的构建说明操作。将 `-DGGML_CUDA=ON` 为 `-DGGML_CUDA=OFF` 如果你没有 GPU，或者只想进行 CPU 推理。 **对于 Apple Mac / Metal 设备**，设置 `-DGGML_CUDA=OFF` 然后按常规继续——Metal 支持默认已开启。

{% code overflow="wrap" %}

```bash
apt-get update
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
git clone https://github.com/ggml-org/llama.cpp
cmake llama.cpp -B llama.cpp/build \\
    -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON -DLLAMA_CURL=ON
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-mtmd-cli llama-server llama-gguf-split
cp llama.cpp/build/bin/llama-* llama.cpp
```

{% endcode %}
{% endstep %}

{% step %}
你可以直接从 Hugging Face 拉取。你可以根据 RAM/VRAM 的允许情况将上下文增加到 100 万。

按以下方式用于 **通用指令** 用例：

```bash
./llama.cpp/llama-cli \\
    -hf unsloth/Nemotron-3-Nano-30B-A3B-GGUF:UD-Q4_K_XL \\
    --ctx-size 32768 \\
    --temp 1.0 --top-p 1.0
```

按以下方式用于 **工具调用** 用例：

```bash
./llama.cpp/llama-cli \\
    -hf unsloth/Nemotron-3-Nano-30B-A3B-GGUF:UD-Q4_K_XL \\
    --ctx-size 32768 \\
    --temp 0.6 --top-p 0.95
```

{% endstep %}

{% step %}
通过（安装后）下载模型 `pip install huggingface_hub hf_transfer` ）。你可以选择 `UD-Q4_K_XL` 或其他量化版本。

```python
# !pip install huggingface_hub hf_transfer
import os
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
from huggingface_hub import snapshot_download
snapshot_download(
    repo_id = "unsloth/Nemotron-3-Nano-30B-A3B-GGUF",
    local_dir = "unsloth/Nemotron-3-Nano-30B-A3B-GGUF",
    allow_patterns = ["*UD-Q4_K_XL*"],
)
```

{% endstep %}

{% step %}
然后以对话模式运行模型：

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \\
    --model unsloth/Nemotron-3-Nano-30B-A3B-GGUF/Nemotron-3-Nano-30B-A3B-UD-Q4_K_XL.gguf \\
    --ctx-size 16384 \\
    --seed 3407 \\
    --prio 2 \\
    --temp 0.6 \\
    --top-p 0.95
```

{% endcode %}

另外，按需调整 **上下文窗口** 。确保你的硬件能够处理超过 256K 的上下文窗口。将其设置为 100 万可能会触发 CUDA OOM 并崩溃，因此默认值为 262,144。

{% hint style="info" %}
Nemotron 3 使用 `<think>` ，其 token ID 为 12，以及 `</think>` ，其 token ID 为 13，用于推理。使用 `--special` 查看 llama.cpp 的 token。你可能还需要 `--verbose-prompt` 来查看 `<think>` ，因为它是前置添加的。
{% endhint %}
{% endstep %}
{% endstepper %}

### 🦥 Nemotron 3 和 RL 的微调

Unsloth 现在支持所有 Nemotron 模型的微调，包括 Nemotron 3 Super 和 Nano。&#x20;

4B 模型可在免费 Colab GPU 上运行，但 30B 模型无法放入。我们仍然为你准备了一个 80GB A100 Colab 笔记本用于微调。对 Nemotron 3 Nano 进行 16 位 LoRA 微调大约会使用 **60GB VRAM**:

* [Nemotron-3-Nano-30B-A3B SFT LoRA 笔记本](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Nemotron-3-Nano-30B-A3B_A100.ipynb)

{% embed url="<https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Nemotron-3-Nano-30B-A3B_A100.ipynb>" %}

关于 MoE 的微调——微调路由层可能不是个好主意，因此我们默认禁用了它。如果你想保持其推理能力（可选），你可以使用直接答案和思维链示例的混合。数据集里至少使用 <mark style="background-color:green;">75% 推理</mark> 和 <mark style="background-color:green;">25% 非推理</mark> ，以使模型保留其推理能力。

#### :sparkles:强化学习 + NeMo Gym

我们与开源 NVIDIA [NeMo Gym](https://github.com/NVIDIA-NeMo/Gym/pull/492) 团队合作，推动 RL 环境的普及化。我们的合作使得在数学、编程、工具使用等许多感兴趣的领域中，能够使用 NeMo Gym 的训练环境和数据集进行单轮 rollout RL 训练：

{% columns %}
{% column %}
[NeMo Gym 数独强化学习笔记本](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/nemo_gym_sudoku.ipynb)

{% embed url="<https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/NeMo-Gym-Sudoku.ipynb>" %}
{% endcolumn %}

{% column %}
[NeMo Gym 多环境强化学习笔记本](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/NeMo-Gym-Multi-Environment.ipynb)

{% embed url="<https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/NeMo-Gym-Multi-Environment.ipynb>" %}
{% endcolumn %}
{% endcolumns %}

{% hint style="success" %}
**另请查看我们最新的合作指南，已发布在 NVIDIA 官方开发者博客上：**

#### [如何使用 Unsloth 在 NVIDIA GPU 上微调 LLM](https://blogs.nvidia.com/blog/rtx-ai-garage-fine-tuning-unsloth-dgx-spark/)

{% endhint %}

{% embed url="<https://blogs.nvidia.com/blog/rtx-ai-garage-fine-tuning-unsloth-dgx-spark/>" %}

### 🦙Llama-server 服务与部署

为了在生产环境中部署 Nemotron 3，我们使用 `llama-server` 在一个新的终端中，例如通过 tmux，使用以下命令部署模型：

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-server \\
    --model unsloth/Nemotron-3-Nano-30B-A3B-GGUF/Nemotron-3-Nano-30B-A3B-UD-Q4_K_XL.gguf \\
    --alias "unsloth/Nemotron-3-Nano-30B-A3B" \\
    --prio 3 \\
    --min_p 0.01 \\
    --temp 0.6 \\
    --top-p 0.95 \\
    --ctx-size 16384 \\
    --port 8001
```

{% endcode %}

运行上述命令后，你将得到：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F93hcq5qYJi4BNnkOqgC4%2Fimage.png?alt=media&#x26;token=901aa339-4b1f-4e43-9793-f224edcdb024" alt="" width="563"><figcaption></figcaption></figure>

然后在一个新的终端中，在执行 `pip install openai`之后，执行：

{% code overflow="wrap" %}

```python
from openai import OpenAI
import json
openai_client = OpenAI(
    base_url = "http://127.0.0.1:8001/v1",
    api_key = "sk-no-key-required",
)
completion = openai_client.chat.completions.create(
    model = "unsloth/Nemotron-3-Nano-30B-A3B",
    messages = [{"role": "user", "content": "2+2 等于多少？"},],
)
print(completion.choices[0].message.content)
```

{% endcode %}

它将输出

{% code overflow="wrap" %}

```
用户提出一个简单问题："2+2 等于多少？" 答案是 4。请给出答案。

2 + 2 = 4.
```

{% endcode %}

### 基准测试

Nemotron-3-Nano-4B 是同尺寸中表现最佳的模型，包括吞吐量。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FhpmDlCwCrlCw8iMtjTbC%2FCode_Generated_Image(26).png?alt=media&#x26;token=f66979d9-1bf9-47ca-ba65-0a7a04de9a52" alt="" width="375"><figcaption></figcaption></figure>

Nemotron-3-Nano-30B-A3B 是所有基准测试中表现最佳的模型，包括吞吐量。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FOVAJmRGUC982jLoOivii%2Faccuracy_chart.png?alt=media&#x26;token=5c090424-087e-46ab-ac03-d3e82d3c2c87" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://unsloth.ai/docs/zh/mo-xing/nemotron-3.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
