> 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モデルを実行する方法

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

このガイドでは、ローカルでオープンな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/tong-he/openclaw.md#connecting-to-openclaw" class="button primary" data-icon="lobster">OpenClawへの接続</a><a href="/docs/jp/tong-he/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 %}

#### モデルを選択

上部の「モデルを選択」ドロップダウンまたは「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プロバイダー、モデル、コンテキスト長を設定したローカルTUIモードでOpenClawを起動します。通常のOpenClaw設定は変更されません。

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

```
このリポジトリを調査して、1文で要約してください: 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を立ち上げ、終了時に一時サーバーを停止します。\
\
OpenClawの状態を保持して、後で同じセッションに戻るには、次を追加します `--persist` そしてセッションキーを選びます：

```bash
unsloth start openclaw \
  --model unsloth/Qwen3.6-27B-GGUF \
  --persist \
  agent --local \
  --session-key my-session \
  --message "このリポジトリを調査してください"
```

同じセッションキーを使って後で続行します：

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

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

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

### OpenClawプロバイダーの手動セットアップ

### 🔑 APIキーの作成

キーは次から作成されます **Unsloth → Settings → API Keys**.

1. サイドバーを開き、左下の **Unsloth** アバターをクリックします。
2. 次へ移動し、 **Settings** → **API Keys**.
3. わかりやすい名前を入力し（例： `claude-code-macbook`).
4. *（任意）* 有効期限を設定します。
5. クリックします **Create**.
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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/jp/tong-he/openclaw.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
