> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/zh/mo-xing/nemotron-3.5.md).

# NVIDIA Nemotron 3.5 Lightning：如何本地运行

NVIDIA Nemotron-3.5-Lightning-30B-A3B 是一款开源的 300 亿参数、30 亿激活参数的混合推理 MoE 模型，专为长时间运行的智能体中的高频任务执行而构建。它面向频繁的智能体调用而设计，包括工具使用、输出验证、结果格式化以及子智能体委派。该模型可运行在 **20GB 内存** 的 4 位量化版本和 33GB 的 8 位量化版本。

{% columns %}
{% column %}
最高可支持 **100万上下文**，Nemotron 3.5 Lightning 是同等规模中速度最快、准确度最高的开源执行模型之一。你可以通过 Unsloth Desktop 和 Unsloth Dynamic GGUF 在本地运行 Nemotron 3.5。感谢 NVIDIA 提供首日支持！\
**GGUF：** [Nemotron-3.5-Lightning-30B-A3B](https://huggingface.co/unsloth/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-GGUF)

看右侧，Nemotron-3.5 会在 [Unsloth Desktop](/docs/zh/desktop.md):
{% endcolumn %}

{% column %}

<figure><img src="/files/6bcc33cb6b522e90412cdbd132caf3bdaf86d66a" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

#### ⚙️ 使用指南

NVIDIA 推荐以下推理设置：

{% columns %}
{% column %}
**思考模式：**

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

{% column %}
**指令模式：**

* `temperature = 0.2`
  {% endcolumn %}
  {% endcolumns %}

#### 运行 Nemotron 3.5 Lightning

根据你的使用场景，你需要使用不同的设置。Nemotron 3.5 Lightning 每个 token 激活 30 亿参数，因此它足够快，适合在长时间运行的智能体工作流中反复调用。 **GGUF：** [Nemotron-3.5-Lightning-30B-A3B](https://huggingface.co/unsloth/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-GGUF)

该模型的 4 位版本需要约 20GB 内存。8 位版本需要 33GB。对于这些指南，我们将使用 `UD-Q4-K-XL` ，它在体积和准确度之间取得了很好的平衡。

<a href="/pages/605167571d2eaa9e144a41f38d7156bfefb8e49c#unsloth-desktop-guide" class="button primary">在 Unsloth Desktop 中运行</a><a href="/pages/605167571d2eaa9e144a41f38d7156bfefb8e49c#llama.cpp-tutorial" class="button secondary">在 llama.cpp 中运行</a>

#### 🦥 Unsloth Desktop 指南

在本教程中，我们将使用 [Unsloth Desktop](#unsloth-desktop-guide)，这是一款用于运行和训练模型的开源本地应用。借助 Unsloth，你可以在以下平台本地运行模型： **Mac、Windows 和 Linux** 以及：

{% columns %}
{% column %}

* 搜索、下载并运行 GGUF 和 safetensor 模型
* **并排** 比较 **模型**
* 使用 **自我修复** 工具调用和 **网页搜索**
* 运行 **代码执行** ，支持 Python 和 Bash
* 使用自动推理参数调优
* 以少 70% 的 VRAM 将 LLM 训练速度提升 2 倍
  {% endcolumn %}

{% column %}

<figure><img src="/files/2f55818371094b7a9368bbbf50dfe58cada78be0" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

{% stepper %}
{% step %}

#### 安装 Unsloth

最简单的上手方式是下载 [Unsloth Desktop 应用](/docs/zh/desktop.md)。适用于 [macOS](/docs/zh/kuai-su-kai-shi/install/mac.md), [Windows](/docs/zh/kuai-su-kai-shi/install/windows-installation.md)，以及 [Linux](/docs/zh/kuai-su-kai-shi/install/linux.md).

<a href="https://unsloth.ai/download" class="button primary" data-icon="down-to-bracket">下载 Unsloth</a>

* <i class="fa-apple">:apple:</i> [下载适用于 macOS 的版本](https://unsloth.ai/download/mac)
* <i class="fa-windows">:windows:</i> [下载适用于 Windows 的版本](https://unsloth.ai/download/windows)
* <i class="fa-linux">:linux:</i> [下载适用于 Linux 的版本](https://unsloth.ai/download/linux)

或者，如果你更喜欢手动安装：

MacOS、Linux、WSL：

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

Windows PowerShell：

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

{% endstep %}

{% step %}

#### 搜索并下载 Nemotron 3.5

前往 [Unsloth Chat](/docs/zh/xin/studio/chat.md) 或 Model hub，在搜索栏中搜索 Nemotron 3.5，并下载你想要的模型和量化版本。

<figure><img src="/files/3d88dc288bc73f55101d8c26e4efea996540e176" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 运行 Nemotron 3.5 Lightning

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

更多信息请查看我们的 [Unsloth 推理指南](/docs/zh/xin/studio/chat.md).

<figure><img src="/files/6bcc33cb6b522e90412cdbd132caf3bdaf86d66a" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

#### 🦙 Llama.cpp 教程：

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

{% stepper %}
{% step %}
获取最新的 [`llama.cpp`](https://github.com/ggml-org/llama.cpp) 并进行构建。将 `-DGGML_CUDA=ON` 改为 `-DGGML_CUDA=OFF` ，如果你没有 CUDA 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-server llama-gguf-split
cp llama.cpp/build/bin/llama-* llama.cpp
```

{% endcode %}
{% endstep %}

{% step %}
现在让我们手动下载模型。安装后，我们可以通过下面的代码来完成 `huggingface_hub`。如果下载卡住，请参阅：Hugging Face Hub、XET 调试

{% code overflow="wrap" %}

```bash
pip install huggingface_hub
hf download unsloth/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-GGUF \
    --local-dir unsloth/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-GGUF \
    --include "*UD-Q4_K_XL*" # 动态 2bit 请使用 "*UD-Q2_K_XL*"
```

{% endcode %}
{% endstep %}

{% step %}
在对话模式下运行模型：

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \
    --model unsloth/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-GGUF/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-UD-Q4_K_XL.gguf \
    --temp 0.6 \
    --top-p 0.95 \
    --min-p 0.01
```

{% endcode %}
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Nemotron 3.5 Lightning 随附 MTP，以及专用于推测解码的 DFlash 和 DSpark 草稿模型。这些草稿模型会预测后续多个 token，从而提升高频智能体工作负载的输出速度。
{% endhint %}

#### 🦥 微调 Nemotron 3.5 Lightning

Unsloth 支持整个 NVIDIA Nemotron 模型家族的后训练。Nemotron 3.5 Lightning 非常适合长时间运行的智能体中的专门化高频任务。使用 Unsloth，你可以以少 70% 的 VRAM 将模型训练速度提升 2 倍。

有用的微调数据可以包括：

* **工具调用：** 选择正确的工具、生成有效参数以及从工具错误中恢复
* **结果验证：** 根据约束、模式或预期状态检查输出
* **仓库工作：** 常规 shell 命令、测试执行、格式化和结构化摘要
* **子智能体委派：** 选择专家、编写聚焦任务并整合结果
* **长时间运行的智能体轨迹：** 观察 → 推理 → 行动 → 验证 → 恢复 示例
* **领域工作流：** 重复性强、具有组织特定性的任务，其中延迟和一致性很重要

不要把微调硬件规模当作这是一个稠密的 3B 模型。尽管每个 token 只激活 30 亿参数，但该模型总共有 300 亿参数。上下文长度、优化器选择、批大小和序列长度也会影响内存使用。

对于笔记本和训练说明，请从现有的 Nemotron 微调流程开始。先使用较短的上下文和较小的批大小，然后再逐步扩大。

#### 基准测试

Nemotron 3.5 Lightning 处于小型开源模型在准确度-速度帕累托前沿上的位置：

* 最高可 **快 4 倍的输出速度** 相比同等规模模型
* **86% 准确率** 在 PinchBench 上
* 完成 **10,000 个 PinchBench 任务的速度快 35%** ，且准确率与 Qwen 3.6 35B 相近

Artificial Analysis Intelligence Index 综合了智能体任务、编程、科学推理和通用智能方面的评测。NVIDIA 还衡量完成有用智能体工作的时间，而不仅仅是原始每秒 token 数。

Nemotron 3.5 Lightning 的设计目标是在路由式智能体系统中位于前沿推理模型之下：复杂规划路由到更大的模型，而高频执行路由到 Lightning。NVIDIA 计划在 OpenMDW-1.1 下发布权重、训练数据和配方，并且 [NeMo Switchyard](https://developer.nvidia.com/topics/ai/nemotron) 可以将每个请求路由到最合适的模型。

有关 NVIDIA 的完整发布详情，请参阅 [Nemotron 3.5 Lightning 公告](https://developer.nvidia.com/blog/nvidia-nemotron-3-5-lightning-delivers-fast-accurate-specialized-task-execution-for-long-running-agents/).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
