> 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/jp/meru/install/windows-installation.md).

# WindowsにUnslothをインストール

Windows に Unsloth Desktop をインストールするには、以下の手順に従ってください。

{% stepper %}
{% step %}

### ダウンロード

### <a href="https://unsloth.ai/download/windows" class="button primary" data-icon="windows">Windows 用の Unsloth をダウンロード</a>

{% endstep %}

{% step %}

### インストール

1. Unsloth のインストーラーを開いてください（`.exe` ファイル）
2. セットアップの指示に従ってください
3. アプリを起動し、インストールが完了するまで待ちます
   {% endstep %}

{% step %}

### モデルを選択

「Select model」または「Model hub」を開き、モデルと量子化を選んでからダウンロードしてください。完了したら、すぐにチャットを開始できます。セットアップは不要です。

<figure><img src="/files/158354856e78d615be54ae9d6435c9ce561b7d4e" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Unsloth の準備ができました

チャットを始めるには、メッセージを入力して Enter キーを押してください。

* **ツールを接続：** [Claude Code](/docs/jp/ji-ben/claude-code.md), [Codex](/docs/jp/ji-ben/codex.md)、ウェブ検索、 [MCP](/docs/jp/ji-ben/mcp.md) など
* **モデルを学習：** テキスト、拡散、埋め込みなどをファインチューニング
* **メディアを生成：** 画像、動画、TTS をローカルで作成・学習

<figure><img src="/files/e80de67ed3ea23603ff90d3a5750d20c31d2e56d" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Unsloth を手動でインストール

以下のセクションでは、Web ベースの **Unsloth Studio** および元のコードベースの **Unsloth Core**.

〜向け **Unsloth Core** Windows では、以下から Conda、Docker、または WSL を選択してください。PyTorch がすでにインストールされている場合は、 `pip install unsloth` で十分な場合があります。

<a href="/pages/3f25ebdeb2b687d90421588e1b9a97b6f91995fe#method-1-windows-via-conda" class="button secondary">Conda チュートリアル</a><a href="/pages/3f25ebdeb2b687d90421588e1b9a97b6f91995fe#method-2-docker" class="button secondary">Docker チュートリアル</a><a href="/pages/3f25ebdeb2b687d90421588e1b9a97b6f91995fe#method-3-wsl" class="button secondary">WSL チュートリアル</a>

### Unsloth Studio

新しい Web UI「 [Unsloth Studio](/docs/jp/xin-gui/studio/install.md) 」を公開しました。Windows でそのまま動作します：

```bash
irm https://unsloth.ai/install.ps1 | iex
```

更新するには同じコマンドを使ってください。

その後、毎回起動するには：

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

詳しい Unsloth Studio のインストール手順と要件については、 [ガイドをご覧ください](/docs/jp/xin-gui/studio/install.md).

以下は、元の **Unsloth Core**:

### 方法 #1 - Conda 経由の Windows:

{% stepper %}
{% step %}
**Miniconda（または Anaconda）をインストール**

