> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/deployment/ja/serufuhosuto/inference-server.md).

# Inference Server

推論サーバーは、次をラップするスタンドアロンのマイクロサービスです。 [`推論` Python パッケージ](/deployment/ja/serufuhosuto/inference-library.md)。画像用の HTTP エンドポイントと、動画ストリーム用の WebRTC エンドポイントを公開します。1つのサーバーで複数のクライアントにサービスを提供し、同じモデルと [Workflows](https://docs.roboflow.com/workflows) Roboflow のホスト型 API と同様です。セルフホストする推奨方法です。参照 [方法を選ぶ](/deployment/ja/serufuhosuto/self-hosted.md#pick-a-path) ライブラリを直接実行する場合との比較については、

## 実行場所

自分のハードウェア（Raspberry Pi、NVIDIA GPU、NVIDIA Jetson、または通常のサーバー）でサーバーをセルフホストするには、 [Docker](/deployment/ja/serufuhosuto/inference-server/install.md)、または [ご自身の AWS、GCP、または Azure アカウント](/deployment/ja/serufuhosuto/inference-server/install/cloud.md)。Roboflow は同じサーバーを次のものとしても提供しています。 [サーバーレス Cloud API](/deployment/ja/roboflow-cloud/serverless-api.md) および [専用デプロイメント](/deployment/ja/roboflow-cloud/dedicated-deployments.md)：参照 [デプロイメントオプションの選択](/deployment/ja/choosing-a-deployment.md).

どちらを選んでも、次を通じてやり取りします。 [Inference SDK](https://docs.roboflow.com/reference/inference/inference-sdk)、なぜなら両者は 1 つのインターフェースを共有しているからです。違うのは `api_url` だけです。

## Docker での実行

始める前に、 [Docker がインストールされている](https://www.docker.com/get-started) ことを確認してください。Inference Server を起動する最も簡単な方法は、次を使うことです。 [Inference CLI](https://docs.roboflow.com/reference/inference/inference-cli):

```bash
pip install inference-cli && inference server start
```

これにより、お使いのマシンに適した Docker イメージが依存関係をあらかじめインストールした状態で取得され、Inference Server がポート 9001 で起動します。サーバーの状態は次で確認できます：

```bash
inference server status
```

## Docker コンテナを手動でセットアップする

`inference server start` は `docker run` 内部で、推奨されるセキュリティ設定、キャッシュ、プラットフォーム固有のオプションを使用して実行されます。

コンテナを自分で起動したい場合は、お使いのプラットフォームのインストールガイドの「Manually starting the container」セクションを参照してください：

* [Linux](/deployment/ja/serufuhosuto/inference-server/install/linux.md#manually-starting-the-container)
* [Windows](/deployment/ja/serufuhosuto/inference-server/install/windows.md#manually-starting-the-container)
* [Mac](/deployment/ja/serufuhosuto/inference-server/install/mac.md#using-docker)
* [Jetson](/deployment/ja/serufuhosuto/inference-server/install/jetson.md#manually-starting-the-container)
* [Raspberry Pi](/deployment/ja/serufuhosuto/inference-server/install/raspberry-pi.md#manually-starting-the-container)

コンテナの設定は環境変数で制御されます。参照： [Docker の設定オプション](/deployment/ja/serufuhosuto/inference-server/configuration/docker-configuration.md) および完全な [環境変数リファレンス](/deployment/ja/serufuhosuto/inference-server/configuration/environment-variables.md).

## 組み込みの JupyterLab ノートブック

Inference Server には組み込みの JupyterLab 環境が付属しており、開発およびテスト中に試す最も速い方法です。既定では無効になっているため、サーバーを次で起動してください： `--dev` フラグを付けて有効にします：

```bash
pip install inference-cli
inference server start --dev
```

次に開いてください `http://localhost:9001` をブラウザーで開くと、リソース、サンプル、組み込みの JupyterLab 環境へのリンクがある Inference のランディングページが表示されます。"Jump Into an Inference Enabled Notebook" を選択すると、JupyterLab が新しいタブで開きます。サンプルノートブックと、Inference の実行に必要なすべての依存関係があらかじめ読み込まれています。

{% hint style="warning" %}
「 `--dev` ノートブック環境はローカル開発向けです。信頼できないネットワークから到達可能なサーバーでは有効にしないでください。参照： [セルフホストサーバーの保護](/deployment/ja/serufuhosuto/inference-server/configuration/security.md).
{% endhint %}

## 動画をストリーミングする

Inference SDK の WebRTC クライアントを使って、Web カメラ、カメラ映像、動画ファイルをモデルまたは Workflow 経由でストリーミングします：

```bash
pip install "inference-sdk[webrtc]"
```

設定します `api_url="http://localhost:9001"` を指定して `InferenceHTTPClient`。詳細は [WebRTC ストリーミング](https://docs.roboflow.com/reference/inference/inference-sdk/webrtc) モデルおよび Workflow の例については、または次に従ってください： [Workflows による動画処理](https://docs.roboflow.com/workflows/deploy/video-processing) タスクベースのガイドを参照してください。

## このセクションでは

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Inference Serverのインストール</strong></td><td>要件、デバイス別のインストールガイド、自分のクラウド、更新について。</td><td><a href="/pages/f804574e67da6d1604e7d3e95b79a77a9f8232b9">/pages/f804574e67da6d1604e7d3e95b79a77a9f8232b9</a></td></tr><tr><td><strong>モデルを実行する</strong></td><td>HTTP による最初のリクエスト、モデル ID、可視化。</td><td><a href="/pages/38a82e950c94deae677dec1a6d56434c36681970">/pages/38a82e950c94deae677dec1a6d56434c36681970</a></td></tr><tr><td><strong>設定</strong></td><td>コンテナオプション、環境変数、セキュリティ、HTTPS、テレメトリ。</td><td><a href="/pages/c518c0dafd8cc317838b0798c3eed20485c4214d">/pages/c518c0dafd8cc317838b0798c3eed20485c4214d</a></td></tr><tr><td><strong>アーキテクチャ</strong></td><td>リクエスト、動画、Workflow がサーバーをどのように流れるか。</td><td><a href="/pages/064fce56367077830db6b964e23b91443681c504">/pages/064fce56367077830db6b964e23b91443681c504</a></td></tr></tbody></table>
