Create a model using the CLI

Provides steps to create a model using the CLI.

  1. Open a terminal window and log into cdswctl.
  2. Obtain the engine image ID as described in the following steps:
    1. Run the following command:
      cdswctl projects list
      The project ID, your username, and the project name are displayed. For example:
      1: john-smith/petal-length-predictor
    2. Note the project ID, which is a number in front of your project name.
      In this case, it is "1".
  3. Run the following command while specifying the project name and note the engine image ID:
    cdswctl engine-images list -p <project-name>
    For example,
    cdswctl engine-images list -p john-smith/petal-length-predictor
  4. Create a model by using the following command:
    cdswctl models create 
    --kernel="python3" 
    --targetFilePath="predict.py" 
    --targetFunctionName="predict" 
    --name="Petal Length Predictor" 
    --cpuMillicores=1000 
    --memoryMb=2000 
    --description="Model of the Iris dataset" 
    --replicationType=fixed 
    --numReplicas=1 
    --visibility="private" 
    --autoBuildModel 
    --autoDeployModel 
    --projectId=<project ID> 
    --examples='{"request":{"petal_length":1}}'  
    --engineImageId=<engine image ID from before>
    If the command runs successfully, the system displays the model details in a JSON format.
    For more information about the models create command parameters, run the following command:
    cdswctl models create --help