Anaconda をダウンロード [こちら](https://www.anaconda.com/download)。おすすめは [Miniconda](https://www.anaconda.com/docs/getting-started/miniconda/install#quickstart-install-instructions)。使うには、まず Powershell を開いてください - スタートで「Windows Powershell」を検索します：

<figure><img src="/files/f266ce5047701dfefd0399244a429d5c410708fb" alt="" width="375"><figcaption></figcaption></figure>

すると Powershell が開きます：

<figure><img src="/files/5d697b5f88d4ce1468d4da72235b8e7740bba2e7" alt="" width="375"><figcaption></figcaption></figure>

次に以下をコピー＆ペーストします: CTRL+C でコピーし、Powershell で CTRL+V で貼り付けます：

{% code overflow="wrap" %}

```ps
Invoke-WebRequest -Uri "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" -OutFile ".\\miniconda.exe"
Start-Process -FilePath ".\\miniconda.exe" -ArgumentList "/S" -Wait
del .\\miniconda.exe
```

{% endcode %}

警告を受け入れて「Paste anyway」を押し、待ちます。

<figure><img src="/files/be592cd680239e9b31ac2ba5cb350ec1a136034f" alt="" width="375"><figcaption></figcaption></figure>

以下のようにインストーラーをダウンロードしています：

<figure><img src="/files/60748784763d2da74a39d3beea2a063d8b794600" alt="" width="375"><figcaption></figcaption></figure>

インストール後、open を開いて **Anaconda Powershell Prompt** スタート → 検索から Miniconda を使うには、次を検索します：

<figure><img src="/files/d6e580dd8a84ca85ccbdbb340869f72aaf3a8869" alt="" width="375"><figcaption></figcaption></figure>

すると次のように表示されます：

<figure><img src="/files/6679435ac5d4d3d083bda6e8f13af380d996bbd3" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**conda 環境を作成**

```bash
conda create --name unsloth_env python==3.12 -y
conda activate unsloth_env
```

**次のように表示されます：**

<figure><img src="/files/8e2b8ffebae361c84e18168678f062a2dd20bb4e" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**確認 `nvidia-smi` GPU があることを確認し、CUDA のバージョンを確認します**

入力すると `nvidia-smi` Powershell では、以下のようなものが表示されるはずです。もし `nvidia-smi` または下の表示が出ない場合は、再インストールする必要があります [NVIDIA ドライバー](https://www.nvidia.com/en-us/drivers/).

<figure><img src="/files/5359da653b1f00d893b2552a562f483eeb29355f" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**PyTorch をインストール**

実行すると `nvidia-smi` 右上隅に「CUDA Version: 13.0」が表示されます。PowerShell で PyTorch をインストールします。 `130` CUDA バージョンに合わせて変更し、 [そのバージョンが存在する](https://pytorch.org/) そして CUDA ドライバのバージョンと一致していることを確認してください。

{% code overflow="wrap" %}

```bash
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130
```

{% endcode %}

次のように表示されます：

<figure><img src="/files/ed003f4daf6cf594acabc11882d176f9da055270" alt="" width="563"><figcaption></figcaption></figure>

Python で次を実行してみてください： `python` PyTorch のインストール後：

{% code overflow="wrap" %}

```python
import torch
print(torch.cuda.is_available())
A = torch.ones((10, 10), device = "cuda")
B = torch.ones((10, 10), device = "cuda")
A @ B
```

{% endcode %}

10 の行列が表示されるはずです。最初のものが True であることも確認してください。

<figure><img src="/files/a9c49eced5f68ef5a2729a4f6e6dc15cc2fdf6bc" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Unsloth をインストール（PyTorch が動作する場合のみ！）**

{% hint style="danger" %}
**PyTorch が問題なく動作することを確認してください。動作しない場合は PyTorch が壊れているため、残念ながら Windows マシンで CUDA ドライバーの再インストールが必要かもしれません。**
{% endhint %}

Powershell で（Python を次で終了した後 `exit()` 、以下を実行して待ちます：

```bash
pip install unsloth
```

{% endstep %}

{% step %}
**Unsloth が動作することを確認**

次に、以下の任意のスクリプトを使います [Unslothノートブック](/docs/jp/meru/unsloth-notebooks.md) （.py ファイルとして保存してください）、または以下の基本スクリプトを使います：

{% code expandable="true" %}

```python
from unsloth import FastLanguageModel, FastModel
import torch
from trl import SFTTrainer, SFTConfig
from datasets import load_dataset
max_seq_length = 512
url = "https://huggingface.co/datasets/laion/OIG/resolve/main/unified_chip2.jsonl"
dataset = load_dataset("json", data_files = {"train" : url}, split = "train")

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name = "unsloth/gemma-3-270m-it",
    max_seq_length = max_seq_length, # 長いコンテキスト用に任意で選択してください！
    load_in_4bit = True,  # 4 ビット量子化。False = 16 ビット LoRA。
    load_in_8bit = False, # 8 ビット量子化
    load_in_16bit = False, # 16 ビット LoRA
    full_finetuning = False, # フルファインチューニングに使用します。
    trust_remote_code = False, # 新しいモデルをサポートするには有効にします
    # token = "hf_...", # gated モデルを使う場合はこれを使用
)

# モデルのパッチ適用を行い、高速 LoRA 重みを追加します
model = FastLanguageModel.get_peft_model(
    model,
    r = 16,
    target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
                      "gate_proj", "up_proj", "down_proj",],
    lora_alpha = 16,
    lora_dropout = 0, # どれでもサポートしますが、= 0 が最適化されています
    bias = "none",    # どれでもサポートしますが、= "none" が最適化されています
    # [NEW] "unsloth" は VRAM を 30% 少なく使い、2 倍大きいバッチサイズに対応します！
    use_gradient_checkpointing = "unsloth", # 非常に長いコンテキストでは True または "unsloth"
    random_state = 3407,
    max_seq_length = max_seq_length,
    use_rslora = False,  # rank stabilized LoRA をサポートしています
    loftq_config = None, # そして LoftQ
)

trainer = SFTTrainer(
    model = model,
    train_dataset = dataset,
    tokenizer = tokenizer,
    args = SFTConfig(
        max_seq_length = max_seq_length,
        per_device_train_batch_size = 2,
        gradient_accumulation_steps = 4,
        warmup_steps = 10,
        max_steps = 60,
        logging_steps = 1,
        output_dir = "outputs",
        optim = "adamw_8bit",
        seed = 3407,
        dataset_num_proc = 1,
    ),
)
trainer.train()
```

{% endcode %}

次のように表示されるはずです：

```bash
🦥 Unsloth: コンピューターにパッチを適用し、無料のファインチューニングを 2 倍高速化します。
🦥 Unsloth Zoo が訓練を高速化するために、これからすべてにパッチを適用します！
==((====))==  Unsloth 2026.1.4: Fast Gemma3 patching. Transformers: 4.57.6.
   \\   /|    NVIDIA GeForce RTX 3060. Num GPUs = 1. Max memory: 12.0 GB. Platform: Windows.
O^O/ \_/ \    Torch: 2.10.0+cu130. CUDA: 8.6. CUDA Toolkit: 13.0. Triton: 3.6.0
\        /    Bfloat16 = TRUE. FA [Xformers = 0.0.34. FA2 = False]
 "-____-"     Free license: http://github.com/unslothai/unsloth
Unsloth: 高速ダウンロードが有効です - 赤色のダウンロードバーは無視してください！
Unsloth: Gemma3 は SDPA をサポートしていません - 高速 eager に切り替えます。
Unsloth: `model.base_model.model.model` に勾配を必要とさせます
Unsloth: ["text"] をトークナイズ中 (num_proc=1):   0%|                 | 0/210289 [00:00<?, ? examples/s]�  Unsloth: コンピューターにパッチを適用し、無料のファインチューニングを 2 倍高速化します。
🦥 Unsloth: コンピューターにパッチを適用し、無料のファインチューニングを 2 倍高速化します。
```

そしてトレーニング：

<figure><img src="/files/3cf862cdaba8ce9e831e6dc413187501c52b0210" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### 方法 #2 - Docker:

Docker は、セットアップや依存関係の問題がないため、Windows ユーザーにとって Unsloth を始める最も簡単な方法かもしれません。 [**`unsloth/unsloth`**](https://hub.docker.com/r/unsloth/unsloth) は Unsloth の唯一の Docker イメージです。For [Blackwell](/docs/jp/burogu/fine-tuning-llms-with-blackwell-rtx-50-series-and-unsloth.md) および 50 シリーズ GPU では、同じイメージを使ってください - 別のイメージは不要です。

インストール手順については、以下に従ってください。 [Docker ガイド](/docs/jp/burogu/how-to-fine-tune-llms-with-unsloth-and-docker.md)。それ以外の場合は、クイックスタートガイドはこちらです：

{% stepper %}
{% step %}
**Docker と NVIDIA Container Toolkit をインストールします。**

Docker を以下経由でインストール [Linux](https://docs.docker.com/engine/install/) または [Desktop](https://docs.docker.com/desktop/) （その他）。次に [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installation):

```bash
export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.17.8-1
sudo apt-get update && sudo apt-get install -y \\
  nvidia-container-toolkit=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \\
  nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \\
  libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \\
  libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION}
```

{% endstep %}

{% step %}
**コンテナを実行します。**

[**`unsloth/unsloth`**](https://hub.docker.com/r/unsloth/unsloth) は Unsloth の唯一の Docker イメージです。

```bash
docker run -d -e JUPYTER_PASSWORD="mypassword" \\
  -p 8888:8888 -p 2222:22 \\
  -v $(pwd)/work:/workspace/work \\
  --gpus all \\
  unsloth/unsloth
```

{% endstep %}

{% step %}
**Jupyter Lab にアクセス**

移動 [http://localhost:8888](http://localhost:8888/) そして Unsloth を開きます。以下にアクセスします。 `unsloth-notebooks` タブで Unsloth のノートブックを表示します。
{% endstep %}

{% step %}
**Unsloth でトレーニングを開始**

初めてなら、以下のステップごとの [ファインチューニングガイド](/docs/jp/meru/fine-tuning-llms-guide.md), [RL ガイド](/docs/jp/meru/reinforcement-learning-rl-guide.md) または、用意済みの [ノートブック](/docs/jp/meru/unsloth-notebooks.md).
{% endstep %}

{% step %}
**Docker の問題 - GPU が検出されない？**

WSL を試してみてください： [#method-2-wsl](#method-2-wsl "mention")
{% endstep %}
{% endstepper %}

### 方法 #3 - WSL:

{% stepper %}
{% step %}
**WSL をインストール**

コマンド プロンプトまたはターミナルを開き、Ubuntu をインストールします。求められたらパスワードを設定してください。

```bash
wsl.exe --install Ubuntu-24.04
wsl.exe -d Ubuntu-24.04
```

{% endstep %}

{% step %} <mark style="color:$primary;background-color:orange;">**もし (1) をしていない、つまりすでに WSL をインストール済みなら**</mark>**、次を入力して WSL に入ります `wsl` そしてコマンドプロンプトで ENTER**

```bash
wsl
```

{% endstep %}

{% step %}
**Python をインストール**

{% code overflow="wrap" %}

```bash
sudo apt update
sudo apt install python3 python3-full python3-pip python3-venv -y
```

{% endcode %}
{% endstep %}

{% step %}
**PyTorch をインストール**

{% code overflow="wrap" %}

```bash
pip install torch torchvision --force-reinstall --index-url https://download.pytorch.org/whl/cu130
```

{% endcode %}

権限の問題が発生した場合は、次を使用してください `–break-system-packages` そのため `pip install torch torchvision --force-reinstall --index-url https://download.pytorch.org/whl/cu130 –break-system-packages`
{% endstep %}

{% step %}
**Unsloth と Jupyter Notebook をインストール**

{% code overflow="wrap" %}

```bash
pip install unsloth jupyter
```

{% endcode %}

権限の問題が発生した場合は、次を使用してください `–-break-system-packages` そのため `pip install unsloth jupyter –-break-system-packages`
{% endstep %}

{% step %}
**Jupyter Notebook 経由で Unsloth を起動**

{% code overflow="wrap" %}

```bash
jupyter notebook
```

{% endcode %}

次に、私たちのノートブックを [Unslothノートブック](/docs/jp/meru/unsloth-notebooks.md)で開いて読み込みます！Colab のノートブックに行き、download > download .ipynb を選んで読み込むこともできます。

![](/files/a03a99e13160070b28fbbc74eb2bab3b334a5e7e)
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
GRPO を使っている、または vLLM を使う予定の場合、現時点では vLLM は Windows を直接サポートしておらず、WSL か Linux 経由のみ対応しています。
{% endhint %}

### **トラブルシューティング /** 詳細

〜向け **高度なインストール手順** または、インストール中に奇妙なエラーが表示される場合：

1. インストール `torch` と `triton`。インストールするには <https://pytorch.org> に行ってください。たとえば `pip install torch torchvision torchaudio triton`
2. CUDA が正しくインストールされているか確認してください。試しに `nvcc`。それで失敗する場合は、次をインストールする必要があります `cudatoolkit` または CUDA ドライバー。
3. Intel GPU を使用している場合は、以下に従う必要があります [Intel Windows ガイド](/docs/jp/meru/install/intel.md#windows-only-runtime-configurations)
4. インストール `xformers` を手動で。インストールを試すことができます `vllm` そして〜かどうかを確認します `vllm` 成功します。次を確認してください `xformers` が次で成功したか `python -m xformers.info` <https://github.com/facebookresearch/xformers> にアクセスしてください。別の方法として、 `flash-attn` 向けに Ampere GPU でインストールできます。
5. Python、CUDA、CUDNN、 `torch`, `triton`、および `xformers` のバージョンが互いに互換性があることを再確認してください。 [PyTorch 互換性マトリックス](https://github.com/pytorch/pytorch/blob/main/RELEASE.md#release-compatibility-matrix) が役立つかもしれません。
6. 最後に、 `bitsandbytes` をインストールし、次で確認します `python -m bitsandbytes`
7. Unsloth が GPU を検出または使用しておらず、Windows 上で当社の Docker コンテナを使っている場合、CUDA toolkit のバージョン `nvcc --version` は、ホストの nvidia-smi に表示される CUDA のバージョンと一致している必要があります。Windows 上の Docker コンテナでの GPU サポートは自動ではありません。 [Docker のガイドに従う必要があります](https://docs.docker.com/desktop/features/gpu/).

### アンインストール

#### Unsloth Desktop

1. 実行中なら Unsloth を閉じます。
2. 開く **設定** Windows で。
3. 移動 **アプリ** → **インストール済みアプリ**.
4. 検索 **Unsloth**を見つけ、3 つの点のメニューを選択し、次を選びます **アンインストール**.
5. 表示される指示に従ってアプリを削除します。

Unsloth Desktop をアンインストールしても、ダウンロード済みのモデルやファイルは削除されません。

#### Unsloth Studio（手動インストール）

Unsloth Studio を完全に削除する推奨方法は、お使いの OS 用のアンインストールスクリプトです。実行中のサーバーを停止し、アプリ、CLI コマンド、ランチャーデータ、ショートカット、およびプラットフォーム固有の項目（macOS `.app` バンドル + Launch Services、Windows のスタートメニュー + レジストリ + PATH）を削除します：

```ps1
irm https://raw.githubusercontent.com/unslothai/unsloth/main/scripts/uninstall.ps1 | iex 
```

#### 手動アンインストール

特定の部分だけを削除したい場合は：

**1. アプリのみ削除** （履歴、チャット、チェックポイント、エクスポートはそのまま保持されます）：

* `Remove-Item -Recurse -Force "$HOME\\.unsloth\\studio\\unsloth_studio"`

**2. Unsloth を完全に削除** （他の Unsloth ツールはそのまま保持されます）：

* `Remove-Item -Recurse -Force "$HOME\\.unsloth\\studio"`

**3. Unsloth 関連のすべてを削除：**

* `Remove-Item -Recurse -Force "$HOME\\.unsloth"`

{% hint style="warning" %}
注：ステップ 3 では、履歴、チャット、モデルのチェックポイント、エクスポートのすべてが削除されます。元に戻すことはできません。
{% endhint %}

**4. ショートカットとシンボリックリンクを削除：**

```shellscript
Remove-Item -Force "$HOME\\Desktop\\Unsloth Studio.lnk"
Remove-Item -Force "$env:APPDATA\\Microsoft\\Windows\\Start Menu\\Programs\\Unsloth Studio.lnk"
```

**5. CLI コマンドを削除：**

* **Windows（PowerShell）：** インストーラーは venv の `Scripts` ディレクトリをユーザー PATH に追加しました。削除するには、設定 → システム → 詳細情報 → システムの詳細設定 → 環境変数 を開き、 `Path` ユーザー変数の下にある `.unsloth\\studio\\...\\Scripts`.

{% hint style="info" %}
注：ステップ 1〜5 は、ダウンロード済みの HF モデルファイルには触れません。その領域を空けたい場合は、下記のキャッシュされた HF モデルファイルの削除を参照してください。
{% endhint %}

### **キャッシュされた HF モデルファイルの削除**

古いモデルファイルは、モデル検索のゴミ箱アイコンから削除するか、デフォルトの Hugging Face キャッシュディレクトリから該当するキャッシュ済みモデルフォルダを削除して消去できます。デフォルトでは、Hugging Face は `~/.cache/huggingface/hub/` macOS/Linux/WSL では `C:\\Users\\<username>\\.cache\\huggingface\\hub\\` を Windows で使用します。

* **Windows：** `%USERPROFILE%\\.cache\\huggingface\\hub\\`

もし `HF_HUB_CACHE` または `HF_HOME` が設定されている場合は、代わりにその場所を使用してください。Linux と WSL では、 `XDG_CACHE_HOME` でデフォルトのキャッシュルートも変更できます。


---

# 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/jp/meru/install/windows-installation.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.
