> 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

要在本地 Apple MacOS 设备上本地安装 Unsloth，请按照以下步骤操作：

### 安装 Unsloth

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

### 卸载

彻底移除 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. 完全移除 Studio** （保留其他 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.
