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

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

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

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

### クイックスタート

まず、以下があることを確認してください [Unsloth がインストール済み](/docs/jp/xin-zhe/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-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 プロバイダーを追加することはありません。

{% hint style="info" %}
Codex は現在、以下を通じて提供される GGUF モデルを必要とします `llama-server` バックエンド。
{% endhint %}

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

<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-ben/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-ben/codex.md">OpenAI Codex</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/lian-xie/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/lian-xie/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/lian-xie/opencode.md">OpenCode</a></td></tr><tr><td>Unsloth API</td><td><a href="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FoRer1Vbuh9wSPTawz0ey%2Funsloth%20api%20long%20logo.png?alt=media&amp;token=860a8143-9d59-466b-abed-6ea7d67e51fd">unsloth api long logo.png</a></td><td><a href="/docs/jp/ji-ben/api.md">Unsloth API</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 はコンテキスト長、温度などを含む、モデルに最適な推奨設定を自動的に選択します。
{% 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 キーを自動的に作成または再利用します。

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

設定・サンプリングフラグが指定されていない場合、Unsloth はコンテキスト長、温度などを含む、モデルに最適な推奨設定を自動的に選択します。

それ以外の場合は、これらのフラグを適宜カスタマイズできます:

| オプション                                        | 動作                                                                                                   |
| -------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `--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 モデルに対する 4 ビットロードを制御します。                                                        |
| `--tensor-parallel` / `--no-tensor-parallel` | マルチ GPU システム向けのテンソル並列 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 "続行"`               |
| Hermes Agent    | はい。管理対象の Hermes ホームはデフォルトで一時的です。      | `unsloth start hermes --persist --continue --oneshot "続行"` |
| Pi コーディングエージェント | はい。管理対象の 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 "続行"
```

{% endtab %}

{% tab title="Pi コーディングエージェント" %}

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