wx-ai deployment create

Creates a deployment. The only supported type is online.

If this deployment is created for a prompt tune, then the asset object must exist and the id must be the id of the model that was created after the prompt training. If this deployment is created for a prompt template, then the prompt_template object must exist and the id must be the id of the prompt template to be deployed.

Syntax

cpd-cli wx-ai deployment
create \
--hardware-spec-name=<hardware-spec-name> \
--hardware-spec-num-nodes=<hardware-spec-num-nodes> \
--hardware-spec-rev=<hardware-spec-rev> \
--name=<deployment-name> \
[--asset=<Rel> | --asset-id=<asset-id>] \
[--asset-rev=<asset-rev>] \
[--base-model-id=<base-model-id>] \
[--custom=<map<key,value>>] \
[--description=<deployment-description>] \
[--hardware-spec=<hardware-spec> | --hardware-spec-id=<hardware-spec-id>] \
[--online=<online-deployment> | --online-parameters] \
[--project-id=<project-id>] \
[--prompt-template=<prompt-template>] | --prompt-template-id=<prompt-template-id>] \
[--space-id=<space-identifier>] \
[--tags=<tag1,tag2,...>]

Options

Table 1: Command options
Option Description
--asset Specify a reference to a deployment. This JSON option can instead be provided by setting individual fields with other options such as the --asset-id option. It is mutually exclusive with those options.
Status
Optional.
Syntax
--asset=<Rel>
Default value
No default.
Valid values

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @. For example --asset=@path/to/file.json.

The following example shows the format of the Rel object.
{
  "id" : "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
  "rev" : "2"
}
--asset-id The ID of the referenced deployment. This option provides a value for a sub-field of the JSON option asset. It is mutually exclusive with the asset option.
Status
Optional.
Syntax
--asset-id=<asset-id>
Default value
--asset-id
Valid values
String.
--asset-rev The revision of the referenced deployment. This option provides a value for a sub-field of the JSON option asset. It is mutually exclusive with the asset option.
Status
Optional.
Syntax
--asset-rev=<asset-rev>
Default value
No default.
--base-model-id The base model that is required for this deployment if this deployment is for a prompt template or a prompt tune for an IBM foundation model.
Status
Optional.
Syntax
--base-model-id=<base-model-id>
Default value
No default.
--custom Specify user-defined properties as key-value pairs.
Status
Optional.
Syntax
--custom=<map<key,value>>
Default value
No default.
--description A description of the deployment.
Status
Optional.
Syntax
--description=<deployment-description>
Default value
No default.
--hardware-spec A hardware specification. This JSON option can be provided by setting individual fields with other options. It is mutually exclusive with those options.
Status
Optional.
Syntax
--hardware-spec=<hardware-spec>
Default value
No default.
Input type
string
Valid values

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @. For example, --hardware-spec=@path/to/file.json

The following example shows the format of the HardwareSpec object.
{
  "id" : "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
  "rev" : "2",
  "name" : "exampleString",
  "num_nodes" : 2
}
--hardware-spec-id The ID of the hardware specification. Only one of id or name can be set. This option provides a value for a sub-field of the JSON option hardware-spec. It is mutually exclusive with the hardware-spec option.
Status
Optional.
Syntax
--hardware-spec-id=<hardware-spec-id>
Default value
No default.
Input type
string
Valid values

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @. For example, --hardware-spec=@path/to/file.json

