> 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/unsloth-start.md).

# Unsloth Startを使ってローカルLLMでコーディングエージェントを実行する

Unslothを使うと接続できます [Claude Code](/docs/jp/ji-chu/claude-code.md), [Codex](/docs/jp/ji-chu/codex.md)、Hermes、OpenCode、その他のコーディングエージェントを、ローカルモデルに `unsloth start` コマンド経由で接続できます。ワークフロー全体を自分のハードウェア上でオフライン実行できます。 [Unsloth](/docs/jp/desktop.md) は起動ごとにエンドポイント、APIキー、プロバイダー、モデル、コンテキスト長を自動で設定するため、変更せずにお好みのエージェントを使えます。このガイドでは、オフライン利用のためにコマンドラインからモデルを起動し、Unslothに接続する方法を説明します。

{% columns %}
{% column width="58.333333333333336%" %}

### クイックスタート

まず、 [Unslothがインストールされている](/docs/jp/shii/studio/install.md)ことを確認してください。その後Unslothを開き、モデルを読み込み、プロジェクトフォルダに移動して、端末で次のコマンドを実行します:

```bash
unsloth start claude
```

次の `claude` は下記の任意のエージェントに置き換えられます:
{% endcolumn %}

{% column width="41.666666666666664%" %}

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FpXE6kCHjh8qOEaggf94M%2FScreenshot_20260718_122426.png?alt=media&amp;token=a59e4c8c-efdb-451b-b1f8-621955564f6d" alt=""><figcaption><p>Qwen3.5をローカルで使って実行しているClaude Code。</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

| エージェント                                                             | コマンド                     |
| ------------------------------------------------------------------ | ------------------------ |
| <i class="fa-claude">:claude:</i> Claude Code                      | `unsloth start claude`   |
| <i class="fa-openai">:openai:</i> OpenAI Codex                     | `unsloth start codex`    |
| <i class="fa-vscode">:vscode:</i> Visual Studio Code               | `unsloth start vscode`   |
| <i class="fa-deepseek">:deepseek:</i> DeepSeek Harness             | `unsloth start dsh`      |
| <i class="fa-rectangle-vertical">:rectangle-vertical:</i> OpenCode | `unsloth start opencode` |
| <i class="fa-caduceus">:caduceus:</i> Hermes Agent                 | `unsloth start hermes`   |
| <i class="fa-lobster">:lobster:</i> OpenClaw                       | `unsloth start openclaw` |
| <i class="fa-pi">:pi:</i> Pi Agent                                 | `unsloth start pi`       |

Unslothは一時的またはセッションスコープのプロバイダー設定を使用します。エージェントの通常の設定ファイルにUnslothプロバイダーを追加することはありません。

### エージェントガイド

<table data-column-title-hidden data-view="cards"><thead><tr><th>タイトル</th><th data-hidden data-card-cover data-type="image">カバー画像</th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Claude Code</td><td><a href="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FT8nv3UJzIrcxmjSn8OfW%2Fclaude-code.webp?alt=media&amp;token=811f9635-7321-427c-a11e-29a40e49e376">claude-code.webp</a></td><td><a href="/docs/jp/ji-chu/claude-code.md">Claude Code</a></td></tr><tr><td>Codex</td><td><a href="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FLxRuVHEBYywquhRGBYu0%2Fcodex%20only%20logo.png?alt=media&amp;token=7faa9cbd-090a-45dc-9d5e-acb1a9591f27">codex only logo.png</a></td><td><a href="/docs/jp/ji-chu/codex.md">OpenAI Codex</a></td></tr><tr><td>Visual Studio Code</td><td><a href="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FsBmg9gZ062wIQDAuibJ7%2Fvscode-card.png?alt=media&amp;token=1659960f-0876-4469-a6a7-7408e7a6570a">vscode-card.png</a></td><td><a href="/docs/jp/tong-he/vs-codederkaruaimoderuwosuru.md">Run models in VS Code</a></td></tr><tr><td>Hermes Agent</td><td><a href="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F6ysPTzsXIO5diu4vOTCh%2Fimages.jpeg?alt=media&amp;token=5cc58141-69eb-4450-8214-7a8421fbe2a5">images.jpeg</a></td><td><a href="/docs/jp/tong-he/hermes-agent.md">Hermes Agent</a></td></tr><tr><td>OpenClaw</td><td><a href="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FAd5uo6LjavtBrrKZfwZ3%2Fopenclaw-hero-light.png?alt=media&amp;token=3097e40f-e80c-4c9c-8efc-02ecf5530ef6">openclaw-hero-light.png</a></td><td><a href="/docs/jp/tong-he/openclaw.md">OpenClaw</a></td></tr><tr><td>OpenCode</td><td><a href="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FlCi6Ab4f2qLlNj2EWGL0%2Fopencodelogo.png?alt=media&amp;token=6118773e-5392-4718-a431-a50157a34cbe">opencodelogo.png</a></td><td><a href="/docs/jp/tong-he/opencode.md">OpenCode</a></td></tr></tbody></table>

