Download and configure the elastic distributed inference (dlim) command line utility

Use elastic distributed inference from the command line interface using the dlim command line utility.

The dlim command lists the inference services and provides details, creates and removes inference services, starts and stops inference services and lists available runtime environments.

To use the dlim command, you must do the following:
  1. Download and obtain the dlim command line utility for Watson Machine Learning Accelerator from IBM Git at https://github.com/IBM/wmla-assets/.
    curl -sL https://github.com/IBM/wmla-assets/releases/download/v5.0.2/dlim -o ./dlim
  2. Add dlim to PATH, for example:
    PATH=$PATH:/usr/local/bin/dlim
    where /usr/local/bin/dlim is the location of the dlim tool.
  3. Configure dlim.
    dlim config -c https://cpd_route
    where cpd_route is the URL of the Cloud Pak for Data instance that you want to interact with through the command-line interface. For example:
    dlim config -c https://cpd-cpd-instance.apps.ibm.com
    Note: If you are running dlim in a Watson Studio notebook, dlim cannot be configured.
  4. To run dlim commands, use a prefetched JWT token directly.
    1. To obtain a prefetched token, create a local user that contains your Cloud Pak for Data username and API, for example:
      dlim config -t -u username -k apikey
      The API key that you will need for user authentication can be generated from Cloud Pak for Data. Navigate to Profile and settings in the Cloud Pak for Data client and click Generate API key. This API key does not expire. The JWT token does expire, and does need to be recreated after it expires.
    2. Run the command:
      dlim model list --jwt-token $USER_ACCESS_TOKEN --rest-server cpd_route
  5. To see what subcommands are available with the dlim command, run the dlim --help command:
    dlim --help
Note: To run dlim commands, use a prefetched JWT token directly. For example:
dlim model list --jwt-token $USER_ACCESS_TOKEN --rest-server cpd_route

Create a JWT token

To use a prefetched token, create a local user that contains your Cloud Pak for Data username and API, for example:
dlim config -t -u username -k apikey
The API key that you'll need for user authentication can be generated from Cloud Pak for Data. Navigate to Profile and settings in the Cloud Pak for Data client and click Generate API key. This API key does not expire. The JWT token does expire, and does need to be recreated after it expires.

Examples

Log in to see available deployed models:
PATH=$PATH:/usr/local/bin/dlim
dlim config -c https://cpd-cpd-instance.apps.ibm.com
dlim config -t -u username -k apikey
dlim model list
Return the inference service token:
dlim config -t -u username -k apikey