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

# NVIDIA NeMo Inference Microservice デプロイジョブ

> スケーラブルなモデルサービングのために、W&B Launch を使用して W&B のモデルアーティファクトを NVIDIA NeMo Inference Microservice にデプロイします。

W\&B から NVIDIA NeMo Inference Microservice にモデルアーティファクトをデプロイします。これを行うには、W\&B Launch を使用します。W\&B Launch はモデルアーティファクトを NVIDIA NeMo Model に変換し、実行中の NIM/Triton サーバーにデプロイします。

W\&B Launch は現在、以下の互換性のあるモデルタイプをサポートしています。

1. [Llama2](https://llama.meta.com/llama2/)
2. [StarCoder](https://github.com/bigcode-project/starcoder)
3. NV-GPT (近日対応予定)

<Note>
  デプロイ時間は、モデルとマシンタイプによって異なります。ベースの Llama2-7b 設定では、Google Cloud の `a2-ultragpu-1g` で約 1 分かかります。
</Note>

<div id="quickstart">
  ## クイックスタート
</div>

1. まだ作成していない場合は、[Launch queue を作成](/ja/platform/launch/add-job-to-queue/)します。以下にキュー設定の例を示します。

   ```yaml theme={null}
   net: host
   gpus: all # 特定の GPU セット、またはすべてを使用する場合は `all` を指定できます
   runtime: nvidia # nvidia container runtime も必要です
   volume:
     - model-store:/model-store/
   ```

   <Frame>
     <img src="https://mintcdn.com/wb-21fd5541-docs-hivemind-launch/zScEGRJKnI_Vuqe8/images/integrations/nim1.png?fit=max&auto=format&n=zScEGRJKnI_Vuqe8&q=85&s=be4a1380ebbb2760a4fb45659fb84f45" alt="image" width="972" height="570" data-path="images/integrations/nim1.png" />
   </Frame>

2. プロジェクト内でこのジョブを作成します。

   ```bash theme={null}
   wandb job create -n "deploy-to-nvidia-nemo-inference-microservice" \
      -e $ENTITY \
      -p $PROJECT \
      -E jobs/deploy_to_nvidia_nemo_inference_microservice/job.py \
      -g andrew/nim-updates \
      git https://github.com/wandb/launch-jobs
   ```

3. GPU マシンでエージェントを起動します。
   ```bash theme={null}
   wandb launch-agent -e $ENTITY -p $PROJECT -q $QUEUE
   ```

4. [Launch UI](https://wandb.ai/launch) から、必要な設定を指定してデプロイ用の launch ジョブを送信します。
   1. CLI から送信することもできます。
      ```bash theme={null}
      wandb launch -d gcr.io/playground-111/deploy-to-nemo:latest \
        -e $ENTITY \
        -p $PROJECT \
        -q $QUEUE \
        -c $CONFIG_JSON_FNAME
      ```
      <Frame>
        <img src="https://mintcdn.com/wb-21fd5541-docs-hivemind-launch/zScEGRJKnI_Vuqe8/images/integrations/nim2.png?fit=max&auto=format&n=zScEGRJKnI_Vuqe8&q=85&s=df2a18cf170efa6eed15de8bc0897719" alt="image" width="903" height="1263" data-path="images/integrations/nim2.png" />
      </Frame>

5. Launch UI でデプロイの進行状況をトラッキングできます。
   <Frame>
     <img src="https://mintcdn.com/wb-21fd5541-docs-hivemind-launch/zScEGRJKnI_Vuqe8/images/integrations/nim3.png?fit=max&auto=format&n=zScEGRJKnI_Vuqe8&q=85&s=1b9dee43d28165e59322f0c2056825ed" alt="image" width="928" height="692" data-path="images/integrations/nim3.png" />
   </Frame>

6. 完了したら、すぐにエンドポイントに curl リクエストを送ってモデルをテストできます。モデル名は常に `ensemble` です。
   ```bash theme={null}
    #!/bin/bash
    curl -X POST "http://0.0.0.0:9999/v1/completions" \
        -H "accept: application/json" \
        -H "Content-Type: application/json" \
        -d '{
            "model": "ensemble",
            "prompt": "Tell me a joke",
            "max_tokens": 256,
            "temperature": 0.5,
            "n": 1,
            "stream": false,
            "stop": "string",
            "frequency_penalty": 0.0
            }'
   ```
