> 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/lian-xie/openclaw.md).

# OpenClaw でローカル AI モデルを実行する方法

OpenClaw でローカル LLM を実行するためのガイド。

このガイドでは、OpenClawとUnslothを接続して、オープンLLMをローカルで使う方法を **Unslothに接続することでOpenClawを使って**. OpenClawは **オープンソースのAIエージェント** プロジェクト全体でタスクを実行するためにモデルに接続するインターフェースです。OpenClawは、を介して接続することで、あらゆるローカルモデルと連携できます **UnslothのOpenAI互換API**：DeepSeek、Qwen、Gemmaなどを含みます。

OpenClawはクライアントとして動作し、Unslothは **ローカルAPI**.セットアップ後、OpenClawはUnsloth経由でローカルモデルに対して動作し、直接 **AIエージェント。** このチュートリアルでは、 [Qwen3.6](/docs/jp/moderu/qwen3.6.md).

<a href="/docs/jp/lian-xie/openclaw.md#connecting-to-openclaw" class="button primary" data-icon="lobster">OpenClawへの接続</a><a href="/docs/jp/lian-xie/openclaw.md#quickstart" class="button primary">クイックスタート</a>

{% hint style="info" %}
このチュートリアルでは、 `unsloth/Qwen3.6-27B-GGUF` Unslothで読み込み、OpenClaw経由でアクセスします。別のモデルを使いたいですか？ Unslothで読み込んで設定を更新すれば、ほかのモデルに差し替えられます。
{% endhint %}

### OpenClawのインストール

{% tabs %}
{% tab title="macOS、Linux、WSL" %}
公式インストーラーを使ってOpenClawをインストールします：

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

これでOpenClawがセットアップされ、初期設定を案内します。
{% endtab %}

{% tab title="Windows（PowerShell）" %}
公式インストーラーを使ってOpenClawをインストールします：

`iwr -useb https://openclaw.ai/install.ps1 | iex`

これでOpenClawがセットアップされ、初期設定を案内します。
{% endtab %}
{% endtabs %}

### ⚡ クイックスタート

OpenClawをインストールしたら、次に [Unsloth Desktop](/docs/jp/desktop.md) OpenClawでローカルモデルを配信し、推論を実行できるようにするために必要です。

{% stepper %}
{% step %}

#### Unslothをダウンロード

最も簡単な始め方は、Unsloth Desktopアプリをインストールすることです。これは [macOS](/docs/jp/meru/install/mac.md)、Linux、 [Windows](/docs/jp/meru/install/windows-installation.md), [NVIDIA](/docs/jp/meru/install/pip-install.md), [AMD](/docs/jp/meru/install/amd.md)、IntelおよびCPU環境をサポートします。

<a href="https://unsloth.ai/download" class="button primary" data-icon="down-to-bracket">Unslothをダウンロード</a>

