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

# Unsloth 文档

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

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

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

<a href="https://unsloth.ai/download" class="button primary" data-icon="down-to-bracket">下载</a><a href="/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>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="/docs/zh/mo-xing/qwen3.8.md">Qwen3.8-27B</a></td></tr><tr><td><strong>Qwen3.8-Flash-Next</strong></td><td>采用 Qwen4 架构的新多模态 MoE 模型。</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FD5XvlMiglB75xLiQQUq8%2Fqwen38%20flash%20new%20logo.png?alt=media&amp;token=cbe972b2-a558-4dbd-9501-a7e2e898df8f">qwen38 flash new logo.png</a></td><td><a href="/docs/zh/mo-xing/qwen3.8-next.md">Qwen3.8-Flash-Next</a></td></tr><tr><td><strong>认识 Unsloth Desktop</strong></td><td>第一款用于运行和训练模型的桌面应用。</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FyUdniXManojk20Q3M5Lf%2Fintroducing%20unsloth%20desktop%20thumb.png?alt=media&amp;token=5ecd2f25-b996-4749-8242-ffd21b080ae7">introducing unsloth desktop thumb.png</a></td><td><a href="/docs/zh/desktop.md">Introducing Unsloth Desktop</a></td></tr><tr><td><strong>GLM-5.3-Flash</strong></td><td>新的 320B 模型，又名 <code>ox-alpha</code> 由 Z.ai 推出。</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FeHSdHWsGl4rQtUUgSkGj%2Fglm%205.3%20flash.png?alt=media&amp;token=acd21ab7-c5b5-4338-8b23-8d4cf16584f3">glm 5.3 flash.png</a></td><td><a href="/docs/zh/mo-xing/glm-5.3-flash.md">GLM-5.3-Flash</a></td></tr><tr><td><strong>DeepSeek-V4 Vision</strong></td><td>DeepSeek 的首个视觉模型。可在 128GB 内存上运行。</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FYCbdIeMsEQmDJoyii4tl%2Fdeepseek%20v4%20logo.png?alt=media&amp;token=0d1ec333-bcbd-4ecb-8891-5393a1c5bb0a">deepseek v4 logo.png</a></td><td><a href="/docs/zh/mo-xing/deepseek-v4.md">DeepSeek-V4-Flash</a></td></tr><tr><td><strong>GLM-5.3</strong></td><td>运行迄今最强的开源模型。</td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FEOLfeTQcmdj4Ofo5jGhS%2Fglm%205.3%20logo.png?alt=media&amp;token=220f0d33-d5fc-4fc1-8152-126bd21f2cde">glm 5.3 logo.png</a></td><td><a href="/docs/zh/mo-xing/glm-5.3.md">GLM-5.3</a></td></tr></tbody></table>

### ⚡ 快速开始

Unsloth 支持 macOS、Linux、 [Windows](/docs/zh/kai-shi-shi-yong/install/windows-installation.md), [NVIDIA](/docs/zh/kai-shi-shi-yong/install/pip-install.md), [AMD](/docs/zh/kai-shi-shi-yong/install/amd.md)、Intel 和 CPU 配置。参见： [Unsloth 要求](/docs/zh/kai-shi-shi-yong/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)

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

**macOS、Linux、WSL：**

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

**Windows PowerShell：**

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

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

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

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

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

### 👾 Unsloth Start

