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

cpdctl wx-ai deployment create \
[--asset ASSET | --asset-id ASSET-ID] \
[--asset-rev ASSET-REV] \
[--base-model-id BASE-MODEL-ID] \
[--custom CUSTOM] \
[--description DESCRIPTION] \
[--hardware-spec HARDWARE-SPEC | --hardware-spec-id HARDWARE-SPEC-ID] \
--hardware-spec-name HARDWARE-SPEC-NAME \
--hardware-spec-num-nodes HARDWARE-SPEC-NUM-NODES] \
--hardware-spec-rev HARDWARE-SPEC-REV \
--name NAME \
[--online ONLINE | --online-parameters ONLINE-PARAMETERS] \
[--project-id PROJECT-ID] \
[--prompt-template PROMPT-TEMPLATE] | --prompt-template-id PROMPT-TEMPLATE-ID] \
[--space-id SPACE-ID] \
[--tags TAGS]

Options

Table 1: Command options
Option Description
--asset (Rel)

A reference to a deployment. This JSON option can instead be provided by setting individual fields with other options. 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 (string)

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
No default.
Valid values
String.
--asset-rev (string)

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.
Valid values
String.
--base-model-id (string)

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.
Valid values
String.
--custom (generic map)

User-defined properties that are specified as key-value pairs.

Status
Optional.
Syntax
--custom=<generic-map>
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, --custom=@path/to/file.json.

--description (string)

A description of the deployment.

Status
Optional.
Syntax
--description <DESCRIPTION>
Default value
No default.
Valid values
String.
--hardware-spec (HardwareSpec)

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=<HardwareSpec>
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, --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 (string)

The ID of the hardware specification. One, and only one, of id or name must 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.
Valid values
String.
--hardware-spec-name (string)

The name of the hardware specification. One, and only one, of id or name must 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.
Valid values
String.
--hardware-spec-num-nodes (int64)

The number of nodes that are applied to a computation. 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.
Valid values
Int64.
--hardware-spec-rev (string)

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.
Valid values
String.
--name (string)

The name of the deployment.

Status
Required.
Syntax
--name <deployment-name>
Default value
No default.
Valid values
A valid deployment name.
--online (OnlineDeployment)

Indicates that this deployment is an online deployment. An object must be specified but can be empty.

The serving_name can be provided in the online.parameters. This JSON option can instead be provided by setting individual fields with other options. It is mutually exclusive with those options.

Status
Optional.
Syntax
--online <OnlineDeployment>

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.

Default value
No default.
Valid values
A valid deployment name.
The following example shows the format of the OnlineDeployment object.
{
  "parameters" : {
    "serving_name" : "churn"
  }
}
--online-parameters (OnlineDeploymentParameters)

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=<OnlineDeploymentParameters>
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, --online-parameters=@path/to/file.json.

--project-id (string)

The project that contains the deployment. Either space_id or project_id must be given.

Status
Optional.
Syntax
--project-id <PROJECT-ID>
Default value
No default.
Valid values

The maximum length is 36 characters. The minimum length is 36 characters. The value must match the regular expression /[a-zA-Z0-9-]*/.

--prompt-template (SimpleRel)

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=<SimpleRel>
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, --prompt-template=@path/to/file.json.

The following example shows the format of the SimpleRel object.
{
  "id" : "4cedab6d-e8e4-4214-b81a-2ddb122db2ab"
}
--prompt-template-id (string)

The ID of the referenced deployment. This 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 <PROMPT-TEMPLATE-ID>
Default value
No default.
Valid values
String.
--space-id (string)

The space that contains the deployment. Either space_id or project_id must be given.

Status
Optional.
Syntax
--space-id <SPACE-ID>
Default value
No default.
Valid values

The maximum length is 36 characters. The minimum length is 36 characters. The value must match the regular expression /[a-zA-Z0-9-]*/.

--tags (string)

A list of tags for this deployment.

Status
Optional.
Syntax
--tags <tag1,tag2,...>
Default value
No default.
Valid values
A valid list of comma-separated data asset tags.

Examples

cpdctl 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:

cpdctl 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