* <i class="fa-apple">:apple:</i> [macOS用をダウンロード](https://unsloth.ai/download/mac)
* <i class="fa-windows">:windows:</i> [Windows用をダウンロード](https://unsloth.ai/download/windows)
* <i class="fa-linux">:linux:</i> [Linux用をダウンロード](https://unsloth.ai/download/linux)

または、手動でインストールしたい場合は：

**macOS、Linux、WSL：**

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

**Windows PowerShell：**

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

{% endstep %}

{% step %}

#### インストール

1. Unslothのインストーラー（`.dmg`, `.exe` ファイル）
2. MacではUnslothをApplicationsにドラッグし、Windowsではセットアップを完了します。
3. アプリを起動し、インストールが完了するのを待ちます
   {% endstep %}

{% step %}

#### モデルを選択

上部の「Select model」ドロップダウンまたは「Model hub」タブを開き、デバイスに合うモデルと量子化を選んでダウンロードします。完了したら、そのままチャットを始められます。セットアップは不要です。

<figure><img src="https://735611837-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キーを押します。

**OpenClawを接続します。** 実行 `unsloth start openclaw` を実行すると、読み込まれたUnslothモデルでOpenClawが別の管理対象環境で起動します。通常のOpenClaw設定は変更されません。

<figure><img src="https://735611837-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 %}

### ⚙️ OpenClawを起動： `unsloth start`

OpenClawは、Unsloth Studioで既に実行中のモデルに接続することも、Unslothが動作していないときに自動で起動することもできます。

実行中のUnslothインスタンスに接続

Unsloth Studioでモデルが読み込まれたら、次を実行します：

```bash
unsloth start openclaw
```

<div data-with-frame="true"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FQm2hy6E5WvSzvmhQX0VL%2Fimage.png?alt=media&amp;token=e87ad9ac-8c43-4d20-9276-10eed404bd89" alt="" width="563"><figcaption></figcaption></figure></div>

Unslothは、Unslothプロバイダ、モデル、コンテキスト長を別の管理対象環境内で設定したうえで、OpenClawをローカルTUIモードで起動します。通常のOpenClaw設定は変更されません。

OpenClawが開いたら、次のようなタスクを与えます：

```
inspect this repo and summarize it in one sentence: https://github.com/unslothai/unsloth
```

<div data-with-frame="true"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fz93FYVhDJZKkBw3bY5X9%2Fimage.png?alt=media&amp;token=f79db6e8-59ea-4ac7-8008-fe6e6124d977" alt="" width="563"><figcaption></figcaption></figure></div>

#### モデルを自動で起動

Unslothがまだ起動していない場合は、モデルIDを指定します：

モデルを指定してOpenClawを直接起動するには、次を実行します：

```bash
unsloth start openclaw \\
    --model unsloth/qwen3.8-27B-GGUF-GGUF:UD-Q4_K_XL
    --temp 1.0 \
    --top-p 0.95 \
    --top-k 20 \
    --min-p 0.0 \
    --reasoning-effort medium
```

Unslothが使用する正しいパラメータを自動で選択しますが、必要に応じて変更もできます。

Unslothがモデルを起動し、OpenClawを立ち上げ、終了時に一時サーバーを停止します。\n\nOpenClawの状態を保持して後で同じセッションに戻るには、次を追加します `--persist` そしてセッションキーを選択します：

```bash
unsloth start openclaw \\
  --model unsloth/Qwen3.6-27B-GGUF \\
  --persist \\
  agent --local \\
  --session-key my-session \\
  --message "Inspect this repository"
```

同じセッションキーを使って後で続けるには：

```bash
unsloth start openclaw \\
  --model unsloth/Qwen3.6-27B-GGUF \\
  --persist \\
  agent --local \\
  --session-key my-session \\
  --message "Continue"
```

完全な [unsloth start](/docs/jp/lian-xie/unsloth-start.md) 名前付きセッション、モデル読み込み、リモートUnslothサーバー、詳細オプションのリファレンスを参照してください。

このガイドの残りでは、OpenClawプロバイダの手動設定を説明します。

### OpenClawプロバイダの手動設定

### 🔑 APIキーの作成

キーは次から作成します **Unsloth → 設定 → APIキー**.

1. サイドバーを開き、 **Unsloth** 左下のアバターをクリックします。
2. 移動します： **設定** → **APIキー**.
3. わかりやすい名前を入力します（例： `claude-code-macbook`).
4. *（任意）* 有効期限を設定します。
5. クリック **作成**.
6. **キーをすぐにコピーします。** Unslothはハッシュのみを保存するため、あとで再表示することはできません。

<div data-with-frame="true"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FrWnqY5PgvZdbWK8pmlD5%2Fimage.png?alt=media&amp;token=3507e7d7-b552-447f-b503-2418802b8f6e" alt="" width="375"><figcaption></figcaption></figure></div>

すべてのキーは `sk-unsloth-` というプレフィックスで始まります。キーは同じページからいつでも無効化できます。無効化されたキーで行ったリクエストは `401 Unauthorized`.

### OpenClawへの接続

OpenClawは設定を次から読み込みます `~/.openclaw/openclaw.json`。次の `models` ブロックを `unsloth` UnslothのAnthropic Messages APIを指すプロバイダ。

<div data-with-frame="true"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fs5g7Epfb2KjiQQf4MJf7%2Fopenclaw_unsloth_chat.png?alt=media&amp;token=c4de5f80-2a99-4527-bde0-c4e05e086f79" alt="" width="375"><figcaption></figcaption></figure></div>

{% code title="\~/.openclaw/openclaw\.json" %}

```json
{
  "models": {
    "mode": "merge",
    "providers": {
      "unsloth": {
        "baseUrl": "http://localhost:8888",
        "apiKey": "sk-unsloth-xxxxxxxxxxxx",
        "api": "anthropic-messages",
        "models": [
          {
            "id": "unsloth/Qwen3.6-27B-GGUF",
            "name": "unsloth/Qwen3.6-27B-GGUF"
          }
        ],
        "authHeader": true
      }
    }
  }
}
```

{% endcode %}

**注：**

* `baseUrl` は、パスのないUnslothのオリジンです。OpenClawはAnthropic Messages API経由でUnslothと通信し、Anthropic SDKは `/v1/messages` 自動で付与されるため、追加しないでください `/v1` ここで（末尾に `/v1` を付けると、リクエストの送信先が `/v1/v1/messages`).
* `api: "anthropic-messages"` は、OpenClawがUnslothの `/v1/messages` エンドポイントと通信するよう指示します。
* `authHeader: true` は、キーを次の形式で送信します `Authorization: Bearer …`.
* 各モデルの `id` と `name` を、Unslothでモデルを読み込むときに選んだ名前に設定します。
* Unslothをリモートマシンで実行している場合は、 `localhost:8888` をそのマシンのアドレスに置き換えます（例： `http://10.0.0.42:8888`).

### 任意：モデルの動作を設定する

OpenClawはUnslothで実行中のモデル経由で接続します。実行時設定はサーバー起動時に構成できます。

```bash
# デフォルトの生成動作を設定する（--disable-tools は OpenClaw独自のツールをそのまま通します）
unsloth run \\
  --model unsloth/gemma-4-26B-A4B-it-GGUF \\
  --disable-tools \\
  --reasoning off \\
  --temp 0.6
```

{% hint style="warning" %}
を使ってください `--disable-tools` OpenClaw（または他の外部コーディングエージェント）を操作するときに使います。デフォルトではUnsloth Studioが独自のサーバー側ツールを実行するため、エージェントのツール呼び出しが吸収され、OpenClawは応答するだけでファイルは編集しません。 `--disable-tools` はパススルーに切り替わり、OpenClaw独自のツールが使われます。
{% endhint %}

を使ってください `--reasoning off` 思考をオフにするには、または `--reasoning on` 推論をサポートするモデルでオンにします。

```bash
# 他のデバイスからの接続を許可する
unsloth run \\
  --model unsloth/gemma-4-26B-A4B-it-GGUF \\
  -H 0.0.0.0 \\
  -p 8888
```

これによりサーバーが `0.0.0.0:8888`で起動し、ローカルネットワーク上の他のデバイスが接続できるようになります。

より高度な実行時設定については、メインの [API調整](https://unsloth.ai/docs/basics/api#unsloth-run-command) セクションを参照してください。


---

# 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/lian-xie/openclaw.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.
