> 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/hermes-agent.md).

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

このガイドでは、ローカルでオープン LLM を実行できます **Hermes Agent** 経由で [**Unsloth**](https://github.com/unslothai/unsloth)。Nous Research の Hermes Agent は、 **オープンソース** の自律型 AI エージェントで、モデルのエンドポイントに接続し、タスクを実行し、メモリと学習したスキルを通じて時間とともに改善します。

{% columns %}
{% column width="58.333333333333336%" %}
Hermes は、 **ローカルモデル** を Unsloth の **OpenAI 互換 API**経由で公開されるあらゆるモデルで動作します。DeepSeek、Qwen、Gemma などが含まれます。Hermes はエージェントクライアントとして機能し、Unsloth は次を通じてモデルを読み込み、提供します： [ローカルAPI](/docs/jp/ji-ben/api.md) 完全にオフラインで。

セットアップ後、Hermes 経由で送信されるすべてのプロンプトは、デバイス上のローカルモデルを使って実行されます。
{% endcolumn %}

{% column width="41.666666666666664%" %}

<figure><img src="/files/30a58e727d8027487e92a694cbce84e0065d2d31" alt=""><figcaption><p>Unsloth 経由で Hermes 上でローカル実行されている Qwen3.5。</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

<a href="https://unsloth.ai/docs/integrations/hermes-agent#setup-hermes-agent" class="button primary" data-icon="caduceus">Hermes のセットアップ</a><a href="https://unsloth.ai/docs/integrations/hermes-agent#integrate-hermes-with-unsloth-api" class="button primary">🦥 ローカルモデルを接続</a>

{% hint style="info" %}
このチュートリアルでは、Hermes をインストールし、 `unsloth/Qwen3.6-27B-GGUF` Unsloth から提供されるモデルを使用するように設定します。別のモデルを使いたいですか？ Unsloth で別のモデルを読み込み、設定を更新すれば切り替えられます。
{% endhint %}

### <i class="fa-caduceus">:caduceus:</i> Hermes Agent のセットアップ

**前提条件：**

この [Hermes](https://github.com/NousResearch/hermes-agent/blob/main/website/docs/getting-started/installation.md) コマンドラインインストーラーは Linux、macOS、WSL2 をサポートします。 **Git** がインストールされていることを確認してください。Linux では、さらに **curl** と **xz-utils**をインストールしてください。インストーラーは自動的に `uv`、Python 3.11、Node.js 22、 `ripgrep`、そして `ffmpeg`.

#### 1. インストーラーを実行する

```bash
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
```

インストーラーは次のことを行います：

* プラットフォームを検出し、依存関係を確認します。
* Hermes を次の場所にクローンします `~/.hermes/hermes-agent/`.
* Python の仮想環境を作成し、Python 依存関係をインストールします。
* ブラウザツールの依存関係と Playwright の Chromium エンジンをインストールします。
* 次を追加します： `hermes` コマンドを追加し、セットアップウィザードを起動します。

{% columns %}
{% column %}
Playwright が要求する場合があります `sudo` Chromium の共有システムライブラリのインストールです。Hermes 自体に root 権限は必要ありません。
{% endcolumn %}

{% column %}

<figure><img src="/files/f0087bd867c64fb05d15b46a0a9fb8b0a2b4e7ef" alt="" width="375"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

#### **2. シェルを再読み込みする** これにより `hermes` コマンドがあなたの `PATH`:

{% code title="bash" %}

```bash
source ~/.bashrc
```

{% endcode %}

{% code title="zsh" %}

```bash
source ~/.zshrc
```

{% endcode %}

#### **3. インストールを確認する：**

```bash
hermes --version
```

コマンドが解決されれば、Hermes はインストールされています。すべては次の場所にあります。 `~/.hermes/`:

| Path                                    | 内容                           |
| --------------------------------------- | ---------------------------- |
| `~/.hermes/config.yaml`                 | 主要設定（モデル、プロバイダー、ツール、TTS など）  |
| `~/.hermes/.env`                        | API キーやその他の機密情報              |
| `~/.hermes/hermes-agent/`               | Hermes のソース + 仮想環境           |
| `~/.hermes/cron/`, `sessions/`, `logs/` | 実行時データ                       |
| `~/.hermes/skills/`                     | インストール済みスキル（Skills Hub から同期） |

{% hint style="info" %}
完全なインストール手順： [hermes-agent.nousresearch.com/docs/getting-started/installation](https://hermes-agent.nousresearch.com/docs/getting-started/installation)。インストーラーが不足している前提条件を報告した場合は、それをインストールしてワンライナーを再実行してください。インストーラーは冪等です。
{% endhint %}

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

Hermes をインストールした後、Hermes がローカルモデルの提供と推論実行を行えるようにするため、Unsloth Studio をインストールする必要があります。

1. **Unsloth Studioをインストールまたは更新します。** 旧バージョンでは外部APIが公開されません。インストールを参照してください。
2. **Unsloth を起動します。** 起動するポートは通常 `8000` または `8888`です。ターミナル出力とブラウザの URL（`http://localhost:PORT`).
3. **モデルを読み込みます。** クリック **New Chat**をクリックし、モデル（GGUF）を選択または検索して、読み込みが完了するまで待ちます。
4. **Hermes を接続します。** 実行します `unsloth start hermes`。API キーを発行し、設定を書き込み、読み込まれたモデルに対して Hermes を起動します。

### ⚡ Hermes Agent を次で実行 `unsloth start`

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

```bash
unsloth start hermes \\
  --model unsloth/gemma-4-E2B-it-GGUF:UD-Q4_K_XL \\
  --context-length 32768
```

Unsloth Studio でモデルを読み込んだ状態で、次を実行します：

```bash
unsloth start hermes
```

<figure><img src="/files/6e6e8073651c257a8540a7b57c929ad50bf7c6f2" alt="Hermes Agent connected to a local model through Unsloth Studio"><figcaption><p>Unsloth Studio プロバイダー経由で動作している Hermes Agent。</p></figcaption></figure>

Unsloth は、Unsloth プロバイダー、モデル、コンテキスト設定がすでに構成された別の管理対象ホームから Hermes を起動します。既存の Hermes セットアップは変更されません。

この管理対象ホームは既定では一時的です。セッションと状態を保持したい場合は、次を追加してください `--persist` 初回起動時に：

```bash
unsloth start hermes --persist
```

後で最新のセッションに戻るには、次を実行します：

```bash
unsloth start hermes --persist --continue
```

特定のセッションを再開するには、次を使用します `--resume <session-id-or-title>` を使ってください。

完全な [unsloth start](/docs/jp/tong-he/unsloth-start.md) モデル選択、リモート接続、詳細オプションのリファレンス。

Hermes プロバイダーを自分で管理したい場合は、下のセットアップウィザードも引き続き利用できます。

### 🔑 APIキーの作成

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

<figure><img src="/files/56897ad32966d1081797ea8ccf97a7df82f0a550" alt="" width="375"><figcaption></figcaption></figure>

すべてのキーは次の接頭辞で始まります： `sk-unsloth-` です。同じページからいつでもキーを無効化できます。無効化されたキーでのリクエストは `401 Unauthorized`.

### 🦥 Hermes を Unsloth API に統合

Hermes は各チャットターンを設定済みの推論プロバイダーに送り、次に接続します **OpenAI互換** エンドポイントへ。プロバイダーはインストール中または後からセットアップウィザードで設定できます。

**1. セットアップウィザードを開く：**

{% columns %}
{% column %}

```bash
hermes setup
```

選ぶなら **モデルとプロバイダー** を「何をしたいですか？」メニューから選んで推論エンドポイントのみを設定するか、 **フルセットアップ** を選んで、すべて（TTS、ツール、メッセージングゲートウェイ、エージェント設定）を順に設定します。
{% endcolumn %}

{% column %}

<figure><img src="/files/2e85bd9157229846b9404dec20d11a1eb403540f" alt="" width="539"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

**2. カスタム OpenAI 互換エンドポイントを選択する** Hermes が推論プロバイダーを尋ねたときに選択します。

<figure><img src="/files/1aae32d6cd7ec15ef3863c6c765ea8738b10ea13" alt="" width="563"><figcaption></figcaption></figure>

**3. プロンプトに入力する** Hermes の案内に従って入力します：

| プロンプト                        | 値                                                        |
| ---------------------------- | -------------------------------------------------------- |
| **API ベース URL**              | `http://localhost:8888/v1` *（あなたの Unsloth のポート + `/v1`)* |
| **API キー**                   | あなたの `sk-unsloth-…` キー                                   |
| **検出されたモデル：… このモデルを使用しますか？** | `Y` *（Hermes は次を通じてモデルを自動検出します： `GET /v1/models`)*       |
| **トークン数のコンテキスト長**            | *（自動検出するには空欄のまま）*                                        |
| **表示名**                      | 好きな名前で構いません。例： `unsloth-api`                             |