{% columns %}
{% column width="58.333333333333336%" %}
[Unsloth Start](/docs/zh/ji-cheng/unsloth-start.md) 让你连接 [Claude Code](/docs/zh/ji-chu/claude-code.md), [Codex](/docs/zh/ji-chu/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>Claude Code 在本地运行 Qwen3.5。</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-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+ 个模型的推理和训练： [视觉](/docs/zh/ji-chu/vision-fine-tuning.md), [TTS](/docs/zh/ji-chu/text-to-speech-tts-fine-tuning.md), [嵌入](/docs/zh/ji-chu/embedding-finetuning.md), [RL](/docs/zh/kai-shi-shi-yong/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](/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。
* **图像和视频：** 运行和训练 [图像](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)

#### 训练与部署

* **微调：** 使用以下方式，让 LLM、扩散、TTS 和嵌入模型的训练速度提升 2 倍，并减少 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 和更多格式。
* **数据集：** 使用以下工具从 PDF、CSV、DOCX 文件等构建数据集： [数据配方](https://unsloth.ai/docs/new/studio/data-recipe).

### **最新模型**

<table data-column-title-hidden data-card-wrap="false" data-view="cards"><thead><tr><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><h4>Qwen3.8</h4></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="/docs/zh/mo-xing/qwen3.8.md">Qwen3.8-27B</a></td></tr><tr><td><h4>Meta Muse Glimmer</h4></td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fnbdjif7yfvvH1j6aBmpS%2FMuse%20glimmer%20logo%20final.png?alt=media&amp;token=5031f9dc-c257-4488-95be-856e1ea31ec8">Muse glimmer logo final.png</a></td><td></td></tr><tr><td><h4>Kimi K3</h4></td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FwCzVjy7Q6EQLthkUuZqk%2Fkimik3%20logo.png?alt=media&amp;token=945dfb54-9c25-4539-9138-e23f841ca168">kimik3 logo.png</a></td><td><a href="/docs/zh/mo-xing/kimi-k3.md">Kimi K3 </a></td></tr><tr><td><h4>DeepSeek V4</h4></td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FYCbdIeMsEQmDJoyii4tl%2Fdeepseek%20v4%20logo.png?alt=media&amp;token=0d1ec333-bcbd-4ecb-8891-5393a1c5bb0a">deepseek v4 logo.png</a></td><td><a href="/docs/zh/mo-xing/deepseek-v4.md">DeepSeek-V4-Flash</a></td></tr><tr><td><h4>Qwen3.6</h4></td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fdy7z03AUFzXHKqqOY7kC%2Fqwen3.6%20logo.png?alt=media&amp;token=a894c047-a9ea-4f9c-824a-be86ec81f54d">qwen3.6 logo.png</a></td><td><a href="/docs/zh/mo-xing/qwen3.6.md">Qwen3.6</a></td></tr><tr><td><h4>GLM-5.2</h4></td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FmbYXj0v0p5zbeESPDYUr%2Fglm52.png?alt=media&amp;token=0cb4ae58-d249-403a-9fb5-72e9e93f8da9">glm52.png</a></td><td><a href="/docs/zh/mo-xing/glm-5.2.md">GLM-5.2</a></td></tr><tr><td><h4>Gemma 4</h4></td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FkEjWOJqBWCtIN9Cg6CdI%2FGemma%204%20landscape.png?alt=media&amp;token=57d3f596-dae8-4eab-80e6-0847794ffc8d">Gemma 4 landscape.png</a></td><td><a href="/docs/zh/mo-xing/gemma-4.md">Gemma 4</a></td></tr><tr><td><h4>MiniMax M3</h4></td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FsaXyQq0XeFuudTK5ZEGw%2Fminimaxm3.png?alt=media&amp;token=4af28954-abd2-4163-a0fe-ed4e42e25d2f">minimaxm3.png</a></td><td><a href="/docs/zh/mo-xing/minimax-m3.md">MiniMax M3</a></td></tr><tr><td><h4>DiffusionGemma</h4></td><td><a href="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FQNex1tTcNU8rPfsa1Pja%2Fdiffusiongemma%20logo.png?alt=media&amp;token=37e9fa55-c003-4877-9519-d1687ce48322">diffusiongemma logo.png</a></td><td><a href="/docs/zh/mo-xing/diffusiongemma.md">DiffusionGemma</a></td></tr></tbody></table>

### **视频演示**

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

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

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

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

{% content-ref url="/pages/e658f01212ed739b6cc1648a22333767661730a1" %}
[Dynamic 3.0 GGUFs](/docs/zh/ji-chu/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 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/docs.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.
