Skip to content

Commit

Permalink
Update documentation for automatic remote model deployment (#6748)
Browse files Browse the repository at this point in the history
* update documentation for automatic remote model deployment

Signed-off-by: Xun Zhang <[email protected]>

* add automatic deploy doc in connecting to externall hosted models

Signed-off-by: Xun Zhang <[email protected]>

* add remind to undeploy model

Signed-off-by: Xun Zhang <[email protected]>

* address comments

Signed-off-by: Xun Zhang <[email protected]>

* Update _ml-commons-plugin/api/model-apis/deploy-model.md

Signed-off-by: kolchfa-aws <[email protected]>

---------

Signed-off-by: Xun Zhang <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>
Co-authored-by: kolchfa-aws <[email protected]>
  • Loading branch information
Zhangxunmt and kolchfa-aws authored Mar 25, 2024
1 parent f685b6d commit 88242fa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
14 changes: 13 additions & 1 deletion _ml-commons-plugin/api/model-apis/deploy-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ nav_order: 20

# Deploy a model

The deploy model operation reads the model's chunks from the model index and then creates an instance of the model to cache into memory. This operation requires the `model_id`.
The deploy model operation reads the model's chunks from the model index and then creates an instance of the model to cache in memory. This operation requires the `model_id`.

Starting with OpenSearch version 2.13, [externally hosted models]({{site.url}}{{site.baseurl}}/ml-commons-plugin/remote-models/index) are deployed automatically by default when you send a Predict API request for the first time. To disable automatic deployment for an externally hosted model, set `plugins.ml_commons.model_auto_deploy.enable` to `false`:

```json
PUT _cluster/settings
{
"persistent": {
"plugins.ml_commons.model_auto_deploy.enable": "false"
}
}
```
{% include copy-curl.html %}

For information about user access for this API, see [Model access control considerations]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/model-apis/index/#model-access-control-considerations).

Expand Down
13 changes: 12 additions & 1 deletion _ml-commons-plugin/remote-models/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,18 @@ Take note of the returned `model_id` because you’ll need it to deploy the mode

## Step 4: Deploy the model

To deploy the registered model, provide its model ID from step 3 in the following request:
Starting with OpenSearch version 2.13, externally hosted models are deployed automatically by default when you send a Predict API request for the first time. To disable automatic deployment for an externally hosted model, set `plugins.ml_commons.model_auto_deploy.enable` to `false`:
```json
PUT _cluster/settings
{
"persistent": {
"plugins.ml_commons.model_auto_deploy.enable" : "false"
}
}
```
{% include copy-curl.html %}

To undeploy the model, use the [Undeploy API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/model-apis/undeploy-model/).

```bash
POST /_plugins/_ml/models/cleMb4kBJ1eYAeTMFFg4/_deploy
Expand Down

0 comments on commit 88242fa

Please sign in to comment.