> 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/install/mac.md).

# 在 MacOS 上安装 Unsloth

在 macOS 上安装 Unsloth Desktop、Unsloth Studio 或 Unsloth Core。

要安装 **Unsloth Desktop** 要在你的 Mac 上运行并训练 MLX 或 GGUF 模型，请按照以下步骤操作。

{% stepper %}
{% step %}

### 下载

<a href="https://unsloth.ai/download/mac" class="button secondary" data-icon="apple">下载适用于 Mac 的 Unsloth</a>
{% endstep %}

{% step %}

### 安装

1. 打开 Unsloth 安装程序（`.dmg` 文件）
2. 将 Unsloth 拖到 **应用程序**
3. 启动应用并等待安装完成
   {% endstep %}

{% step %}

### 选择一个模型

打开顶部的“选择模型”下拉菜单或“Model hub”标签页，选择适合你设备的模型和量化方式，然后下载。下载完成后，开始聊天——无需设置。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FNCEVgKLJI0goPqjgcg9B%2Fmodel%20hub%20models.png?alt=media&amp;token=533b5e3c-a901-4b33-963e-4a703cc9d5a6" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Unsloth 现在已准备就绪

要开始聊天，请输入消息并按 Enter 键。

* **连接工具：** [Claude Code](/docs/zh/ji-chu/claude-code.md), [Codex](/docs/zh/ji-chu/codex.md)、网页搜索， [MCP](/docs/zh/ji-chu/mcp.md) 等等
* **训练模型：** 微调文本、扩散模型、嵌入模型等
* **生成媒体：** 在本地创建和训练图像、视频、TTS

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FpAGvwjGD0iVMZKBoyu7m%2Fgreeennn.png?alt=media&amp;token=d17a5528-8375-444c-9aff-f9e9f7903bcd" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### 手动安装 Unsloth Studio

下面的命令将安装 **Unsloth Studio**，即基于浏览器的 Web UI。它不会安装 Unsloth Desktop 或基于代码的 Unsloth Core 软件包。

#### 安装 Unsloth Studio

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

使用相同的命令来 **更新**.

### 启动

每次你想再次启动 Unsloth 时：

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

有关详细的 Unsloth Studio 安装说明和要求， [查看我们的指南](/docs/zh/xin/studio/install.md).

## 卸载

### 桌面版卸载

1. 如果 Unsloth 正在运行，请关闭它
2. 打开 **访达**
3. 前往 **应用程序**
4. 找到 Unsloth
5. 右键点击 → **移动到废纸篓**

#### Unsloth Studio 手动卸载

完全移除 Unsloth Studio 的推荐方式是使用适用于你的操作系统的卸载脚本。它会停止任何正在运行的服务器，移除应用、CLI 命令、启动器数据、快捷方式，以及平台特定条目（macOS `.app` 捆绑包 + Launch Services；Windows 开始菜单 + 注册表 + PATH）：

```shellscript
curl -fsSL https://raw.githubusercontent.com/unslothai/unsloth/main/scripts/uninstall.sh | sh
```

如果你只想移除特定部分：

**1. 仅移除应用** （保留历史记录、聊天、检查点和导出不受影响）：

* `rm -rf ~/.unsloth/studio/unsloth_studio`

**2. 完全移除 Unsloth** （保留其他 Unsloth 工具不受影响）：

* &#x20;`rm -rf ~/.unsloth/studio`

**3. 移除所有与 Unsloth 相关的内容：**

* `rm -rf ~/.unsloth`

{% hint style="warning" %}
注意：第 3 步会删除历史记录、聊天、模型检查点和导出的所有内容。此操作无法撤销。
{% endhint %}

**4. 移除快捷方式和符号链接：**

```shellscript
rm -rf ~/Applications/Unsloth\ Studio.app ~/Desktop/Unsloth\ Studio
```

**5. 移除 CLI 命令：**

* `rm -f ~/.local/bin/unsloth`

{% hint style="info" %}
注意：第 1-5 步不会影响你已下载的 HF 模型文件。如果你想释放这部分空间，请参阅下面的删除缓存的 HF 模型文件。
{% endhint %}

### **删除模型文件**

你可以通过模型搜索中的垃圾桶图标删除旧模型文件，或从 Hugging Face 缓存目录中移除相应的已缓存模型文件夹。

默认缓存位置为：

```bash
~/.cache/huggingface/hub/
```

如果 `HF_HUB_CACHE` 或者 `HF_HOME` 已设置，请改用该位置。你可以通过以下命令查看：

```bash
echo ${HF_HUB_CACHE:-${HF_HOME:-${XDG_CACHE_HOME:-$HOME/.cache}/huggingface}/hub}
```

要删除某个特定模型，请移除其文件夹（例如 `models--unsloth--Llama-3.1-8B-bnb-4bit`）从缓存目录中删除。要清除所有已缓存模型：

```bash
rm -rf ~/.cache/huggingface/hub/
```


---

# 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/install/mac.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.
