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

Hermes Agent を使ってオープン LLM をローカルで使うためのガイド。

このガイドでは、オープン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-chu/api.md) 完全オフラインで。

セットアップ後、Hermes 経由で送信されるすべてのプロンプトは、デバイス上のローカルモデルを使用して実行されます。
{% 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%2FYhiTzkyz0fVPMxIfWg6D%2FScreenshot_20260718_122219.png?alt=media&amp;token=a8063d58-0d49-467a-aa2a-35b30c448390" 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="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FnabBNaHLvb1rH58cQwyC%2FScreenshot%202026-07-18%20at%205.31.57%E2%80%AFAM.png?alt=media&amp;token=4ac35864-89aa-45ce-84db-ad5b17f8b3e5" 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/`:

| パス                                      | 内容                           |
| --------------------------------------- | ---------------------------- |
| `~/.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 Desktop をインストールする必要があります。

{% stepper %}
{% step %}

#### Unslothをダウンロード

始める最も簡単な方法は、 [Unsloth Desktop](/docs/jp/desktop.md) アプリをインストールすることです。これは [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キーを押します。

**Hermes を接続します。** 実行 `unsloth start hermes` を Unsloth を開いたままターミナルで実行します。API キーを発行し、設定を書き込み、読み込んだモデルに対して Hermes を起動します。

<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 %}

### ⚡ 次を使って Hermes Agent を実行 `unsloth start`

モデルで Hermes を直接起動するには、次を実行します:

```bash
unsloth start hermes \
    --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
```

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

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

```bash
unsloth start hermes
```

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FOaFdKwRASHSoxDQx06l5%2FScreenshot_20260714_152023.png?alt=media&amp;token=c7e13fb2-e03e-49d1-8efa-f7494578943a" 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. 次へ移動し、 **Settings** → **API**.
3. わかりやすい名前を入力し（例： `hermes-agent-macbook`).
4. *（任意）* 有効期限を設定します。
5. クリックします **Create**.
6. **すぐにキーをコピーしてください。** Unslothはハッシュのみを保存するため、再度表示することはできません。

<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>

すべてのキーは `sk-unsloth-` というプレフィックスで始まります。キーはいつでも同じページから失効できます。失効したキーで行ったリクエストは `401 Unauthorized`.

### 🦥 Hermes を Unsloth API と統合

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

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

{% columns %}
{% column %}

```bash
hermes setup
```

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

{% column %}

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FChF6By1Dl44hVQl63kGW%2FScreenshot%202026-07-18%20at%205.34.39%E2%80%AFAM.png?alt=media&amp;token=371a287e-1264-47d2-af3e-fa3ed302e038" alt="" width="539"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

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

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FA5VVaVsL7GzZGq9Dn3Bt%2Fhermes_agent_setup_2.png?alt=media&amp;token=a234d29d-14f6-431f-be1f-9a4e14f5951d" 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="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FehQjrLJ0ztoSdNp94dfH%2Fhermes_agent_setup_3.png?alt=media&amp;token=641c6e6a-44c3-4013-8c08-32472b256283" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FWbj2YWKpXw9T2jR0QQjh%2Fhermes_agent_setup_5.png?alt=media&amp;token=59985534-69e3-46ec-8ab9-1db8829c1721" alt=""><figcaption></figcaption></figure>

**5. Hermes を起動:**

```bash
hermes
```

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

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FU8UlRyw9n1SrENvZXSjD%2Fhermes_unsloth_run.png?alt=media&amp;token=6fd14920-a287-4aed-815e-33b7e4d09c68" 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の調整](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/hermes-agent.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.