Hermes は次に対してエンドポイントを検証します： `/v1/models` そして続行前に検出されたモデルを確認します。

<figure><img src="/files/ec3e51aef408df3e9d9ae856c012c906b9e5fa1b" alt=""><figcaption></figcaption></figure>

**4. 残りのプロンプトは既定値を受け入れる** （TTS、ツール、メッセージングゲートウェイ、エージェント設定）は後でいつでも再設定できます。Hermes はすべてを書き込みます `~/.hermes/config.yaml` と `~/.hermes/.env`.

<figure><img src="/files/fb8126221234da24ea2ab9168f668fa176011a07" alt=""><figcaption></figcaption></figure>

**5. Hermes を起動する：**

```bash
hermes
```

起動バナーにはステータスバーに Unsloth のモデル名が表示されます（例： `unsloth/Qwen3.6-27B-GGUF`）、そしてプロンプトが入力待ちになります。

<figure><img src="/files/f3850832a3cb2c97985634a0ffb3536adcedbb4c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
後でモデルだけを再設定するには、次を実行します `hermes setup model`。設定ファイルを直接編集するには、 `hermes config edit` を開きます `~/.hermes/config.yaml` あなたの `$EDITOR`.
{% endhint %}

### オプション：Unsloth サーバーを調整する

`unsloth run` ローカル API サーバーを起動し、アプリが接続するためのモデルを読み込みます。起動時のサーバー動作もカスタマイズできます。

