> 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/docs.md). Agents can also search and read this documentation through its [MCP server](https://unsloth.ai/docs/~gitbook/mcp).

# Unsloth 文档

Unsloth 是一个用于运行和训练 LLM 的开源框架。

Unsloth 通过开源 UI，让你能在自己的本地硬件上运行和训练 AI 模型。

我们的文档将指导你如何在本地运行和训练自己的 LLM。

<a href="https://unsloth.ai/download" class="button primary" data-icon="down-to-bracket">下载</a><a href="https://unsloth.ai/docs/zh/desktop.md#features" class="button secondary" data-icon="sparkles">功能</a><a href="https://github.com/unslothai/unsloth" class="button secondary" data-icon="github">GitHub</a>

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">封面图片</th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Inkling 2 Mini</strong></td><td>运行和训练全新的 26B MoE 模型，速度提升 2 倍！</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FZffJ9lXYY27Dr2uf1ZbB%2Finkling%202%20mini%20logo.png?alt=media&amp;token=5dfa4bd7-f87f-40fb-bce2-894fe6f197b7">inkling 2 mini logo.png</a></td><td><a href="https://unsloth.ai/docs/zh/mo-xing/inkling-2-mini.md">Inkling 2 Mini</a></td></tr><tr><td><strong>DeepSeek-V4.1-Flash</strong></td><td>运行 10 月 17 日发布的全新模型更新。</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F4qwswsAZxmUaTEksSNJJ%2Fdeepseekv4.1.png?alt=media&amp;token=203263d6-e100-4c3f-9dd4-898391874d74">deepseekv4.1.png</a></td><td><a href="https://unsloth.ai/docs/zh/mo-xing/deepseek-v4.1-flash.md">DeepSeek-V4.1-Flash</a></td></tr><tr><td><strong>Qwen3.8-27B</strong></td><td>在 Unsloth 中运行和训练 Qwen3.8-27B。</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FSQJGLfV6lTdcvKUuBsjC%2Fqwen3.8%20logo.png?alt=media&amp;token=7942746b-409d-4064-8e66-221fceb920dd">qwen3.8 logo.png</a></td><td><a href="https://unsloth.ai/docs/zh/mo-xing/qwen3.8.md">Qwen3.8-27B</a></td></tr><tr><td><strong>Qwen3.8-Flash-Next</strong></td><td>通过 11 月 4 日的全新更新运行 Qwen Flash！</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F02STQ7sMPvXPUVmCanee%2Fqwen%20next%20logo.png?alt=media&amp;token=b451d135-18c0-47e0-8584-ef64c30bc11f">qwen next logo.png</a></td><td><a href="https://unsloth.ai/docs/zh/mo-xing/qwen3.8-next.md">Qwen3.8-Flash-Next</a></td></tr><tr><td><strong>Dynamic V3.1</strong></td><td>全新的 Dynamic V3.1 量化版本现已上线！</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F7dk3MsSTYfl4Alk4obie%2Fdynamic%20v3.1.png?alt=media&amp;token=797afa8e-efbe-4368-802d-44616ef61e1e">dynamic v3.1.png</a></td><td><a href="https://unsloth.ai/docs/zh/ji-chu-zhi-shi/dynamic-3.0-ggufs.md">Dynamic 3.0 GGUFs</a></td></tr><tr><td><strong>浏览器操作</strong></td><td>使用本地 LLM 控制浏览器！</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FHg3Knjk1GznF8V6R39wk%2Ffour_grid_2x2.gif?alt=media&amp;token=008f7dab-7e91-43cb-a7bd-a8e3bfec29d5">four_grid_2x2.gif</a></td><td><a href="https://unsloth.ai/docs/zh/ji-chu-zhi-shi/browser-use.md">Browser Use</a></td></tr></tbody></table>

### ⚡ 快速入门

Unsloth 支持 MacOS、Linux、 [Windows](https://unsloth.ai/docs/zh/kuai-su-kai-shi/install/windows-installation.md), [NVIDIA](https://unsloth.ai/docs/zh/kuai-su-kai-shi/install/pip-install.md), [AMD](https://unsloth.ai/docs/zh/kuai-su-kai-shi/install/amd.md)、Intel 和 CPU 环境。请参阅： [Unsloth 要求](https://unsloth.ai/docs/zh/kuai-su-kai-shi/fine-tuning-for-beginners/unsloth-requirements.md)。下载适用于你操作系统的原生桌面应用：

<a href="https://unsloth.ai/download" class="button primary" data-icon="down-to-bracket">下载 Unsloth Desktop</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)

或者，原生安装 Unsloth Studio——这是一款基于浏览器的 Web UI：

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

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

使用相同的命令进行更新。
{% endtab %}

{% tab title="Windows" %}
**安装 Unsloth：**

```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 %}

{% columns %}
{% column width="50%" %}
{% content-ref url="/pages/8d4117b244a368b8f80b1a9d079fa31360c8e823" %}
[Complete LLM Directory](https://unsloth.ai/docs/zh/mo-xing/tutorials.md)
{% endcontent-ref %}

{% content-ref url="/pages/e722e86e330786e5915445b91f900d9f9e0ba067" %}
[Fine-tuning Guide](https://unsloth.ai/docs/zh/kuai-su-kai-shi/fine-tuning-llms-guide.md)
{% endcontent-ref %}
{% endcolumn %}

{% column width="50%" %}
{% content-ref url="/pages/20805f6881460e7c3a088cff24acf0f1090f1984" %}
[Models](https://unsloth.ai/docs/zh/kuai-su-kai-shi/unsloth-model-catalog.md)
{% endcontent-ref %}

{% content-ref url="/pages/2c2bb53a273009e389791ded9e28dd4769a55051" %}
[Unsloth API](https://unsloth.ai/docs/zh/ji-chu-zhi-shi/api.md)
{% endcontent-ref %}
{% endcolumn %}
{% endcolumns %}

### 👾 启动 Unsloth

{% columns %}
{% column width="58.333333333333336%" %}
[启动 Unsloth](https://unsloth.ai/docs/zh/ji-cheng/unsloth-start.md) 可让你将 [Claude Code](https://unsloth.ai/docs/zh/ji-chu-zhi-shi/claude-code.md), [Codex](https://unsloth.ai/docs/zh/ji-chu-zhi-shi/codex.md) 及其他智能体通过 `unsloth start` 命令连接到本地模型。

启动 Unsloth、加载模型并打开项目文件夹，然后运行：

```bash
unsloth start claude
```

将 `claude` 替换为下方任意智能体对应的名称：
{% endcolumn %}

{% column width="41.666666666666664%" %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FpXE6kCHjh8qOEaggf94M%2FScreenshot_20260718_122426.png?alt=media&amp;token=a59e4c8c-efdb-451b-b1f8-621955564f6d" alt="" width="563"><figcaption><p>使用本地 Qwen3.5 运行 Claude Code。</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

| 智能体                                                                | 命令                       |
| ------------------------------------------------------------------ | ------------------------ |
| <i class="fa-claude">:claude:</i> Claude Code                      | `unsloth start claude`   |
| <i class="fa-openai">:openai:</i> OpenAI Codex                     | `unsloth start codex`    |
| <i class="fa-deepseek">:deepseek:</i> DeepSeek Harness             | `unsloth start dsh`      |
| <i class="fa-vscode">:vscode:</i> Visual Studio Code               | `unsloth start vscode`   |
| <i class="fa-rectangle-vertical">:rectangle-vertical:</i> OpenCode | `unsloth start opencode` |
| <i class="fa-caduceus">:caduceus:</i> Hermes Agent                 | `unsloth start hermes`   |
| <i class="fa-lobster">:lobster:</i> OpenClaw                       | `unsloth start openclaw` |

### 🦥 为什么选择 Unsloth？

* 我们与以下模型背后的团队直接合作： [gpt-oss](https://docs.unsloth.ai/new/gpt-oss-how-to-run-and-fine-tune#unsloth-fixes-for-gpt-oss), [Qwen3](https://www.reddit.com/r/LocalLLaMA/comments/1kaodxu/qwen3_unsloth_dynamic_ggufs_128k_context_bug_fixes/), [Llama 4](https://github.com/ggml-org/llama.cpp/pull/12889), [Mistral](https://huggingface.co/mistralai/Mistral-Medium-3.5-128B/discussions/18), [Gemma 1-3](https://news.ycombinator.com/item?id=39671146) 和 [Phi-4](https://unsloth.ai/blog/phi4)，并且我们已经 **修复了关键错误** ，大幅提升了模型准确率。例如，Andrej Karpathy 曾 [称赞我们的工作](https://x.com/karpathy/status/1765473722985771335).
* Unsloth 简化了本地训练、推理、数据处理和部署
* Unsloth 支持对 500 多种模型进行推理和训练： [视觉](https://unsloth.ai/docs/zh/ji-chu-zhi-shi/vision-fine-tuning.md), [语音合成](https://unsloth.ai/docs/zh/ji-chu-zhi-shi/text-to-speech-tts-fine-tuning.md), [嵌入](https://unsloth.ai/docs/zh/ji-chu-zhi-shi/embedding-finetuning.md), [强化学习](https://unsloth.ai/docs/zh/kuai-su-kai-shi/reinforcement-learning-rl-guide.md)

### ⭐ 功能

Unsloth 让你能够运行和训练文本、 [音频](https://unsloth.ai/docs/basics/text-to-speech-tts-fine-tuning), [嵌入](https://unsloth.ai/docs/new/embedding-finetuning), [视觉](https://unsloth.ai/docs/basics/vision-fine-tuning) 等模型。Unsloth 为推理和训练提供了许多重要功能：

#### 推理

* 运行和训练 LLM、扩散、嵌入及音频模型： [Qwen3.8](https://unsloth.ai/docs/zh/mo-xing/qwen3.8.md), [Kimi K3](https://unsloth.ai/docs/models/kimi-k3), MiniMax-H3、 [Muse Glimmer](https://unsloth.ai/docs/models/muse-glimmer), [DeepSeek-V4](https://unsloth.ai/docs/models/deepseek-v4), [Gemma 4](https://unsloth.ai/docs/models/gemma-4).
* **智能体与工具：** 将本地模型与 [Claude Code](https://unsloth.ai/docs/basics/claude-code), [Codex](https://unsloth.ai/docs/basics/codex)和 [MCP](https://unsloth.ai/docs/basics/mcp)配合使用，包括工具调用和代码执行。
* **搜索与 RAG：** 使用私密且不限量的网络搜索、深度研究、自动压缩（滚动上下文窗口）和 RAG。
* **浏览器与计算机操作：** 让本地 LLM [编辑你的桌面](https://unsloth.ai/docs/basics/computer-use), [编辑文件和网站](https://unsloth.ai/docs/basics/browser-use)、填写表单、阅读 PDF
* **图像与视频：** 运行和训练 [图像](https://unsloth.ai/docs/basics/diffusion-image) 和视频扩散模型或多模态模型
* **远程与局域网：** 通过 [局域网](https://unsloth.ai/docs/basics/lan) 或通过安全的 [Cloudflare](https://unsloth.ai/docs/basics/how-to-serve-local-llms-anywhere-secure-remote-access-with-cloudflare-and-unsloth) HTTPS，从任意设备访问你的本地模型。
* **连接：** 通过 [兼容 OpenAI 的 API](https://unsloth.ai/docs/basics/api)提供模型服务。还可连接你的 ChatGPT/Codex 订阅和 [云服务提供商](https://unsloth.ai/docs/integrations/connections)
* **沙盒：** [控制模型运行命令时](https://unsloth.ai/docs/new/studio/sandboxing-in-unsloth) 可以访问哪些文件。

#### 训练与部署

* **微调：** 训练 LLM、扩散、TTS 和嵌入模型，速度提升 2 倍、VRAM 占用减少 70%，且 [不损失准确率](https://unsloth.ai/blog#training)
* **全面支持：** 支持 [强化学习](https://unsloth.ai/docs/get-started/reinforcement-learning-rl-guide)、LoRA、QLoRA、全量微调、预训练、RL、GRPO、DPO 和 FP8。
* **导出与部署：** [导出](https://unsloth.ai/docs/new/studio/export) 或部署模型，支持 [GGUF](https://unsloth.ai/docs/basics/inference-and-deployment/saving-to-gguf)、NVFP4、FP8 等格式。
* **数据集：** 使用 [数据配方](https://unsloth.ai/docs/new/studio/data-recipe).

### **视频演示**

{% embed url="<https://www.youtube.com/watch?v=_1hgTTuber4>" %}

{% columns %}
{% column width="50%" %}
{% content-ref url="/pages/e1e43893beb1c3e2a075324e9a00800315b2e1a3" %}
[Unsloth 更新](https://unsloth.ai/docs/zh/xin/changelog.md)
{% endcontent-ref %}

{% content-ref url="/pages/9a72670992feb75def412a693565c84a88c8a266" %}
[推理与部署](https://unsloth.ai/docs/zh/ji-chu-zhi-shi/inference-and-deployment.md)
{% endcontent-ref %}
{% endcolumn %}

{% column width="50%" %}
{% content-ref url="/pages/4180d003e52f27564574c43829dd41c1236913b6" %}
[Unsloth Start](https://unsloth.ai/docs/zh/ji-cheng/unsloth-start.md)
{% endcontent-ref %}

{% content-ref url="/pages/e658f01212ed739b6cc1648a22333767661730a1" %}
[Dynamic 3.0 GGUFs](https://unsloth.ai/docs/zh/ji-chu-zhi-shi/dynamic-3.0-ggufs.md)
{% endcontent-ref %}
{% endcolumn %}
{% endcolumns %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fgit-blob-134302f2507d4313b9575917c9a43b0a0028856c%2Flarge%20sloth%20wave.png?alt=media" alt="" width="188"><figcaption></figcaption></figure>


---

# 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/docs.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.
