# Unsloth 文档

Unsloth 让你能够在自己的本地硬件上运行和训练 AI 模型。

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

<a href="/pages/237026badf5bc822cff5a01118fb7de3da2e2153" 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>Qwen3.6</strong></td><td>全新的 Qwen3.6-27B 模型来了！</td><td><a href="/files/3633b4d39ba4c75356f2106d848b79d2dbba8359">/files/3633b4d39ba4c75356f2106d848b79d2dbba8359</a></td><td><a href="/pages/213bd08e4302b621f4392f7ee38decb275ffab02">/pages/213bd08e4302b621f4392f7ee38decb275ffab02</a></td></tr><tr><td><strong>Unsloth API 端点</strong></td><td>通过我们全新的 API 使用 Unsloth 进行推理。</td><td><a href="/files/8107f7256aad887cf1f43626598f906531e54a78">/files/8107f7256aad887cf1f43626598f906531e54a78</a></td><td><a href="/pages/2c2bb53a273009e389791ded9e28dd4769a55051">/pages/2c2bb53a273009e389791ded9e28dd4769a55051</a></td></tr><tr><td><strong>Google Gemma 4</strong></td><td>运行并训练 Google 全新的 Gemma 4 模型！</td><td><a href="/files/4cf8e9a56e43aacbcc50d5a8e5f62a33b061cd8d">/files/4cf8e9a56e43aacbcc50d5a8e5f62a33b061cd8d</a></td><td><a href="/pages/10f714f4a513e0d0a86b6f9d5945f9014729b035">/pages/10f714f4a513e0d0a86b6f9d5945f9014729b035</a></td></tr><tr><td><strong>NVIDIA Nemotron 3 Omni</strong></td><td>在本地运行最强大的 30B omni 模型。</td><td><a href="/files/4e921c986371c11b2160d3a557f611283d9a4939">/files/4e921c986371c11b2160d3a557f611283d9a4939</a></td><td><a href="/pages/31f07ee6a66a73019ccc7bc333592f8522540f7b">/pages/31f07ee6a66a73019ccc7bc333592f8522540f7b</a></td></tr><tr><td><strong>介绍 Unsloth Studio</strong></td><td>用于训练和运行 LLM 的全新、无需代码的 UI。</td><td><a href="/files/2dfd7fbf0b551d243091cd1054c69104594c25d5">/files/2dfd7fbf0b551d243091cd1054c69104594c25d5</a></td><td><a href="/pages/1bc06634f9646051a40b3ee9c1e88ef2179a0bc2">/pages/1bc06634f9646051a40b3ee9c1e88ef2179a0bc2</a></td></tr><tr><td><strong>Kimi K2.6</strong></td><td>运行全新的 SOTA 开源模型。</td><td><a href="/files/98765248d3564495a3ae7fffaa915498f16bf1d4">/files/98765248d3564495a3ae7fffaa915498f16bf1d4</a></td><td><a href="/pages/8a1261a3b4582d901fbe0ea49e315e28824eebf2">/pages/8a1261a3b4582d901fbe0ea49e315e28824eebf2</a></td></tr></tbody></table>

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

{% content-ref url="/pages/622af8e56d0924dd99cc871bc54a538197574e1a" %}
[Unsloth 笔记本](/docs/zh/kai-shi-shi-yong/unsloth-notebooks.md)
{% endcontent-ref %}
{% endcolumn %}

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

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

### 🦥 为什么选择 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 为推理和训练都提供了许多关键功能：

#### 推理

* 搜索 + 下载 + 运行任意模型，如 GGUF、LoRA 适配器、safetensors。
* [自我修复式工具调用](/docs/zh/xin/studio/chat.md#auto-healing-tool-calling) / 网络搜索，并调用与 OpenAI 兼容的 API。
* [自动推理参数](/docs/zh/xin/studio/chat.md#auto-parameter-tuning) 调优并编辑聊天模板。
* [导出或保存](/docs/zh/xin/studio/export.md) 你的模型为 GGUF、16 位 safetensor 等格式。
* [对比输出](/docs/zh/xin/studio/chat.md#model-arena) 并排比较两个不同模型的输出。

#### 训练

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

### 快速入门

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

#### Docker

使用我们的官方 **Docker 镜像**: [`unsloth/unsloth`](https://hub.docker.com/r/unsloth/unsloth) 目前可用于 Windows、WSL 和 Linux。MacOS 支持即将到来。

#### 启动 Unsloth

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

### 什么是微调和 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 在法律文本上进行微调，用于合同分析、判例法研究和合规。 **你可以把微调后的模型看作一个专门的智能体，旨在更高效、更有效地完成特定任务。**&#x5FAE;调可以复现 RAG 的全部能力

{% columns %}
{% column width="50%" %}
{% content-ref url="/pages/23f746d97a493793f0cf778956c3d1e708c15940" %}
[常见问题 + 微调适合我吗？](/docs/zh/kai-shi-shi-yong/fine-tuning-for-beginners/faq-+-is-fine-tuning-right-for-me.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/7e8be22a966d3861ff1f7ebbd178ae7144d05c51" %}
[Reinforcement Learning Guide](/docs/zh/kai-shi-shi-yong/reinforcement-learning-rl-guide.md)
{% endcontent-ref %}

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

<figure><img src="/files/e4b5cbe009022b39c4c31fc9c211fd0ea61c60fb" alt="" width="188"><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://unsloth.ai/docs/zh/kai-shi-shi-yong/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
