> 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/inkling-2-mini.md).

# Inkling 2 Mini - 本地运行指南

了解如何使用 Unsloth 和 llama.cpp 在本地运行 Thinking Machines Lab 的 Inkling 2 Mini。

**Inkling 2 Mini** 是 Thinking Machines Lab 的 **26.4B MoE（激活参数 5.4B）** 模型，适用于编程、智能体和 **视觉** 工作负载。该模型以 Apache 2.0 许可证发布，基于一种循环 Transformer 变体构建，具有 **1M 上下文窗口** ，并在 **DeepSWE v1.1 上取得 48.2%** ，在 **SWEBench Pro v2（Hard）上取得 77.9%**，以同等规模中的最强表现领先于 Qwen3.8-27B。在 Terminal Bench 4.0 上，它与 Qwen3.8-27B 持平，得分为 **5.6%**.

{% columns %}
{% column %}
本指南介绍如何使用 Unsloth Desktop 在 Mac、NVIDIA 或 AMD 设备上运行 Inkling 2 Mini。Unsloth Desktop 占用更少内存，并能加快该模型的推理速度。

可在 16GB 内存或 **24GB 内存** 下运行 **全精度**。GGUF： [**Inkling 2 Mini GGUF**](https://huggingface.co/unsloth/Inkling-2-Mini-GGUF)

<a href="https://unsloth.ai/docs/zh/mo-xing/inkling-2-mini.md#run-inkling-2-mini-guide" class="button primary">Inkling 2 运行指南</a><a href="https://unsloth.ai/download" class="button secondary">下载 Unsloth</a>
{% endcolumn %}

{% column %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fbnhx2GlFHFh3fjMdbN26%2Fgta%20example.gif?alt=media&amp;token=6f9605aa-3c77-4796-a014-96214063f1b0" alt="" width="563"><figcaption><p>在 Unsloth 中运行的 4 位 Inkling Mini 示例</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### ⚙️ 使用指南

#### Inkling 2 Mini 系统要求

**`UD-Q8_K_XL`** 是 **全精度**。推荐使用的量化版本是 **`UD-Q4_K_XL` （17.6 GB）。**

**表：硬件要求** （RAM + VRAM，或统一内存）

| 1 位  | 2 位      | 3 位      | 4 位      | 8 位（无损） |
| ---- | -------- | -------- | -------- | ------- |
| 9 GB | 10–11 GB | 13–15 GB | 17–18 GB | 24 GB   |

查看 [量化分析](#quantization-analysis) ，了解所有 GGUF 文件大小及测试结果。

{% hint style="success" %}
可将这些范围作为起点。更长的上下文、图像输入以及其他应用可能会占用更多内存。 `mmproj-F16.gguf` 视觉投影器会使下载文件增加 639 MB。
{% endhint %}

#### 推荐设置

| 温度    | Top-p | Top-k | Min-p |
| ----- | ----- | ----- | ----- |
| `1.0` | `1.0` | `0`   | `0.0` |

## 运行 Inkling 2 Mini 指南

使用支持 **循环层** 和 **每个专家的 NVFP4 缩放因子**. [Inkling 2 Mini 模型卡](https://huggingface.co/unsloth/Inkling-2-Mini-GGUF)

<a href="https://unsloth.ai/docs/zh/mo-xing/inkling-2-mini.md#run-inkling-2-mini-in-unsloth-desktop" class="button primary">在 Unsloth Desktop 中运行</a><a href="https://unsloth.ai/docs/zh/mo-xing/inkling-2-mini.md#run-inkling-2-mini-in-llama-cpp" class="button secondary">在 llama.cpp 中运行</a>

<div><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fc9F8coH46gJj7gxZEhRU%2Fsnow-fall.webp?alt=media&amp;token=2ede2108-5204-405d-9e6a-57d1a903c5f0" alt=""><figcaption></figcaption></figure> <figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FXRbHGqQn9DJR1prbs4w5%2Flighthouse.webp?alt=media&amp;token=e17bd9b1-d5d4-4659-b532-8373188e3811" alt=""><figcaption></figcaption></figure></div>

### 🦥 在 Unsloth Desktop 中运行 Inkling 2 Mini <a href="#run-inkling-2-mini-in-unsloth-desktop" id="run-inkling-2-mini-in-unsloth-desktop"></a>

{% stepper %}
{% step %}

#### 安装 Unsloth

下载并启动 [Unsloth Desktop 应用](https://unsloth.ai/docs/zh/desktop.md) ，适用于 macOS、Windows 或 Linux。

<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)

或者，如果你更愿意手动安装：

{% tabs %}
{% tab title="本地安装" %}
**MacOS、Linux、WSL：**

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

**Windows：**

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

{% endtab %}

{% tab title="Docker" %}
该 [Unsloth Docker 镜像](https://hub.docker.com/r/unsloth/unsloth) `unsloth/unsloth` 可在 Docker 上获取。 [阅读指南。](https://unsloth.ai/docs/get-started/install/docker)
{% endtab %}

{% tab title="Homebrew" %}
安装 Unsloth Desktop：

{% code collapsedlinecount="10" %}

```bash
brew install --cask unsloth
```

{% endcode %}

更新 Unsloth Desktop：

```bash
brew upgrade --cask unsloth
```

{% endtab %}

{% tab title="WinGet" %}
安装 Unsloth Desktop：

```powershell
winget install --id UnslothAI.Unsloth -e
```

更新 Unsloth Desktop：

```powershell
winget upgrade --id UnslothAI.Unsloth -e
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

#### 搜索并下载 Inkling 2 Mini

在 **聊天**中，打开 **选择模型**，或前往 **模型中心**。搜索 **Inkling 2 Mini**，选择 [**unsloth/Inkling-2-Mini-GGUF**](https://huggingface.co/unsloth/Inkling-2-Mini-GGUF) 并下载适合你设备的量化版本。下载完成后，在聊天中选择该模型并开始对话。你也可以从本地文件加载兼容的 Mini GGUF。
{% endstep %}

{% step %}

#### 使用 Unsloth API 运行并提供 Inkling 2 Mini 服务

此示例使用 4 位 `UD-Q4_K_XL` 量化版本（17.63 GB）。更改冒号后的后缀，即可从仓库中选择其他量化版本。

{% code overflow="wrap" %}

```bash
unsloth run --model unsloth/Inkling-2-Mini-GGUF:UD-Q4_K_XL \
    --temp 1.0 --top-p 1.0 --top-k 0 --min-p 0.0
```

{% endcode %}

使用终端中显示的端点 URL 和 API 密钥连接客户端。 [Unsloth API 指南](https://unsloth.ai/docs/zh/ji-chu-zhi-shi/api.md)
{% endstep %}
{% endstepper %}

### 🦙 在 llama.cpp 中运行 Inkling 2 Mini <a href="#run-inkling-2-mini-in-llama-cpp" id="run-inkling-2-mini-in-llama-cpp"></a>

{% stepper %}
{% step %}

#### 安装 llama.cpp

仓库根目录中的 GGUF 使用 Unsloth 的循环层布局，因此请使用我们的 [b12588-mix-c0c3de8](https://github.com/unslothai/llama.cpp/releases/tag/b12588-mix-c0c3de8) 构建版本，它支持该布局以及 DSpark。上游 llama.cpp 使用不同的布局：对于主线 llama.cpp，请使用 [Mainline\_Support](https://huggingface.co/unsloth/Inkling-2-Mini-GGUF/tree/main/Mainline_Support) 文件。请在准备下载 GGUF 的文件夹中运行这些命令。每个命令都会将 `llama-server` 解压到 `llama.cpp` 文件夹中，这样接下来的步骤就可以直接照做。 [预编译下载](https://github.com/unslothai/llama.cpp/releases/tag/b12588-mix-c0c3de8)

{% tabs %}
{% tab title="Apple" %}
{% code overflow="wrap" %}

```bash
curl -L -o llama.tar.gz https://github.com/unslothai/llama.cpp/releases/download/b12588-mix-c0c3de8/llama-b12588-mix-c0c3de8-bin-macos-arm64.tar.gz
mkdir -p llama.cpp
tar -xzf llama.tar.gz -C llama.cpp --strip-components=1
./llama.cpp/llama-server --version
```

{% endcode %}
{% endtab %}

{% tab title="NVIDIA" %}
**CUDA 12** 适用于大多数 NVIDIA GPU：RTX 20 至 RTX 50 系列、V100、T4、A100、H100 和 B200。请先安装 [CUDA 工具包](https://developer.nvidia.com/cuda-downloads) 。使用 CUDA 13 时，将 `cuda12-portable` 替换为 `cuda13-portable`。对于 GTX 10 系列及更早的型号，请使用 `cuda12-legacy`.

{% code overflow="wrap" %}

```bash
curl -L -o llama.tar.gz https://github.com/unslothai/llama.cpp/releases/download/b12588-mix-c0c3de8/app-b12588-mix-c0c3de8-linux-x64-cuda12-portable.tar.gz
mkdir -p llama.cpp
tar -xzf llama.tar.gz -C llama.cpp
./llama.cpp/llama-server --version
```

{% endcode %}
{% endtab %}

{% tab title="AMD" %}
**ROCm** 适用于 Radeon RX 9000（`gfx120X`）。其中已捆绑 ROCm 库，因此无需完整安装 ROCm。对于其他 GPU，请将 `gfx120X` 替换为 `gfx1151` （Ryzen AI Max）、 `gfx1150` （Ryzen AI 300）、 `gfx110X` （RX 7000）、 `gfx103X` （RX 6000）、 `gfx90a` （MI200）或 `gfx908` （MI100）。对于其他 AMD GPU，请使用 `vulkan` 构建版本。

{% code overflow="wrap" %}

```bash
curl -L -o llama.tar.gz https://github.com/unslothai/llama.cpp/releases/download/b12588-mix-c0c3de8/app-b12588-mix-c0c3de8-linux-x64-rocm-gfx120X.tar.gz
mkdir -p llama.cpp
tar -xzf llama.tar.gz -C llama.cpp
./llama.cpp/llama-server --version
```

{% endcode %}
{% endtab %}

{% tab title="Windows" %}
**CUDA 12** 适用于 NVIDIA GPU。请先安装 [CUDA 工具包](https://developer.nvidia.com/cuda-downloads) ，然后在 PowerShell 中运行以下命令。使用 CUDA 13 时，将 `cuda12-portable` 替换为 `cuda13-portable`。对于 AMD，请将其替换为 `rocm-gfx120X` 或从 AMD 选项卡获取适用于你的 GPU 的构建版本。使用 `vulkan` 适用于其他 GPU，或使用 `cpu` 仅使用 CPU。

{% code overflow="wrap" %}

```powershell
curl.exe -L -o llama.zip https://github.com/unslothai/llama.cpp/releases/download/b12588-mix-c0c3de8/app-b12588-mix-c0c3de8-windows-x64-cuda12-portable.zip
Expand-Archive llama.zip -DestinationPath llama.cpp
.\llama.cpp\llama-server.exe --version
```

{% endcode %}
{% endtab %}

{% tab title="DGX Spark" %}
{% code overflow="wrap" %}

```bash
curl -L -o llama.tar.gz https://github.com/unslothai/llama.cpp/releases/download/b12588-mix-c0c3de8/app-b12588-mix-c0c3de8-linux-arm64-cuda13-portable.tar.gz
mkdir -p llama.cpp
tar -xzf llama.tar.gz -C llama.cpp
./llama.cpp/llama-server --version
```

{% endcode %}
{% endtab %}
{% endtabs %}

对于 Intel Mac、仅 CPU、Vulkan 或 Linux ARM64，请从 [发布页面](https://github.com/unslothai/llama.cpp/releases/tag/b12588-mix-c0c3de8)选择对应的文件。请将 `llama-server` 及其附带的库文件放在一起，存放于 `llama.cpp`.
{% endstep %}

{% step %}

#### 下载 GGUF

下载 4 位 `UD-Q4_K_XL` GGUF、F16 视觉投影器和 Q8\_0 DSpark 草稿模型。若要使用其他量化版本，请使用仓库中的对应文件名。 [GGUF 文件](https://huggingface.co/unsloth/Inkling-2-Mini-GGUF/tree/main)

{% code overflow="wrap" collapsedlinecount="10" %}

```bash
pip install -U huggingface_hub
hf download unsloth/Inkling-2-Mini-GGUF \
    Inkling-2-Mini-UD-Q4_K_XL.gguf mmproj-F16.gguf dspark-Inkling-2-Mini-Q8_0.gguf \
    --local-dir Inkling-2-Mini-GGUF
```

{% endcode %}
{% endstep %}

{% step %}

#### 运行 Inkling 2 Mini

使用预编译的二进制文件启动本地聊天服务器。

{% tabs %}
{% tab title="macOS、Linux 或 WSL" %}
{% code overflow="wrap" collapsedlinecount="10" %}

```bash
./llama.cpp/llama-server \
    --model Inkling-2-Mini-GGUF/Inkling-2-Mini-UD-Q4_K_XL.gguf \
    --mmproj Inkling-2-Mini-GGUF/mmproj-F16.gguf \
    --model-draft Inkling-2-Mini-GGUF/dspark-Inkling-2-Mini-Q8_0.gguf \
    --spec-type draft-dspark --spec-draft-n-max 3 --n-gpu-layers-draft 99 \
    --temp 1.0 --top-p 1.0 --top-k 0 --min-p 0.0 \
    --host 127.0.0.1 --port 8080
```

{% endcode %}
{% endtab %}

{% tab title="Windows PowerShell" %}
{% code overflow="wrap" collapsedlinecount="10" %}

```powershell
.\llama.cpp\llama-server.exe `
    --model Inkling-2-Mini-GGUF/Inkling-2-Mini-UD-Q4_K_XL.gguf `
    --mmproj Inkling-2-Mini-GGUF/mmproj-F16.gguf `
    --model-draft Inkling-2-Mini-GGUF/dspark-Inkling-2-Mini-Q8_0.gguf `
    --spec-type draft-dspark --spec-draft-n-max 3 --n-gpu-layers-draft 99 `
    --temp 1.0 --top-p 1.0 --top-k 0 --min-p 0.0 `
    --host 127.0.0.1 --port 8080
```

{% endcode %}
{% endtab %}
{% endtabs %}

打开 <http://127.0.0.1:8080> 即可聊天或上传图片。 `--model-draft` 和 `--spec-type draft-dspark` 这两个标志会启用 DSpark 推测解码，并使用 0.4 GB 的草稿模型； `--spec-draft-n-max 3` 是一个不错的默认选择。若要在不使用它的情况下运行，请在下载内容中移除 drafter，并从服务器命令中删除 `--model-draft` 和 `--spec-type` 参数。若只进行文本聊天，请在下载内容中省略 projector，并从服务器命令中删除 `--mmproj` 。若内存有限，请调低 `--ctx-size` 或 `--n-gpu-layers`。若仅使用 CPU 推理，请设置 `--n-gpu-layers 0` 和 `--n-gpu-layers-draft 0`.
{% endstep %}
{% endstepper %}

### :play\_pause:循环 Transformer 架构

Inkling-2-Mini 使用一种经过修改的循环 Transformer 架构，其中第 6 至 17 层循环运行 3 次；若将嵌入层也计算在内，实际激活的参数量仅为 5.4B。这与其他 LLM 架构不同，后者的每个解码器层只运行一次；Inkling-2-Mini 则会将第 6 至 17 层运行三次，从而在训练过程中有效压缩磁盘空间和模型占用空间。

有 **传闻** 称，GPT-6 Astra 系列模型也可能采用某种变体的循环 Transformer 架构，而 Inkling-2-Mini 是首批采用这种机制变体的强大开放模型之一。

### 📊 量化分析 <a href="#quantization-analysis" id="quantization-analysis"></a>

我们使用相同的 llama.cpp 设置，在七个领域中将每种 GGUF 与 `UD-Q8_K_XL` 进行比较。基准版本保留原始 NVFP4 专家权重，其余权重以 BF16 存储。UD-Q4\_K\_XL 也几乎无损，其 MXFP8 权重反量化为 Q8\_0。UD-Q8\_K\_XL 会将 MXFP8 升位为 BF16，因此 KLD = 0。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FqWPOI9paCJed36b9qV1x%2Fsize_vs_top1(7).png?alt=media&amp;token=186fd174-4199-4d66-949e-fc851aa614ef" alt="" width="563"><figcaption></figcaption></figure>

4 位量化 `UD-Q4_K_XL` 的 **平均 KLD 为 0.0107** ，且 **最高概率 token 一致率为 98.0%** ，文件大小为 **17.63 GB**。2 位量化 `UD-IQ2_XXS` 可将下载大小缩减至 **8.49 GB** ，且 **一致率为 90.6%**.

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FObpB27Pzg7eddzGOefoK%2Fsize_vs_kld(4).png?alt=media&amp;token=b388d982-caaa-402f-bc8f-f49938036713" alt="" width="563"><figcaption></figcaption></figure>

| 量化类型         | 大小（GB） | 相对于 UD-Q8\_K\_XL 的平均 KLD | 最高概率 token 相同 |
| ------------ | ------ | ------------------------ | ------------- |
| UD-IQ1\_S    | 7.76   | 0.0911                   | 89.4%         |
| UD-IQ1\_M    | 8.02   | 0.0867                   | 90.2%         |
| UD-IQ2\_XXS  | 8.49   | 0.0726                   | 90.6%         |
| UD-Q2\_K\_XL | 9.14   | 0.0595                   | 91.6%         |
| UD-IQ3\_XXS  | 11.66  | 0.0269                   | 94.7%         |
| UD-Q3\_K\_XL | 13.63  | 0.0174                   | 96.3%         |
| UD-IQ4\_XS   | 15.73  | 0.0109                   | 97.7%         |
| UD-Q4\_K\_M  | 16.61  | 0.0108                   | 97.9%         |
| UD-Q4\_K\_XL | 17.63  | 0.0107                   | 98.0%         |
| UD-Q8\_K\_XL | 22.87  | 基准                       |               |

### 📊 基准测试

在 Thinking Machines Lab 的评测中，Mini 在下方列出的三个规模相近的模型中，于软件工程和搜索基准测试中表现领先。Mini 的得分 **比 Qwen3.8-27B 在 DeepSWE v1.1 上高 6.0 个百分点** ，并且 **在 SWEBench Pro v2 (Hard) 上高 4.1 个百分点**.

<details>

<summary>点击查看完整基准测试表</summary>

| 基准测试                        | Inkling 2 Mini   | Gemma 4 31B  | Muse Glimmer | Qwen3.8-27B  | Nemotron 3.5 Super VL |
| --------------------------- | ---------------- | ------------ | ------------ | ------------ | --------------------- |
| 参数量（激活 / 总计，十亿）             | 5 / 26           | 31 / 31      | 30 / 30      | 27 / 27      | 12 / 125              |
| SWE-bench Verified          | **79.2%**        | 46.1%        | 76.0%        | 77.8%        | 71.1%                 |
| DeepSWE v1.1                | **48.2%**        | 0.3%         | 4.4%         | 42.2%        | 24.7%                 |
| Terminal Bench v4.0         | **5.6%**         | 0.0%         | 0.5%         | **5.6%**     | 0.0%                  |
| AA Index v5.0               | **20.1**         | 4.4          | 6.3          | **20.1**     | 13.6                  |
| Vals Index v2.2             | **46.5%**        | –            | –            | –            | 29.8%                 |
| SWE-bench Pro (Hard)        | **77.9%**        | 14.2%        | 44.3%        | 73.8%        | 44.1%                 |
| Terminal Bench v2.1         | 71.6%            | 43.4%        | 51.7%        | **73.0%**    | 60.7%                 |
| BrowseComp                  | **79.0%**        | 37.0%        | 63.9%        | 61.6%        | 78.9%                 |
| DeepSearchQA                | **85.3%**        | 61.7%        | 74.6%        | 79.7%        | 77.7%                 |
| GDPVal-AA v2.1              | 1319             | 627          | 792          | **1427**     | 1162                  |
| AutomationBench-AA          | 41.8%            | 4.9%         | 6.8%         | **48.2%**    | 14.8%                 |
| JobBench                    | **49.6%**        | 8.2%         | 16.1%        | 33.4%        | 36.5%                 |
| MMMU Pro                    | 74.9%            | 73.4%        | 74.3%        | **76.3%**    | 72.3%                 |
| OmniDocBench v1.6           | **92.8%**        | 82.5%        | 90.4%        | 91.5%        | 77.9%                 |
| ScreenSpot Pro（原版 / Python） | **76.5 / 87.7%** | 5.9 / –      | 75.4 / –     | 57.6 / 78.9% | 43.5 / –              |
| Chartography（原版 / Python）   | **22.1 / 72.5%** | 12.0 / 11.8% | 17.4 / 25.1% | 12.2 / 52.1% | 9.7 / 29.3%           |
| HLE-Diamond                 | 15.2%            | 7.2%         | 9.1%         | **15.3%**    | 8.8%                  |
| ARC-AGI（v1 / v2）            | **84.5 / 49.3%** | –            | –            | 87.5 / 42.4% | 22.7 / 1.5%           |
| LongBench v2                | **66.9%**        | 52.9%        | 33.1%        | 52.3%        | 62.1%                 |
| AA-Omniscience（得分）          | -8.6             | -48.5        | -32.2        | -6.4         | **-2.9**              |
| AA-Omniscience（非幻觉）         | 63.4%            | 14.5%        | 16.4%        | **71.4%**    | 69.5%                 |
| FORTRESS（对抗性）               | 89.5%            | 67.8%        | **90.3%**    | 78.8%        | 79.6%                 |
| FORTRESS（良性）                | 96.4%            | 97.6%        | 89.1%        | **97.8%**    | 92.7%                 |
| StrongREJECT                | 97.8%            | 98.1%        | 99.0%        | 99.0%        | **99.4%**             |

</details>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/zh/mo-xing/inkling-2-mini.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
