> 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/tong-he/openclaw.md).

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

このガイドでは、ローカルでオープン 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="/pages/1040e353b555381fe4f250e6417f1e51602685b2#connecting-to-openclaw" class="button primary" data-icon="lobster">OpenClaw への接続</a><a href="/pages/1040e353b555381fe4f250e6417f1e51602685b2#quickstart" class="button primary">クイックスタート</a>

{% hint style="info" %}
&#x20;このチュートリアルでは、次を使います `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 デスクトップアプリをインストールすることです。対応環境は [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をアプリケーションにドラッグし、Windowsではセットアップを完了してください。
3. アプリを起動し、インストール完了を待ちます
   {% endstep %}

{% step %}

#### モデルを選択

上部の『モデルを選択』ドロップダウンまたは『Model hub』タブを開き、デバイスに合ったモデルと量子化を選んでダウンロードします。完了したら、すぐにチャットを開始できます。セットアップは不要です。

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

{% step %}

### Unslothの準備が整いました

チャットを始めるには、メッセージを入力してEnterを押します。

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

<figure><img src="/files/e80de67ed3ea23603ff90d3a5750d20c31d2e56d" 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="/files/c4ac29c8f0cc1835e12f2743ccdb176ac6531605" alt="" width="563"><figcaption></figcaption></figure></div>

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

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

```
このリポジトリを確認して、1 文で要約してください: https://github.com/unslothai/unsloth
```

<div data-with-frame="true"><figure><img src="/files/44e5317b1a1e5d05a02c5fa20cdc44aa91221bda" 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 \
    --chat-template-kwargs '{"reasoning_effort":"medium"}'
```

Unsloth は使用すべき正しいパラメータを自動的に選択しますが、変更することもできます。

Unsloth はモデルを開始し、OpenClaw を起動し、終了時に一時サーバーを停止します。 \
\
OpenClaw の状態を保持して後で同じセッションに戻るには、次を追加します `--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/tong-he/unsloth-start.md) 名前付きセッション、モデルの読み込み、リモート Unsloth サーバー、詳細オプションのリファレンスを参照してください。

このガイドの残りでは、手動での OpenClaw プロバイダー設定を扱います。

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

### 🔑 APIキーの作成

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

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

<div data-with-frame="true"><figure><img src="/files/56897ad32966d1081797ea8ccf97a7df82f0a550" 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="/files/6588de3e9a6a888cfa2c27c6b7d4df77a7d9627d" 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
# Configure default generation behavior (--disable-tools passes OpenClaw's own tools through)
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
# Allow connections from other devices
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/tong-he/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.
