> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-1917.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 推論情報を表示する

> Serverless Inference のレスポンスで推論情報を返し、表示する方法

[Google's Gemma 4](https://huggingface.co/google/gemma-4-31B-it) のような推論モデルは、最終的な回答に加えて、推論ステップに関する情報も返します。このページでは、Serverless Inference で推論対応モデルを識別する方法、レスポンス内のどこで推論出力を確認できるか、また推論の切り替えをサポートするモデルで推論のオン/オフを切り替える方法について説明します。

モデルが推論をサポートするかどうかを判断するには、次の サポートされるモデル の表、または UI のそのカタログページにある Supported Features セクションを確認してください。

推論情報は、レスポンスの `reasoning` フィールドに表示されます。推論非対応モデルのレスポンスでは、このフィールドの値は `null` です。

<div id="supported-models-with-reasoning">
  ## サポートされるモデル (推論対応)
</div>

次の表は、Serverless Inference で 推論 output を返すモデルを示しています。サポートされる各モデルでは、推論 が常に含まれる場合や、既定で 推論 が無効または有効になっている場合があります。

| モデル ID (API 用)                                 | 推論 サポート  |
| ---------------------------------------------- | -------- |
| `deepseek-ai/DeepSeek-V4-Flash`                | デフォルトで無効 |
| `google/gemma-4-31B-it`                        | デフォルトで有効 |
| `MiniMaxAI/MiniMax-M2.5`                       | 常時有効     |
| `moonshotai/Kimi-K2.6`                         | 常時有効     |
| `moonshotai/Kimi-K2.5`                         | 常時有効     |
| `nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-FP8` | デフォルトで有効 |
| `openai/gpt-oss-120b`                          | 常時有効     |
| `openai/gpt-oss-20b`                           | 常時有効     |
| `Qwen/Qwen3.5-35B-A3B`                         | デフォルトで有効 |
| `Qwen/Qwen3.5-27B`                             | デフォルトで有効 |
| `Qwen/Qwen3-235B-A22B-Thinking-2507`           | 常時有効     |
| `zai-org/GLM-5.1`                              | デフォルトで有効 |

<div id="models-with-always-on-reasoning">
  ### 推論が `常時有効` のモデル
</div>

前述の[サポートされるモデル](#supported-models)表でモデルが`常時有効`と記載されている場合、そのモデルには常に推論が含まれており、これを無効にすることはできません。

<div id="disable-reasoning">
  ### 推論を無効にする
</div>

モデルが前述の [サポートされるモデル](#supported-models) の表で `デフォルトで有効` として記載されている場合は、トークン使用量を減らしたり、応答を簡潔にしたりするために、推論を無効にできます。リクエストで推論を無効にするには、`chat_template_kwargs` で `enable_thinking` フラグを `False` (Python) または `false` (Bash) に設定します。

<Tabs>
  <Tab title="Python">
    ```python lines highlight={13-17} theme={null}
    import openai

    client = openai.OpenAI(
        base_url='https://api.inference.wandb.ai/v1',
        api_key="[YOUR-API-KEY]",  # https://wandb.ai/settings でAPIキーを作成します
    )

    response = client.chat.completions.create(
        model="google/gemma-4-31B-it",
        messages=[
            {"role": "user", "content": "3.11 and 3.8, which is greater?"}
        ],
        extra_body={
            "chat_template_kwargs": {
                "enable_thinking": False
            }
        },
    )
    ```
  </Tab>

  <Tab title="Bash">
    ```bash lines highlight={9} theme={null}
    curl https://api.inference.wandb.ai/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer [YOUR-API-KEY]" \
      -d '{
        "model": "google/gemma-4-31B-it",
        "messages": [
          { "role": "user", "content": "3.11 and 3.8, which is greater?" }
        ],
        "chat_template_kwargs": {"enable_thinking": false}
      }'
    ```
  </Tab>
</Tabs>

<div id="enable-reasoning">
  ### 推論 を有効にする
</div>

モデルが前述の[サポートされるモデル](#supported-models)の表で`Disabled by default`と記載されている場合は、前述のコードスニペットで`enable_thinking`フラグを`True` (Python) または`true` (Bash) に設定すると、推論 を有効にできます。
