# 使用 Unsloth Studio 导出模型

使用 [Unsloth Studio](/docs/zh/xin/studio.md) 将模型导出、保存或转换为 GGUF、Safetensors 或 LoRA，用于在 Unsloth、llama.cpp、Ollama、vLLM 等环境中部署、共享或进行本地推理。可导出已训练的检查点，或转换任何现有模型。

<div data-with-frame="true"><figure><img src="/files/fd56198d7b81c8cae1273c224ce7afa25b077dde" alt="" width="563"><figcaption></figcaption></figure></div>

{% stepper %}
{% step %}

### 选择训练运行

首先选择要导出的训练运行。每次运行代表一次完整的训练会话，可能包含多个检查点。

选择运行后，选择要导出的检查点。检查点是在训练过程中创建并保存的模型版本。

<div data-with-frame="true"><figure><img src="/files/d2a0b2b44a0bd97c4798f7b26b8689634213eb40" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### 选择检查点

较后期的检查点通常代表最终训练完成的模型，但你可以根据需要导出任何检查点。

<div data-with-frame="true"><figure><img src="/files/1e32cdb2d5cf02706b78a8668fe0c7c46da22a54" alt="" width="560"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### 导出方式

根据你的工作流程，你可以导出合并模型、LoRA 适配器权重，或用于本地推理的 GGUF 模型。

<div data-with-frame="true"><figure><img src="/files/952954d9a679d1f3f8b034c9210f87ff95cb0017" alt=""><figcaption></figcaption></figure></div>

每种导出方式会生成模型的不同版本，具体取决于你计划如何运行或共享它。下表解释了每个选项导出的内容。

| 导出类型             | 说明                                                                      |
| ---------------- | ----------------------------------------------------------------------- |
| 合并模型             | **16 位模型** ，将 LoRA 适配器合并到基础权重中。                                         |
| 仅 LoRA           | 导出 **仅适配器权重**。需要原始基础模型。                                                 |
| GGUF / llama.cpp | 将模型转换为 **GGUF 格式** ，用于 Unsloth / llama.cpp **/** Ollama / LM Studio 推理。 |
| {% endstep %}    |                                                                         |

{% step %}

### 导出 / 本地保存

导出模型时，你可以选择结果文件的保存位置。模型可以直接下载到你的机器，也可以推送到 Hugging Face Hub 进行托管和共享。

将导出的模型文件直接保存到你的机器上。此选项适用于在本地运行模型、手动分发文件或与本地推理工具集成。

<div data-with-frame="true"><figure><img src="/files/7db6f2458e87ab565ff99c111273fda8580507ba" alt="" width="325"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### 推送到 Hub

将导出的模型上传到 Hugging Face Hub。这使你能够从一个中心仓库托管、共享和部署模型。

你需要一个 Hugging Face 写入令牌才能发布模型。

<div data-with-frame="true"><figure><img src="/files/8b70bf3710ca6a3e13a63799bab22b7f0f768acd" alt="" width="325"><figcaption></figcaption></figure></div>

{% hint style="success" %}
如果你已经通过 Hugging Face CLI 完成身份验证，则写入令牌可以留空。
{% endhint %}
{% endstep %}
{% endstepper %}


---

# 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/xin/studio/export.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.
