> 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/kai-shi-shi-yong/readme.md).

# Unsloth 文档

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

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

<a href="/pages/1bc06634f9646051a40b3ee9c1e88ef2179a0bc2" class="button primary">开始使用</a> <a href="https://github.com/unslothai/unsloth" class="button secondary">我们的 GitHub</a>

<table data-view="cards" data-full-width="false"><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>AMD 版 Unsloth！</strong></td><td>你现在可以在 AMD 上运行并训练模型。</td><td><a href="/files/9cd665f94e5b2a319b9e4e8176f88a8ce447cb7e">/files/9cd665f94e5b2a319b9e4e8176f88a8ce447cb7e</a></td><td><a href="/pages/6eeaac81e7a7e3da5e7f0f844d5686500ef20959">/pages/6eeaac81e7a7e3da5e7f0f844d5686500ef20959</a></td></tr><tr><td><strong>GLM-5.2</strong></td><td>在本地运行最强的开源模型。</td><td><a href="/files/9648d94ff49ae13dc1a6da9ac1e479f53756c7e9">/files/9648d94ff49ae13dc1a6da9ac1e479f53756c7e9</a></td><td><a href="/pages/986f178fb44971bd081c36c351922d60469ba3ee">/pages/986f178fb44971bd081c36c351922d60469ba3ee</a></td></tr><tr><td><strong>Unsloth Start</strong></td><td>将你的代理连接到任意本地 LLM。</td><td><a href="/files/2b9b0fce4506db495b024241703f5bfde7257253">/files/2b9b0fce4506db495b024241703f5bfde7257253</a></td><td><a href="/pages/4180d003e52f27564574c43829dd41c1236913b6">/pages/4180d003e52f27564574c43829dd41c1236913b6</a></td></tr><tr><td><strong>DeepSeek-V4</strong></td><td>运行新的 284B Flash 模型。</td><td><a href="/files/67b015dc396f26780060fa85863cc7660b18228a">/files/67b015dc396f26780060fa85863cc7660b18228a</a></td><td><a href="/pages/8cefdd6ae681e7680f74c7b6a344fd7c21933ee8">/pages/8cefdd6ae681e7680f74c7b6a344fd7c21933ee8</a></td></tr><tr><td><strong>动态 NVFP4</strong></td><td>在你的 Blackwell GPU 上以 2 倍速度运行模型。</td><td><a href="/files/73885e8357dacbb58758ee23e3a007ae8bede7f3">/files/73885e8357dacbb58758ee23e3a007ae8bede7f3</a></td><td><a href="/pages/ce3a740d74ce61e6983ea150277bef7032e7e92d">/pages/ce3a740d74ce61e6983ea150277bef7032e7e92d</a></td></tr><tr><td><strong>介绍 Unsloth Studio</strong></td><td>全新的开源、无代码 UI，用于训练和运行 LLM。</td><td><a href="/files/2dfd7fbf0b551d243091cd1054c69104594c25d5">/files/2dfd7fbf0b551d243091cd1054c69104594c25d5</a></td><td><a href="/pages/1bc06634f9646051a40b3ee9c1e88ef2179a0bc2">/pages/1bc06634f9646051a40b3ee9c1e88ef2179a0bc2</a></td></tr></tbody></table>

{% 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-zhi-shi/api.md)
{% endcontent-ref %}
{% endcolumn %}
{% endcolumns %}

### ⚡ 快速入门

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)。使用相同命令进行更新：

**MacOS、Linux、WSL：**

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

**Windows PowerShell：**

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

### 👾 Unsloth Start

{% columns %}
{% column width="58.333333333333336%" %}
[Unsloth Start](/docs/zh/ji-cheng/unsloth-start.md) 让你连接 [Claude Code](/docs/zh/ji-chu-zhi-shi/claude-code.md), [Codex](/docs/zh/ji-chu-zhi-shi/codex.md) 以及其他代理到本地模型，通过 `unsloth start` 命令。

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

```bash
unsloth start claude
```

将 `claude` 替换为下面任意代理：
{% endcolumn %}

{% column width="41.666666666666664%" %}

<figure><img src="/files/86e035acbaafcca2b57e4bb3f4191ad68bf30547" 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-caduceus">:caduceus:</i> Hermes Agent                 | `unsloth start hermes`   |
| <i class="fa-lobster">:lobster:</i> OpenClaw                       | `unsloth start openclaw` |
| <i class="fa-rectangle-vertical">:rectangle-vertical:</i> OpenCode | `unsloth start opencode` |