### コマンドラインからモデルを読み込む

<div align="center"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FAOqECGHODYPDGeYDpXOz%2Fwasim%20unslothstart.png?alt=media&amp;token=a7a1bf5e-d964-4bd4-a0d0-f86753e9f5a8" alt="unsloth start launching Codex with a local GGUF model in Unsloth Studio" width="563"><figcaption><p>Unsloth startはモデルを見つけるか読み込み、コーディングエージェントを設定して、現在のプロジェクトから起動します。</p></figcaption></figure></div>

エージェントの起動時にモデルを選択して読み込めます:

{% hint style="success" %}
設定/サンプリングフラグが設定されていない場合、Unslothはコンテキスト長、temperature などを含め、そのモデルに最適/推奨の設定を自動で選択します。
{% endhint %}

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

この `:UD-Q4_K_XL` サフィックスはGGUF量子化を選択します。

デフォルトのローカルアドレスでは、 `--model` を渡すと、 `unsloth start` Unsloth Studioがまだ実行されていない場合に一時サーバーを起動できます。一時サーバーはエージェント終了時に停止します。Unslothがすでに実行中の場合、このコマンドはそこに接続し、実行を継続します。

ローカルLLMに接続されたエージェントの例を以下に示します:

{% columns %}
{% column width="50%" %}

<div align="left"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fmhay2zcaqL5mNNBeYwKv%2FScreenshot_20260717_163314.png?alt=media&amp;token=5a1e2f04-92b1-42f1-adac-9494fb43613a" alt=""><figcaption><p>OpenCode</p></figcaption></figure></div>

{% endcolumn %}

{% column width="50%" %}

<div align="left"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FnrT2lJtpD4uwMkn5HAhO%2FScreenshot_20260717_163427.png?alt=media&amp;token=ffe77a32-05a9-439e-845f-5a7a4b034464" alt=""><figcaption><p>Hermes</p></figcaption></figure></div>
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column width="33.33333333333333%" %}

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FfKxk4eUVf0tZB1IFtava%2FScreenshot_20260717_161638.png?alt=media&amp;token=b709f099-704e-4d97-947e-d75cbf43cd8a" alt=""><figcaption><p>Claude Code</p></figcaption></figure>
{% endcolumn %}

{% column width="33.33333333333333%" %}

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FxPckgHYLacJK1jpwXHOR%2FScreenshot_20260717_163145.png?alt=media&amp;token=e61f7404-341e-474b-bc08-59adc66ce274" alt=""><figcaption><p>Codex</p></figcaption></figure>
{% endcolumn %}

{% column %}

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fy5QNC3RaSkCIr1KFBrMd%2FScreenshot_20260717_163831.png?alt=media&amp;token=e1501dbe-6a2b-4a4d-96df-92a3e8f2f3df" alt=""><figcaption><p>Openclaw</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### リモートのUnslothサーバーに接続する