```bash
# Hermes を提供する（--disable-tools でエージェント自身のツールを通過させる）
unsloth run \\
  --model unsloth/gemma-4-26B-A4B-it-GGUF \
  --disable-tools \
  --reasoning off \
  -p 8888
```

{% hint style="warning" %}
使用 `--disable-tools` Hermes（または独自のツールを持つ外部エージェント）を動かすときに使用します。既定では Unsloth Studio はサーバー側の独自ツールを実行するため、エージェントのツール呼び出しが取り込まれてしまい、Hermes は応答するもののツールは実行されません。 `--disable-tools` パススルーに切り替え、Hermes 自身のツールが使われます。
{% endhint %}

使用 `--reasoning off` で思考をオフにするか、 `--reasoning on` で、推論に対応したモデルで思考をオンにします。

```bash
# ローカルネットワーク上に API を公開する
unsloth run \\
  --model unsloth/gemma-4-26B-A4B-it-GGUF \
  -H 0.0.0.0 \\
  -p 8888
```

これによりサーバーは `0.0.0.0:8888`で起動し、ローカルネットワーク上の他のデバイスが接続できるようになります。 `-p` サーバーが実行するポートを変更します。ネットワーク上のスマートフォン、ノートパソコン、その他のデバイスから API サーバーに接続したい場合は、次を付けて起動します `-H 0.0.0.0`.

一部のアプリは、個別リクエストの生成設定を上書きする場合があります。より高度な実行時設定については、メインの [API tuning](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/hermes-agent.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.
