# Unsloth 需求

Unsloth 可以通过两种方式使用：通过 [Unsloth Studio](/docs/zh/xin-zeng/studio/install.md)，Web UI，或通过 [Unsloth Core](#unsloth-core-requirements)，原始的基于代码版本。每种都有不同的要求。

## **Unsloth Studio 要求**

* **Mac：** 类似 CPU - [聊天](/docs/zh/xin-zeng/studio/chat.md#using-unsloth-studio-chat) + [数据食谱](/docs/zh/xin-zeng/studio/data-recipe.md) 目前可用。 **MLX** 训练很快就会推出。
* **CPU：Unsloth 在没有 GPU 的情况下仍可运行**，用于聊天 + 数据食谱。
* **训练：** 可在以下设备上运行 **NVIDIA**：RTX 30、40、50、Blackwell、DGX Spark/Station 等 + **Intel** GPU
* **即将推出：** 支持 **Apple MLX** 和 **AMD**.

### <i class="fa-windows">:windows:</i> Window**s**

Unsloth Studio 可直接在 Windows 上运行，无需 WSL。要训练模型，请确保你的系统满足以下要求：

**要求**

* Windows 10 或 Windows 11（64 位）
* 已安装驱动程序的 NVIDIA GPU
* **App Installer** （包括 `winget`): [这里](https://learn.microsoft.com/en-us/windows/msix/app-installer/install-update-app-installer)
* **Git**: `winget install --id Git.Git -e --source winget`
* **Python**：版本 3.11 到 3.14 之前（不含 3.14）
* 在 Python 环境中工作，例如 **uv**, **venv**，或 **conda/mamba**

### <i class="fa-apple">:apple:</i> MacOS

Unsloth Studio 可在 Mac 设备上用于 [聊天](#run-models-locally) 用于 GGUF 模型和 [数据食谱](/docs/zh/xin-zeng/studio/data-recipe.md) ([导出](/docs/zh/xin-zeng/studio/export.md) 即将推出）。 **MLX 训练即将推出！**

* macOS 12 Monterey 或更新版本（Intel 或 Apple Silicon）
* 安装 Homebrew： [这里](https://brew.sh/)
* Git： `brew install git`&#x20;
* cmake： `brew install cmake`&#x20;
* openssl： `brew install openssl`
* Python：版本 3.11 到 3.14 之前（不含 3.14）
* 在 Python 环境中工作，例如 **uv**, **venv**，或 **conda/mamba**

### <i class="fa-linux">:linux:</i> Linux 和 WSL

* Ubuntu 20.04+ 或类似发行版（64 位）
* 已安装驱动程序的 NVIDIA GPU
* CUDA 工具包（推荐 12.4+，blackwell 需 12.8+）
* Git： `sudo apt install git`
* Python：版本 3.11 到 3.14 之前（不含 3.14）
* 在 Python 环境中工作，例如 **uv**, **venv**，或 **conda/mamba**

### <i class="fa-microchip">:microchip:</i> 仅 CPU

Unsloth Studio 支持 CPU 设备用于 [聊天](#run-models-locally) 用于 GGUF 模型和 [数据食谱](/docs/zh/xin-zeng/studio/data-recipe.md) ([导出](/docs/zh/xin-zeng/studio/export.md) 即将推出）

* 与上面提到的 Linux 要求相同（不包括 NVIDIA GPU 驱动）以及 MacOS。

### **训练**

Unsloth Studio 训练目前可在 NVIDIA GPU 上运行，AMD、MLX、Intel 支持即将推出。你仍然可以使用 [原始的 Unsloth Core](#unsloth-requirements) 在 AMD 和 Intel 设备上训练。 **需要 Python 3.11–3.13** 。

| 要求           | Linux / WSL                   | Windows                        |
| ------------ | ----------------------------- | ------------------------------ |
| **Git**      | 通常已预装                         | 由设置脚本安装（`winget`)              |
| **CMake**    | 已预装或 `sudo apt install cmake` | 由设置脚本安装（`winget`)              |
| **C++ 编译器**  | `build-essential`             | Visual Studio Build Tools 2022 |
| **CUDA 工具包** | 可选； `nvcc` 自动检测               | 由设置脚本安装（与驱动程序匹配）               |

## Unsloth Core 要求

* **操作系统**：可在 Linux 和 [Windows](https://docs.unsloth.ai/get-started/install-and-update/windows-installation)
* 自 2018+ 起支持 NVIDIA GPU，包括 [Blackwell RTX 50](/docs/zh/bo-ke/fine-tuning-llms-with-blackwell-rtx-50-series-and-unsloth.md) 和 [DGX Spark](/docs/zh/bo-ke/fine-tuning-llms-with-nvidia-dgx-spark-and-unsloth.md)
* 最低 CUDA 能力 7.0（V100、T4、Titan V、RTX 20 和 50、A100、H100、L40 等） [检查你的 GPU！](https://developer.nvidia.com/cuda-gpus) GTX 1070、1080 可以运行，但速度较慢。
* 官方 [Unsloth Docker 镜像](https://hub.docker.com/r/unsloth/unsloth) `unsloth/unsloth` 可在 Docker Hub 上获取
  * [Docker](/docs/zh/kai-shi-shi-yong/install/docker.md)
* Unsloth 可在 [AMD](/docs/zh/kai-shi-shi-yong/install/amd.md) 和 [Intel](/docs/zh/kai-shi-shi-yong/install/intel.md) GPU 上运行（请参考我们的 [特定指南](/docs/zh/kai-shi-shi-yong/install.md)）。Apple/Silicon/MLX 正在开发中
* 你的设备应具备 `xformers`, `torch`, `BitsandBytes` 和 `triton` 支持。
* 如果你有不同版本的 torch、transformers 等， `pip install unsloth` 将自动安装这些库的所有最新版本，因此你无需担心版本兼容性。

{% hint style="info" %}
支持 Python 3.13！
{% endhint %}

### 微调 VRAM 要求：

使用 Unsloth 进行 LLM 微调需要多少 GPU 内存？

{% hint style="info" %}
一个常见的问题是当你 OOM 或内存不足时，往往是因为把 batch size 设得太高。将其设为 1、2 或 3 可使用更少的 VRAM。

**有关上下文长度基准，请参见** [**这里**](/docs/zh/ji-chu/unsloth-benchmarks.md#context-length-benchmarks)**.**
{% endhint %}

请查看此表，其中按模型参数和微调方法列出了 VRAM 要求。QLoRA 使用 4 位，LoRA 使用 16 位。请注意，有时根据模型可能需要更多 VRAM，因此这些数字是绝对最低值：

| 模型参数 | QLoRA（4 位）VRAM | LoRA（16 位）VRAM |
| ---- | -------------- | -------------- |
| 3B   | 3.5 GB         | 8 GB           |
| 7B   | 5 GB           | 19 GB          |
| 8B   | 6 GB           | 22 GB          |
| 9B   | 6.5 GB         | 24 GB          |
| 11B  | 7.5 GB         | 29 GB          |
| 14B  | 8.5 GB         | 33 GB          |
| 27B  | 22GB           | 64GB           |
| 32B  | 26 GB          | 76 GB          |
| 40B  | 30GB           | 96GB           |
| 70B  | 41 GB          | 164 GB         |
| 81B  | 48GB           | 192GB          |
| 90B  | 53GB           | 212GB          |
| 405B | 237 GB         | 950 GB         |


---

# 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/fine-tuning-for-beginners/unsloth-requirements.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.