### 🦥 为什么选择 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-zhi-shi/vision-fine-tuning.md), [TTS](/docs/zh/ji-chu-zhi-shi/text-to-speech-tts-fine-tuning.md), [嵌入](/docs/zh/ji-chu-zhi-shi/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 为推理和训练提供了许多关键功能：

#### 推理

* [自我修复式工具调用](/docs/zh/xin-de/studio/chat.md#auto-healing-tool-calling) / 网络搜索并使用 [将 Unsloth 作为 API](/docs/zh/ji-chu-zhi-shi/api.md).
* 将你的本地模型连接到任意代理： [Claude Code](/docs/zh/ji-chu-zhi-shi/claude-code.md), [Codex](/docs/zh/ji-chu-zhi-shi/codex.md), [Hermes](/docs/zh/ji-cheng/hermes-agent.md) 等。
* 搜索 + 下载 + 运行任何模型，如 GGUF、LoRA 适配器、safetensors。
* [自动推理参数](/docs/zh/xin-de/studio/chat.md#auto-parameter-tuning) 调优并编辑聊天模板。
* [导出或保存](/docs/zh/xin-de/studio/export.md) 你的模型为 GGUF、16 位 safetensor 等格式。
* [比较输出](/docs/zh/xin-de/studio/chat.md#model-arena) 并排查看两个不同模型的结果。

#### 训练

* 训练和 [RL](/docs/zh/kai-shi-shi-yong/reinforcement-learning-rl-guide.md) 500+ 模型，速度约快 2 倍，VRAM 约少 70%（无准确率损失）
* 支持全量微调、预训练、4 位、16 位和 FP8 训练。
* [自动创建数据集](/docs/zh/xin-de/studio/data-recipe.md) 从 PDF、CSV、DOCX 文件中提取。通过可视化节点工作流编辑数据。
* 可观测性：实时监控训练、跟踪 loss、GPU 使用率、自定义图表
* 最高效的 [**强化学习**](/docs/zh/kai-shi-shi-yong/reinforcement-learning-rl-guide.md) 库，GRPO 仅使用少 80% 的 VRAM， [FP8](/docs/zh/kai-shi-shi-yong/reinforcement-learning-rl-guide/fp8-reinforcement-learning.md) 等。
* [多 GPU](/docs/zh/ji-chu-zhi-shi/multi-gpu-training-with-unsloth.md) 可以使用，但更好的版本即将到来！

### 什么是微调和 RL？为什么需要？

[**微调** 一个 LLM](/docs/zh/kai-shi-shi-yong/fine-tuning-llms-guide.md) 可定制其行为、增强领域知识，并针对特定任务优化性能。通过在数据集上对预训练模型（例如 Llama-3.1-8B）进行微调，你可以：

* **更新知识**：引入新的领域特定信息。
* **定制行为**：调整模型的语气、个性或响应风格。
* **针对任务优化**：提升特定用例的准确性和相关性。

[**强化学习（RL）**](/docs/zh/kai-shi-shi-yong/reinforcement-learning-rl-guide.md) 是指一个“代理”通过与环境交互并接收 **反馈** ，其形式为 **奖励** 或 **惩罚**.

* **动作：** 模型生成的内容（例如一句话）。
* **奖励：** 表示模型动作好坏的信号（例如：回答是否遵循指令？是否有帮助？）。
* **环境：** 模型正在处理的场景或任务（例如：回答用户的问题）。

**微调或 RL 的示例用例**:

* 使 LLM 能预测标题对公司是正面影响还是负面影响。
* 可利用历史客户交互，生成更准确且更定制化的回复。
* 在法律文本上微调 LLM，用于合同分析、案例法研究和合规。

你可以把微调后的模型看作一个为高效、有效完成特定任务而设计的专业代理。 **微调可以复制 RAG 的全部能力**，但反之则不行。

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

{% content-ref url="/pages/9a72670992feb75def412a693565c84a88c8a266" %}
[推理与部署](/docs/zh/ji-chu-zhi-shi/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 2.0 GGUFs](/docs/zh/ji-chu-zhi-shi/unsloth-dynamic-2.0-ggufs.md)
{% endcontent-ref %}
{% endcolumn %}
{% endcolumns %}

<figure><img src="/files/e4b5cbe009022b39c4c31fc9c211fd0ea61c60fb" 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/kai-shi-shi-yong/readme.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.
