> 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/moderu/tutorials/glm-5.md).

# GLM-5: ローカル実行ガイド

Z.aiの新しいGLM-5モデルを自分のローカルデバイスで実行しましょう！

GLM-5 は Z.ai の最新推論モデルで、コーディング、エージェント、チャット性能は [GLM-4.7](/docs/jp/moderu/tutorials/glm-4.7.md)よりも優れており、長文コンテキスト推論向けに設計されています。Humanity's Last Exam で 50.4%（+7.6%）、BrowseComp で 75.9%（+8.4%）、Terminal-Bench-2.0 で 61.1%（+28.3%）といったベンチマークで性能を向上させています。

フルの 744B パラメータ（40B アクティブ）モデルには **200K コンテキスト** のウィンドウがあり、28.5T トークンで事前学習されています。フルの GLM-5 モデルには **1.65TB** のディスク容量が必要ですが、Unsloth Dynamic 2-bit GGUF ではサイズが **241GB** **(-85%)**、そして動的 **1ビット版は 176GB（-89%）です:** [**GLM-5-GGUF**](https://huggingface.co/unsloth/GLM-5-GGUF)

すべてのアップロードは Unsloth の [Dynamic 2.0](/docs/jp/ji-chu/dynamic-3.0-ggufs.md) 最先端の量子化性能のためです。したがって 1 ビット版では重要な層が 8 ビットまたは 16 ビットにアップキャストされています。Z.ai が Unsloth に初日からアクセスを提供してくれたことに感謝します。

### :gear: 使用ガイド

2ビット動的量子化 UD-IQ2\_XXS は **241GB** のディスク容量 - これはそのまま **256GB統合メモリのMac**、また次の環境でもうまく動作します: **1x24GB カードと 256GB の RAM** MoE オフロード時でも使用できます。フルの **1ビット** 量子化版は 180GB の RAM に収まり、8 ビット版には 805GB の RAM が必要です。

{% hint style="success" %}
最高の性能のために、利用可能な総メモリ（VRAM + システム RAM）が、ダウンロードする量子化済みモデルファイルのサイズを上回っていることを確認してください。そうでなくても、llama.cpp は SSD/HDD オフロード経由で実行できますが、推論は遅くなります。
{% endhint %}

### 推奨設定

用途ごとに異なる設定を使用してください:

| デフォルト設定（ほとんどのタスク）          | SWE Bench Verified         |
| -------------------------- | -------------------------- |
| temperature = 1.0          | temperature = 0.7          |
| top\_p = 0.95              | top\_p = 1.0               |
| max new tokens = 131072    | max new tokens = 16384     |
| repeat penalty = 無効または 1.0 | repeat penalty = 無効または 1.0 |

* `Min_P = 0.01` (llama.cpp のデフォルトは 0.05 です)
* **最大コンテキストウィンドウ:** `202,752`.
* 複数ターンのエージェント的タスク（τ²-Bench と Terminal Bench 2）では、Preserved\
  Thinking モードを有効にしてください。

## GLM-5 チュートリアルを実行:

#### ✨ llama.cpp で実行

{% stepper %}
{% step %}
最新の `llama.cpp` **を** [**GitHubこちら**](https://github.com/ggml-org/llama.cpp)。以下のビルド手順に従うこともできます。変更してください `-DGGML_CUDA=ON` を `-DGGML_CUDA=OFF` GPUがない場合、またはCPU推論のみを使いたい場合は。 **Apple Mac / Metalデバイスの場合**、次を設定します `-DGGML_CUDA=OFF` その後は通常どおり続けてください。Metalサポートはデフォルトで有効です。

```bash
apt-get update
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
git clone https://github.com/ggml-org/llama.cpp
cmake llama.cpp -B llama.cpp/build \
    -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-mtmd-cli llama-server llama-gguf-split
cp llama.cpp/build/bin/llama-* llama.cpp
```

{% endstep %}

{% step %}
を使いたい場合は `llama.cpp` モデルを直接読み込むには、以下のようにできます: (:IQ2\_XXS) は量子化タイプです。Hugging Face（3番）経由でもダウンロードできます。これは次に似ています `ollama run` に似ています。 `export LLAMA_CACHE="folder"` を使って `llama.cpp` 特定の場所に保存するためです。モデルのコンテキスト長の上限は 200K であることを忘れないでください。

これに従ってください: **一般的な手順** ユースケース:

```bash
export LLAMA_CACHE="unsloth/GLM-5-GGUF"
./llama.cpp/llama-cli \
    -hf unsloth/GLM-5-GGUF:UD-IQ2_XXS \\
    --ctx-size 16384 \\
    --flash-attn on \\
    --temp 0.7 \\
    --top-p 1.0 \\
    --min-p 0.01
```

これに従ってください: **ツール呼び出し** ユースケース:

```bash
export LLAMA_CACHE="unsloth/GLM-5-GGUF"
./llama.cpp/llama-cli \
    -hf unsloth/GLM-5-GGUF:UD-IQ2_XXS \\
    --ctx-size 16384 \\
    --flash-attn on \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --min-p 0.01
```

{% endstep %}

{% step %}
以下をインストールした後、( `pip install huggingface_hub hf_transfer` をインストール後）。 `UD-Q2_K_XL` (動的 2 ビット量子化) または次のような他の量子化版: `UD-Q4_K_XL` をインストールした後で）。 <mark style="background-color:green;">**当社の 2 ビット動的量子化の使用を推奨します**</mark><mark style="background-color:green;">**&#x20;**</mark><mark style="background-color:green;">**`UD-Q2_K_XL`**</mark><mark style="background-color:green;">**&#x20;**</mark><mark style="background-color:green;">**サイズと精度のバランスを取るために**</mark>。ダウンロードが止まる場合は、次を参照してください: [Hugging Face Hub、XET のデバッグ](/docs/jp/ji-chu/troubleshooting-and-faqs/hugging-face-hub-xet-debugging.md)

```bash
pip install -U huggingface_hub
hf download unsloth/GLM-5-GGUF \\
    --local-dir unsloth/GLM-5-GGUF \\
    --include "*UD-IQ2_XXS*" # 動的 1 ビットには "*UD-TQ1_0*" を使用
```

{% endstep %}

{% step %}
編集できます `--threads 32` CPUスレッド数は `--ctx-size 16384` コンテキスト長は `--n-gpu-layers 2` GPUオフロードする層数です。GPUがメモリ不足になったら調整してみてください。CPUのみで推論する場合は削除してください。

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \
    --model unsloth/GLM-5-GGUF/UD-IQ2_XXS/GLM-5-UD-IQ2_XXS-00001-of-00006.gguf \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --min-p 0.01 \\
    --ctx-size 16384 \\
    --seed 3407
```

{% endcode %}
{% endstep %}
{% endstepper %}

### 🦙 Llama-server によるサービングと OpenAI の completion ライブラリ

GLM-5 を本番環境にデプロイするには、次を使用します `llama-server` tmux 経由で新しいターミナルを開き、次のようにモデルをデプロイします:

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-server \
    --model unsloth/GLM-5-GGUF/UD-IQ2_XXS/GLM-5-UD-IQ2_XXS-00001-of-00006.gguf \\
    --alias "unsloth/GLM-5" \\
    --prio 3 \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --ctx-size 16384 \\
    --port 8001
```

{% endcode %}

次に、新しいターミナルで、 `pip install openai`を実行した後、次を行います:

{% code overflow="wrap" %}

```python
from openai import OpenAI
import json
openai_client = OpenAI(
    base_url = "http://127.0.0.1:8001/v1",
    api_key = "sk-no-key-required",
)
completion = openai_client.chat.completions.create(
    model = "unsloth/GLM-5",
    messages = [{"role": "user", "content": "Snake ゲームを作成してください。"},],
)
print(completion.choices[0].message.content)
```

{% endcode %}

すると、以下のスネークゲームの例が得られます:

{% columns %}
{% column width="58.333333333333336%" %}
{% code expandable="true" %}

````markdown
こちらは、1つの HTML ファイル内に収めた、完全にプレイ可能なスネークゲームです。このコードをコピーして、`.html` ファイル（例: `snake.html`）として保存し、Web ブラウザで開けば遊べます。

### コード

```html
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>クラシックなスネークゲーム</title>
    <style>
        body {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #222;
            color: white;
            font-family: Arial, sans-serif;
        }

        #gameCanvas {
            border: 2px solid #fff;
            background-color: #000;
        }

        h1 {
            margin-bottom: 10px;
        }

        #scoreBoard {
            font-size: 20px;
            margin-bottom: 10px;
        }

        #gameOverMenu {
            position: absolute;
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            background: rgba(0, 0, 0, 0.85);
            padding: 20px;
            border-radius: 10px;
            border: 2px solid red;
        }

        button {
            margin-top: 15px;
            padding: 10px 20px;
            font-size: 16px;
            cursor: pointer;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 5px;
        }
        
        button:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>

    <h1>スネークゲーム</h1>
    <div id="scoreBoard">スコア: 0</div>
    <canvas id="gameCanvas" width="400" height="400"></canvas>

    <div id="gameOverMenu">
        <h2 style="color: red; margin: 0;">ゲームオーバー！</h2>
        <p id="finalScore">最終スコア: 0</p>
        <button onclick="resetGame()">もう一度プレイ</button>
    </div>

    <script>
        // ゲーム定数
        const canvas = document.getElementById('gameCanvas');
        const ctx = canvas.getContext('2d');
        const scoreBoard = document.getElementById('scoreBoard');
        const gameOverMenu = document.getElementById('gameOverMenu');
        const finalScoreDisplay = document.getElementById('finalScore');

        const gridSize = 20; // 各マスのサイズ
        const tileCount = canvas.width / gridSize; // 行/列ごとのマス数

        // ゲーム変数
        let dx = 0; // 横方向の速度
        let dy = 0; // 縦方向の速度
        let score = 0;
        let snake = [];
        let foodX, foodY;
        let gameInterval;
        let isGameRunning = false;

        // ゲームを初期化
        function initGame() {
            snake = [
                {x: 10, y: 10}, 
                {x: 9, y: 10}, 
                {x: 8, y: 10}
            ];
            score = 0;
            scoreBoard.innerText = 'スコア: ' + score;
            dx = 1; // すぐに右へ移動を開始
            dy = 0;
            placeFood();
            isGameRunning = true;
            gameOverMenu.style.display = 'none';
            
            // ゲームループを開始
            if (gameInterval) clearInterval(gameInterval);
            gameInterval = setInterval(gameLoop, 100); // 100ms ごとにゲームループを実行
        }

        // メインのゲームループ
        function gameLoop() {
            if (!isGameRunning) return;

            moveSnake();
            if (checkGameOver()) {
                endGame();
                return;
            }
            checkFoodCollision();
            draw();
        }

        // スネークを移動
        function moveSnake() {
            // 現在の方向に基づいて新しい頭を作成
            const head = {x: snake[0].x + dx, y: snake[0].y + dy};
            
            // 新しい頭を配列の先頭に追加
            snake.unshift(head);

            // 食べ物を食べていない場合は尻尾（最後の要素）を削除
            // 注: 尻尾の削除は checkFoodCollision で処理します
            snake.pop(); 
        }

        // スネークが食べ物を食べたか確認
        function checkFoodCollision() {
            const head = snake[0];
            
            if (head.x === foodX && head.y === foodY) {
                // スネークを成長させる: 尻尾の一部を追加する（最後の要素を複製）
                snake.push({...snake[snake.length - 1]});
                score += 10;
                scoreBoard.innerText = 'スコア: ' + score;
                placeFood();
            }
        }

        // 衝突（壁または自分自身）を確認
        function checkGameOver() {
            const head = snake[0];

            // 壁との衝突
            if (head.x < 0 || head.x >= tileCount || head.y < 0 || head.y >= tileCount) {
                return true;
            }

            // 自己衝突（頭は最初の 3 セグメントには当たらないため、4 番目のセグメントから確認）
            for (let i = 4; i < snake.length; i++) {
                if (head.x === snake[i].x && head.y === snake[i].y) {
                    return true;
                }
            }

            return false;
        }

        // すべてを描画
        function draw() {
            // キャンバスをクリア
            ctx.fillStyle = 'black';
            ctx.fillRect(0, 0, canvas.width, canvas.height);

            // 食べ物を描画
            ctx.fillStyle = 'red';
            ctx.fillRect(foodX * gridSize, foodY * gridSize, gridSize - 2, gridSize - 2);

            // スネークを描画
            ctx.fillStyle = 'lime';
            for (let i = 0; i < snake.length; i++) {
                // 頭を少しだけ変えて描画するか、通常どおり描画
                const part = snake[i];
                ctx.fillRect(part.x * gridSize, part.y * gridSize, gridSize - 2, gridSize - 2);
            }
        }

        // 食べ物をランダムな位置に置く
        function placeFood() {
            foodX = Math.floor(Math.random() * tileCount);
            foodY = Math.floor(Math.random() * tileCount);

            // 食べ物がスネークの胴体上に出現しないようにする
            for (let part of snake) {
                if (part.x === foodX && part.y === foodY) {
                    placeFood(); // 再帰的に新しい場所を探す
                    return;
                }
            }
        }

        // ゲーム終了ロジック
        function endGame() {
            isGameRunning = false;
            clearInterval(gameInterval);
            finalScoreDisplay.innerText = '最終スコア: ' + score;
            gameOverMenu.style.display = 'flex';
        }

        // ゲームをリセットするロジック
        function resetGame() {
            initGame();
        }

        // キーボード操作
        document.addEventListener('keydown', (e) => {
            // 逆方向への反転を防ぐ（右に進んでいるときは左に行けない）
            switch(e.key) {
                case 'ArrowUp':
                    if (dy !== 1) { dx = 0; dy = -1; }
                    break;
                case 'ArrowDown':
                    if (dy !== -1) { dx = 0; dy = 1; }
                    break;
                case 'ArrowLeft':
                    if (dx !== 1) { dx = -1; dy = 0; }
                    break;
                case 'ArrowRight':
                    if (dx !== -1) { dx = 1; dy = 0; }
                    break;
                case ' ':
                    if (!isGameRunning && gameOverMenu.style.display !== 'flex') {
                        initGame();
                    }
                    break;
            }
        });

        // 読み込み時にゲームを開始
        initGame();
    </script>
</body>
</html>
```

### 遊び方
1.  **上のコードをコピー** してください。
2.  コンピュータ上で `snake.html` という名前の新しいファイルを作成します。
3.  **コードを貼り付け** て保存します。
4.  **`snake.html` をダブルクリック** してブラウザで開きます。

### 操作方法
*   **矢印キー**: 上、下、左、右に移動。
*   **スペースバー**: まだ開始していなければゲームを開始します。
*   **もう一度プレイ ボタン**: ぶつかったときに表示され、ゲームを再開できます。

### この版の特徴
*   **グリッドベースの移動**: クラシックなレトロ感。
*   **スコア追跡**: リアルタイムで更新されます。
*   **ゲームオーバー画面**: 最終スコアを表示し、簡単に再開できます。
*   **衝突判定**: 壁または自分自身に当たるとゲームが終了します。
*   **自己衝突の安全対策**: このコードでは、単純なチュートリアルでよく見られる「尻尾スキップ」ロジックにより、食べ物を食べた直後にスネークが誤って自分自身を食べてしまうのを防いでいます。
````

{% endcode %}
{% 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%2FsdUp9wbpqDx0Lhp00xZ0%2Fimage.png?alt=media&amp;token=a5e67ac2-65bf-43e0-8c13-4aef9a7d269e" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### :computer: vLLM のデプロイ

これで、vLLM 経由で Z.ai のモデルの FP8 版を提供できます。860GB 以上の VRAM が必要なので、少なくとも 8xH200（141x8 = 1128GB）を推奨します。8xB200 でも問題なく動作します。まず、vLLM nightly をインストールしてください:

{% code overflow="wrap" %}

```bash
uv pip install --upgrade --force-reinstall vllm --torch-backend=auto --extra-index-url https://wheels.vllm.ai/nightly/cu130
uv pip install --upgrade --force-reinstall git+https://github.com/huggingface/transformers.git
uv pip install --force-reinstall numba
```

{% endcode %}

FP8 KV キャッシュを無効にするには（メモリ使用量を 50% 削減）、次を削除します `--kv-cache-dtype fp8`

```bash
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:False
vllm serve unsloth/GLM-5-FP8 \\
    --served-model-name unsloth/GLM-5-FP8 \\
    --kv-cache-dtype fp8 \\
    --tensor-parallel-size 8 \\
    --tool-call-parser glm47 \\
    --reasoning-parser glm45 \\
    --enable-auto-tool-choice \\
    --dtype bfloat16 \\
    --seed 3407 \\
    --max-model-len 200000 \\
    --gpu-memory-utilization 0.93 \\
    --max_num_batched_tokens 4096 \\
    --speculative-config.method mtp \\
    --speculative-config.num_speculative_tokens 1 \\
    --port 8001
```

その後、OpenAI API を通じて提供中のモデルを呼び出せます:

```python
from openai import AsyncOpenAI, OpenAI
openai_api_key = "EMPTY"
openai_api_base = "http://localhost:8001/v1"
client = OpenAI( # or AsyncOpenAI
    api_key = openai_api_key,
    base_url = openai_api_base,
)
```

### :hammer:GLM 5 でのツール呼び出し

こちらを参照 [Tool Calling Guide](/docs/jp/ji-chu/tool-calling-guide-for-local-llms.md) して、ツール呼び出しの詳細を確認してください。新しいターミナルで（tmux を使っている場合は CTRL+B+D を使用）、2つの数値の加算、Python コードの実行、Linux 関数の実行など、いくつかのツールを作成します：

{% code expandable="true" %}

```python
import json, subprocess, random
from typing import Any
def add_number(a: float | str, b: float | str) -> float:
    return float(a) + float(b)
def multiply_number(a: float | str, b: float | str) -> float:
    return float(a) * float(b)
def subtract_number(a: float | str, b: float | str) -> float:
    return float(a) - float(b)
def write_a_story() -> str:
    return random.choice([
        "はるか昔、はるか彼方の銀河系で...",
        "スロースとコードを愛する2人の友達がいました...",
        "すべてのナマケモノが超人的知能を持つよう進化したため、世界は終わりを迎えていました...",
        "片方の友達も知らないうちに、もう一方が誤ってナマケモノを進化させるプログラムを書いてしまっていました...",
    ])
def terminal(command: str) -> str:
    if "rm" in command or "sudo" in command or "dd" in command or "chmod" in command:
        msg = "'rm, sudo, dd, chmod' コマンドは危険なため実行できません"
        print(msg); return msg
    print(f"Executing terminal command `{command}`")
    try:
        return str(subprocess.run(command, capture_output = True, text = True, shell = True, check = True).stdout)
    except subprocess.CalledProcessError as e:
        return f"Command failed: {e.stderr}"
def python(code: str) -> str:
    data = {}
    exec(code, data)
    del data["__builtins__"]
    return str(data)
MAP_FN = {
    "add_number": add_number,
    "multiply_number": multiply_number,
    "subtract_number": subtract_number,
    "write_a_story": write_a_story,
    "terminal": terminal,
    "python": python,
}
tools = [
    {
        "type": "function",
        "function": {
            "name": "add_number",
            "description": "2つの数を加算します。",
            "parameters": {
                "type": "object",
                "properties": {
                    "a": {
                        "type": "string",
                        "description": "最初の数。",
                    },
                    "b": {
                        "type": "string",
                        "description": "2つ目の数。",
                    },
                },
                "required": ["a", "b"],
            },
        },
    },
    {
        "type": "function",
        "function": {
            "name": "multiply_number",
            "description": "2つの数を掛け算します。",
            "parameters": {
                "type": "object",
                "properties": {
                    "a": {
                        "type": "string",
                        "description": "最初の数。",
                    },
                    "b": {
                        "type": "string",
                        "description": "2つ目の数。",
                    },
                },
                "required": ["a", "b"],
            },
        },
    },
    {
        "type": "function",
        "function": {
            "name": "subtract_number",
            "description": "2つの数を引きます。",
            "parameters": {
                "type": "object",
                "properties": {
                    "a": {
                        "type": "string",
                        "description": "最初の数。",
                    },
                    "b": {
                        "type": "string",
                        "description": "2つ目の数。",
                    },
                },
                "required": ["a", "b"],
            },
        },
    },
    {
        "type": "function",
        "function": {
            "name": "write_a_story",
            "description": "ランダムな物語を書きます。",
            "parameters": {
                "type": "object",
                "properties": {},
                "required": [],
            },
        },
    },
    {
        "type": "function",
        "function": {
            "name": "terminal",
            "description": "ターミナルから操作を実行します。",
            "parameters": {
                "type": "object",
                "properties": {
                    "command": {
                        "type": "string",
                        "description": "起動したいコマンドです。例: `ls`, `rm`, ...",
                    },
                },
                "required": ["command"],
            },
        },
    },
    {
        "type": "function",
        "function": {
            "name": "python",
            "description": "実行される Python コードを使って Python インタープリタを呼び出します。",
            "parameters": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string",
                        "description": "実行する Python コード",
                    },
                },
                "required": ["code"],
            },
        },
    },
]
```

{% endcode %}

その後、以下の関数（コピーして貼り付けて実行）を使います。これにより関数呼び出しが自動で解析され、任意のモデルに対して OpenAI エンドポイントが呼び出されます：

{% code overflow="wrap" expandable="true" %}

```python
from openai import OpenAI
def unsloth_inference(
    messages,
    temperature = 1.0,
    top_p = 0.95,
    top_k = -1,
    min_p = 0.01,
    repetition_penalty = 1.0,
):
    messages = messages.copy()
    openai_client = OpenAI(
        base_url = "http://127.0.0.1:8001/v1",
        api_key = "sk-no-key-required",
    )
    model_name = next(iter(openai_client.models.list())).id
    print(f"Using model = {model_name}")
    has_tool_calls = True
    original_messages_len = len(messages)
    while has_tool_calls:
        print(f"Current messages = {messages}")
        response = openai_client.chat.completions.create(
            model = model_name,
            messages = messages,
            temperature = temperature,
            top_p = top_p,
            tools = tools if tools else None,
            tool_choice = "auto" if tools else None,
            extra_body = {"top_k": top_k, "min_p": min_p, "repetition_penalty" :repetition_penalty,}
        )
        tool_calls = response.choices[0].message.tool_calls or []
        content = response.choices[0].message.content or ""
        tool_calls_dict = [tc.to_dict() for tc in tool_calls] if tool_calls else tool_calls
        messages.append({"role": "assistant", "tool_calls": tool_calls_dict, "content": content,})
        for tool_call in tool_calls:
            fx, args, _id = tool_call.function.name, tool_call.function.arguments, tool_call.id
            out = MAP_FN[fx](**json.loads(args))
            messages.append({"role": "tool", "tool_call_id": _id, "name": fx, "content": str(out),})
        else:
            has_tool_calls = False
    return messages
```

{% endcode %}

GLM 5 を次で起動した後: `llama-server` で起動した後、 [#deploy-with-llama-server-and-openais-completion-library](#deploy-with-llama-server-and-openais-completion-library "mention") のように、あるいは [Tool Calling Guide](/docs/jp/ji-chu/tool-calling-guide-for-local-llms.md) 詳細については、その後いくつかのツール呼び出しを行えます。

### 📊 ベンチマーク

ベンチマークは、以下で表形式でも確認できます：

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F3QI8akFZoQFXsZ2ojtgK%2Fglm5%20bench.jpg?alt=media&amp;token=0fb5d73f-4dc4-46f5-bd76-206c26ff5e96" alt="" width="375"><figcaption></figcaption></figure>

<table data-full-width="true"><thead><tr><th>ベンチマーク</th><th>GLM-5</th><th>GLM-4.7</th><th>DeepSeek-V3.2</th><th>Kimi K2.5</th><th>Claude Opus 4.5</th><th>Gemini 3 Pro</th><th>GPT-5.2 (xhigh)</th></tr></thead><tbody><tr><td>HLE</td><td>30.5</td><td>24.8</td><td>25.1</td><td>31.5</td><td>28.4</td><td>37.2</td><td>35.4</td></tr><tr><td>HLE（ツール使用）</td><td>50.4</td><td>42.8</td><td>40.8</td><td>51.8</td><td>43.4*</td><td>45.8*</td><td>45.5*</td></tr><tr><td>AIME 2026 I</td><td>92.7</td><td>92.9</td><td>92.7</td><td>92.5</td><td>93.3</td><td>90.6</td><td>-</td></tr><tr><td>HMMT 2025年11月</td><td>96.9</td><td>93.5</td><td>90.2</td><td>91.1</td><td>91.7</td><td>93.0</td><td>97.1</td></tr><tr><td>IMOAnswerBench</td><td>82.5</td><td>82.0</td><td>78.3</td><td>81.8</td><td>78.5</td><td>83.3</td><td>86.3</td></tr><tr><td>GPQA-Diamond</td><td>86.0</td><td>85.7</td><td>82.4</td><td>87.6</td><td>87.0</td><td>91.9</td><td>92.4</td></tr><tr><td>SWE-bench Verified</td><td>77.8</td><td>73.8</td><td>73.1</td><td>76.8</td><td>80.9</td><td>76.2</td><td>80.0</td></tr><tr><td>SWE-bench Multilingual</td><td>73.3</td><td>66.7</td><td>70.2</td><td>73.0</td><td>77.5</td><td>65.0</td><td>72.0</td></tr><tr><td>Terminal-Bench 2.0 (Terminus 2)</td><td>56.2 / 60.7 †</td><td>41.0</td><td>39.3</td><td>50.8</td><td>59.3</td><td>54.2</td><td>54.0</td></tr><tr><td>Terminal-Bench 2.0 (Claude Code)</td><td>56.2 / 61.1 †</td><td>32.8</td><td>46.4</td><td>-</td><td>57.9</td><td>-</td><td>-</td></tr><tr><td>CyberGym</td><td>43.2</td><td>23.5</td><td>17.3</td><td>41.3</td><td>50.6</td><td>39.9</td><td>-</td></tr><tr><td>BrowseComp</td><td>62.0</td><td>52.0</td><td>51.4</td><td>60.6</td><td>37.0</td><td>37.8</td><td>-</td></tr><tr><td>BrowseComp（コンテキスト管理あり）</td><td>75.9</td><td>67.5</td><td>67.6</td><td>74.9</td><td>67.8</td><td>59.2</td><td>65.8</td></tr><tr><td>BrowseComp-Zh</td><td>72.7</td><td>66.6</td><td>65.0</td><td>62.3</td><td>62.4</td><td>66.8</td><td>76.1</td></tr><tr><td>τ²-Bench</td><td>89.7</td><td>87.4</td><td>85.3</td><td>80.2</td><td>91.6</td><td>90.7</td><td>85.5</td></tr><tr><td>MCP-Atlas（公開セット）</td><td>67.8</td><td>52.0</td><td>62.2</td><td>63.8</td><td>65.2</td><td>66.6</td><td>68.0</td></tr><tr><td>Tool-Decathlon</td><td>38.0</td><td>23.8</td><td>35.2</td><td>27.8</td><td>43.5</td><td>36.4</td><td>46.3</td></tr><tr><td>Vending Bench 2</td><td>$4,432.12</td><td>$2,376.82</td><td>$1,034.00</td><td>$1,198.46</td><td>$4,967.06</td><td>$5,478.16</td><td>$3,591.33</td></tr></tbody></table>


---

# 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/moderu/tutorials/glm-5.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.