エージェントを起動する前に、UnslothのURLとAPIキーを設定します:

```bash
export UNSLOTH_STUDIO_URL=https://studio.example.com
export UNSLOTH_API_KEY=sk-unsloth-...
unsloth start claude
```

キーは `--api-key`でも渡せます。検証済みのローカルUnslothサーバーの場合、 `unsloth start` APIキーは自動的に作成または再利用されます。

#### VS CodeでUnslothを使う

ローカルモデルをVS CodeのCopilot Chatに接続します。GitHub Copilot Chat拡張機能が必要です。Copilotプランは不要です。

```bash
# すでにUnslothが提供しているモデルを接続する
unsloth start vscode

# またはAgentモード用に32Kコンテキストのモデルを読み込む
unsloth start vscode unsloth/Qwen3.5-4B-GGUF:UD-Q4_K_XL --context-length 32768
```

Copilot Chatを開き、 **Unsloth**の下でモデルを選択します。見つからない場合は、 **モデルの管理** を確認するか、 **Developer: Reload Window**.

Agentモードにはツール呼び出しのサポートと少なくとも **32Kコンテキスト**が必要です。ツール呼び出しのないモデルではAskモードを使用してください。

このコマンドはVS Codeの設定をバックアップし、他のモデルは保持します。モデルを切り替えた後は、 `unsloth start vscode` を再実行してそのエントリを更新してください。

**リモートサーバー:** VS CodeのユーザーディレクトリがないSSHまたはコンテナーセッションでは、このコマンドはローカルに追加する設定と、接続またはポートフォワーディングの手順を出力します。リモートワークスペースのモデルピッカーにモデルが表示されない場合は、ローカルのVS Codeウィンドウを使用してください。

### フラグ + オプション

設定/サンプリングフラグが設定されていない場合、Unslothはコンテキスト長、temperature などを含め、そのモデルに最適/推奨の設定を自動で選択します。

それ以外の場合は、これらのフラグを必要に応じてカスタマイズできます:

| オプション                                        | 機能                                                                                                |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `--model`, `-m`                              | モデルを選択します。指定しない場合は、Unslothが報告した最初のモデルを使用します。                                                      |
| `--api-key`                                  | UnslothのAPIキーを指定します。代わりに `UNSLOTH_API_KEY`.                                                       |
| `--launch` / `--no-launch`                   | エージェントを起動するか、生成された環境とコマンドを表示します。                                                                  |
| `--serve` / `--no-serve`                     | 自動的なローカルサーバーの起動を許可または防止します。                                                                       |
| `--gguf-variant`                             | GGUF量子化バリアントを選択します。                                                                               |
| `--reasoning`                                | チャットでの推論を使用します: on、off、またはauto。autoはモデルのチャットテンプレートに従い、通常はonを意味します。                                |
| `--reasoning-effort`                         | モデルのチャットテンプレートに渡される推論の強さ。例: medium。レベルはモデルごとに異なるため、そのモデルが受け付ける値を使用してください。未設定の場合はテンプレート既定値のままにします。 |
| `--context-length`, `--max-seq-length`       | モデルを読み込む際に要求するコンテキスト長を設定します。                                                                      |
| `--load-in-4bit` / `--no-load-in-4bit`       | GGUF以外のHugging Faceモデルの4bit読み込みを制御します。                                                            |
| `--tensor-parallel` / `--no-tensor-parallel` | マルチGPUシステム向けのtensor-parallel GGUF読み込みを有効または無効にします。                                                |
| `--persist` / `--no-persist`                 | 該当する場合は、Unslothで管理されるエージェントのホームを維持します。                                                            |
| `--yolo`                                     | 選択したエージェントの非プロンプトまたは信頼モードを使用します。                                                                  |
| `-h`, `--help`                               | コマンドのヘルプを表示します。                                                                                   |

ロードオプションは、Unslothが要求されたモデルを読み込むか整合させる必要がある場合に使用されます。