The following example shows the format of the HardwareSpec object.
{
  "id" : "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
  "rev" : "2",
  "name" : "exampleString",
  "num_nodes" : 2
}
--hardware-spec-name The name of the hardware specification. Only one of id or name can be set. This option provides a value for a sub-field of the JSON option hardware-spec. It is mutually exclusive with the hardware-spec option.
Status
Required.
Syntax
--hardware-spec-name=<hardware-spec-name>
Default value
No default.
Input type
string
--hardware-spec-num-nodes (int64) The name of the hardware specification. Only one of id or name can be set. This option provides a value for a sub-field of the JSON option hardware-spec. It is mutually exclusive with the hardware-spec option.
Status
Required.
Syntax
--hardware-spec-num-nodes=<hardware-spec-num-nodes>
Default value
No default.
Input type
int64
--hardware-spec-rev The revision of the hardware specification if id is used. This option provides a value for a sub-field of the JSON option hardware-spec. It is mutually exclusive with the hardware-spec option.
Status
Required.
Syntax
--hardware-spec-rev=<hardware-spec-rev>
Default value
No default.
Input type
string
--name Specify the name of the deployment.
Status
Required.
Syntax
--name=<deployment-name>
Default value
No default.
Input type
string
--online Specify an empty object. The option indicates an online deployment. More properties can be added later during online deployment setup. The 'serving_name' can be provided in the 'online.parameters'. The 'serving_name' can include only the characters [a-z,0-9,_] and the length cannot exceed 36 characters. The 'serving_name' can be used in the prediction URL in place of the 'deployment_id'.
Status
Optional.
Syntax
--online=<online-deployment>
Default value
No default.
Input type
string
Valid values

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @. For example, --online=@path/to/file.json.

The following example shows the format of the OnlineDeployment object.
{
  "parameters" : {
    "serving_name" : "churn"
  }
}
--online-parameters A set of key-value pairs that are used to configure the deployment. This option provides a value for a sub-field of the JSON option online. It is mutually exclusive with the online option.
Status
Optional.
Syntax
--online-parameters=<online-parameters>
Default value
No default.
Input type
string
Valid values

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @. For example, --online-parameters=@path/to/file.json.

--project-id The project that contains the deployment. Either space_id or project_id must be given.
Status
Optional.
Syntax
--project-id=<project-id>
Input type
string
Default value
No default.
--prompt-template A reference to a deployment. This JSON option can be provided by setting individual fields with other options. It is mutually exclusive with those options.
Status
Optional.
Syntax
--prompt-template=<prompt-template>
Default value
No default.
Input type
string
Valid values
A valid project identifier.
--prompt-template-id The ID of the referenced deployment. The prompt-template-id option provides a value for a sub-field of the JSON option prompt-template. It is mutually exclusive with the prompt-template option.
Status
Optional.
Syntax
--prompt-template-id=<prompt-template-id>
Default value
No default.
Input type
string
Valid values
A valid project identifier.
--space-id The space that contains the deployment. Either space_id or project_id must be given.
Status
Optional.
Syntax
--space-id=<space-identifier>
Default value
No default.
Input type
string
--tags A list of tags for this deployment.
Status
Optional.
Syntax
--tags=<tag1,tag2,...>
Default value
No default.
Input type
string

Examples

A standard run with sample values.

cpd-cli wx-ai deployment
create \
    --name text_classification \
    --online '{"parameters": {"serving_name": "churn"}}' \
    --project-id 12ac4cf1-252f-424b-b52d-5cdd9814987f \
    --space-id exampleString \
    --description exampleString \
    --tags exampleString,anotherTestString \
    --custom '{"anyKey": "anyValue"}' \
    --asset '{"id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2"}' \
    --prompt-template '{"id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab"}' \
    --hardware-spec '{"id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "name": "exampleString", "num_nodes": 2}' \
    --base-model-id exampleString

Alternatively, granular options are available for the sub-fields of JSON string options:

cpd-cli wx-ai deployment
create \
    --name text_classification \
    --project-id 12ac4cf1-252f-424b-b52d-5cdd9814987f \
    --space-id exampleString \
    --description exampleString \
    --tags exampleString,anotherTestString \
    --custom '{"anyKey": "anyValue"}' \
    --base-model-id exampleString \
    --online-parameters onlineDeploymentParameters \
    --asset-id 4cedab6d-e8e4-4214-b81a-2ddb122db2ab \
    --asset-rev 2 \
    --prompt-template-id 4cedab6d-e8e4-4214-b81a-2ddb122db2ab \
    --hardware-spec-id 4cedab6d-e8e4-4214-b81a-2ddb122db2ab \
    --hardware-spec-rev 2 \
    --hardware-spec-name exampleString \
    --hardware-spec-num-nodes 2