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
| 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.
|
--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.
|
--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.
|
--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.
|
--custom |
Specify user-defined properties as
key-value pairs.
|
--description |
A description of the
deployment.
|
--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.
|
--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.
|
--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.
|
--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.
|
--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.
|
--name |
Specify the name of the
deployment.
|
--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'.
|
--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.
|
--project-id
|
The project that contains
the deployment. Either space_id or project_id must be
given.
|
--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.
|
--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.
|
--space-id |
The space that contains the
deployment. Either space_id or project_id must be given.
|
--tags |
A list of tags for this
deployment.
|
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