Coding and deploying AI services with Cloud Pak for Data Command-Line Interface (CPDCTL)
Last updated: Feb 21, 2025
Coding and deploying AI services with Cloud Pak for Data Command-Line Interface (CPDCTL)
CPDCTL is a command-line tool for deploying and managing AI services on the IBM Cloud Pak for Data (CPD) platform. It provides a simple and streamlined way to deploy AI services, eliminating the need for manual configuration and reducing the risk
of errors. You can use the Cloud Pak for Data (CPDCTL) command-line interface to deploy your generative AI solutions that use AI services programmatically.
Process overview
Copy link to section
The process of deploying an AI service with CPDCTL involves preparing the environment by installing CPDCTL and configuring environment variables, creating an AI service instance, uploading the code for the AI service, and deploying the AI service
to make it available for use. The deployment process is initiated by running a series of CPDCTL commands, including creating an AI service instance, uploading the code, and deploying the AI service. The deployed AI service can then be accessed
through a REST API endpoint, enabling real-time predictions and decision-making. Throughout the process, CPDCTL provides a simple and efficient way to deploy, manage, and scale AI services.
Prerequisites
Copy link to section
Before deploying AI services with CPDCTL, you must meet the following prerequisites:
Save the URL found in the response responsible for accessing the generate_stream method as URL_STREAM.
Providing custom parameters object
Copy link to section
When creating a deployment, you can provide a custom parameters object by using the --custom flag. This flag accepts a JSON object with the key-value pairs.
For example, if you want to provide the following custom object:
Alternatively, you can prepare a JSON file with the custom parameters and pass the path to this file using the --custom flag with the @ symbol. For example:
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer $IAM_TOKEN" \
-d "{\"space_id\": \"$SPACE_ID\", \"url\": \"$WML_URL\", \"question\": \"What is the total sum of the numbers 11, 13, and 20? Remember to always return the final result using the last tool message.\"}" \
$URL_STREAM
About cookies on this siteOur websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising.For more information, please review your cookie preferences options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.