### 通常のコマンドをエージェントに渡す

Unslothのオプションではない引数は、選択したエージェントに渡されます:

```bash
unsloth start claude --continue
unsloth start codex --persist resume --last
unsloth start opencode run --continue "前回のタスクを続ける"
unsloth start pi --persist --continue
```

ネイティブオプションの完全な一覧については、エージェント自身のヘルプコマンドを使用してください。

### セッションと `--persist`

`--persist` 管理されたストレージを保持します。会話自体を再開することはありません。エージェントの通常の再開コマンドも渡してください。

| エージェント          | 必要ですか `--persist`?                 | 再開の例                                                             |
| --------------- | ---------------------------------- | ---------------------------------------------------------------- |
| Claude Code     | いいえ。Claudeは通常のセッションストアを使用します。      | `unsloth start claude --continue`                                |
| OpenAI Codex    | はい。管理されたCodexのホームは既定で一時的です。        | `unsloth start codex --persist resume --last`                    |
| OpenClaw        | はい。管理された設定、ワークスペース、セッションは既定で一時的です。 | 使用します `--persist` 同じネイティブのセッションIDとともに。                           |
| OpenCode        | いいえ。OpenCodeは通常のセッションストアを使用します。    | `unsloth start opencode run --continue "Continue"`               |
| Hermes Agent    | はい。管理されたHermesのホームは既定で一時的です。       | `unsloth start hermes --persist --continue --oneshot "Continue"` |
| Pi Coding Agent | はい。管理されたPiのホームは既定で一時的です。           | `unsloth start pi --persist --continue`                          |

Codex、OpenClaw、Hermes、Piでは、 `--persist` を最初の起動時と、セッションに戻るときに再度使用します。

{% tabs %}
{% tab title="Codex" %}

```bash
unsloth start codex --persist
unsloth start codex --persist resume --last
```

{% endtab %}

{% tab title="OpenClaw" %}
名前付きセッションには安定したセッションIDを使用します:

```bash
unsloth start openclaw --persist \
  agent --local --session-id my-session --message "このリポジトリを調査する"

unsloth start openclaw --persist \
  agent --local --session-id my-session --message "続ける"
```

{% endtab %}

{% tab title="Hermes Agent" %}

```bash
unsloth start hermes --persist --oneshot "このリポジトリを調査する"
unsloth start hermes --persist --continue --oneshot "Continue"
```

{% endtab %}

{% tab title="Pi Coding Agent" %}

```bash
unsloth start pi --persist --print "このリポジトリを調査する"
unsloth start pi --persist --continue --print "続ける"
```

{% endtab %}
{% endtabs %}

#### 実行せずに起動コマンドを表示する

```bash
unsloth start claude --no-launch
```

生成された環境とコマンドを表示します。出力には接続認証情報が含まれる可能性があるため、ログやスクリーンショットに公開しないでください。

### 権限バイパスモード

`--yolo` は、選択したエージェントの信頼モードまたは非プロンプトモードに対応します。承認プロンプトを減らし、事前確認なしでエージェントがコマンドを実行できるようにします。

{% hint style="warning" %}
無制限のエージェント操作が許容される環境でのみ使用してください。
{% endhint %}

#### よくある問題

<details>

<summary>Unslothサーバーが見つかりませんでした</summary>

Unslothを起動してモデルを読み込むか、\`--model\` を渡してUnslothが一時的なローカルサーバーを起動できるようにしてください。

</details>

<details>

<summary>Codexが接続しません</summary>

\`llama-server\` 経由で動作するGGUFモデルを使用してください。現在のCodex統合はUnslothのtransformersバックエンドを使用しません。

</details>

<details>

<summary>セッションが復元されませんでした</summary>

Codex、OpenClaw、Hermes、Piでは、最初と以降の起動で \`--persist\` を使用し、その後エージェントのネイティブな再開オプションを渡してください。

</details>


---

# 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/unsloth-start.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.
