メインコンテンツまでスキップ

エンドポイントを提供する基盤モデルの作成

この記事では、基盤モデルをデプロイして提供するモデルサービングエンドポイントを作成する方法について説明します。

Mosaic AI Model Serving は、以下のモデルをサポートしています。

  • 外部モデル。 これらは、Databricks の外部でホストされている基盤モデルです。 外部モデルを提供するエンドポイントを一元管理し、顧客はレート制限とアクセス制御を確立できます。 例としては、OpenAIのGPT-4やAnthropicのClaudeなどの基盤モデルが含まれます。

  • 基盤モデルが提供するAPIs最先端のオープン基盤モデル.これらのモデルは、最適化された推論をサポートするキュレーションされた基盤モデル アーキテクチャです。 Meta-Llama-3.1-70B-Instructのような基本モデル、 GTE-Large と Mistral-7B は、 トークン単位の従量課金 price ですぐに使用できます。 基本モデルまたは微調整されたモデルを使用した本番運用ワークロードは、 プロビジョニング スループット を使用してパフォーマンス保証付きでデプロイできます。

モデルサービングには、モデルサービングエンドポイントの作成に次のオプションがあります。

  • サービングUI
  • REST API
  • MLflow デプロイ SDK

従来の ML モデルまたは Python モデルを提供するエンドポイントを作成するには、「 カスタムモデルサービングエンドポイントを作成する」を参照してください。

必要条件

  • サポートされているリージョン内の Databricks ワークスペース。

  • MLflow デプロイ SDK を使用してエンドポイントを作成するには、MLflow デプロイ クライアントをインストールする必要があります。 インストールするには、次のコマンドを実行します。

Python
import mlflow.deployments

client = mlflow.deployments.get_deploy_client("databricks")

基盤モデルの提供エンドポイントを作成する

プロビジョニング スループット の基盤モデルを使用して利用可能になった、きめ細かいバリアントを提供するエンドポイントを作成できますAPIs 。「 REST API を使用してプロビジョニングされたスループットエンドポイントを作成する」を参照してください

トークン 単位の従量課金 基盤モデルを使用して利用可能になる基盤モデルの場合、APIs は、Databricks Databricksワークスペースでサポートされているモデルにアクセスするための特定のエンドポイントを自動的に提供します。それらにアクセスするには、ワークスペースの左側のサイドバーにある [配信 ] タブを選択します。 基盤モデル APIs は、エンドポイント リスト ビューの上部にあります。

これらのエンドポイントのクエリについては、「 クエリ基盤モデル」を参照してください。

外部モデルサービングエンドポイントの作成

次に、Databricks 外部モデルを使用して利用可能になった基盤モデルをクエリするエンドポイントを作成する方法について説明します。

  1. In the Name field provide a name for your endpoint.
  2. In the Served entities section
    1. Click into the Entity field to open the Select served entity form.
    2. Select Foundation models.
    3. In the Select a foundation model field, select the model provider you want to use from those listed under External model providers. The form dynamically updates based on your model provider selection.
    4. Click Confirm.
    5. Provide the configuration details for accessing the selected model provider. This is typically the secret that references the personal access token you want the endpoint to use to access this model.
    6. Select the task. Available tasks are chat, completion, and embeddings.
    7. Select the name of the external model you want to use. The list of models dynamically updates based on your task selection. See the available external models.
  3. Click Create. The Serving endpoints page appears with Serving endpoint state shown as Not Ready.

Create a model serving endpoint

Update モデルサービングエンドポイント

モデルの端点を有効にした後、必要に応じてコンピュート構成を設定できます。 この構成は、モデルに追加のリソースが必要な場合に特に役立ちます。 ワークロードのサイズとコンピュートの設定は、モデルを提供するためにどのリソースが割り当てられるかにおいて重要な役割を果たします。

新しい設定の準備が整うまで、古い設定は予測トラフィックを提供し続けます。 更新が進行中の間は、別の更新を行うことはできません。 Serving UI では、エンドポイントの詳細ページの右上にある [Cancel update] (更新のキャンセル ) を選択することで、進行中の設定更新をキャンセルできます。 この機能は、サービングUIでのみ使用できます。

エンドポイント設定に external_model が存在する場合、提供されるエンティティ リストには 1 つのserved_entity オブジェクトのみを含めることができます。 external_modelを持つ既存のエンドポイントを更新して、external_modelをなくすことはできません。エンドポイントが external_modelなしで作成されている場合、エンドポイントを更新して external_modelを追加することはできません。

To update your endpoint see the REST API update configuration documentation for request and response schema details.

Bash
{
"name": "openai_endpoint",
"served_entities":
[
{
"name": "openai_chat",
"external_model":{
"name": "gpt-4",
"provider": "openai",
"task": "llm/v1/chat",
"openai_config":{
"openai_api_key": "{{secrets/my_scope/my_openai_api_key}}"
}
}
}
]
}

追加のリソース