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:
- Download and obtain the
dlimcommand 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 - Add dlim to PATH, for
example:
where /usr/local/bin/dlim is the location of the dlim tool.PATH=$PATH:/usr/local/bin/dlim - Configure
dlim.
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_routedlim config -c https://cpd-cpd-instance.apps.ibm.comNote: If you are running dlim in a Watson Studio notebook, dlim cannot be configured. - To run dlim commands, use a prefetched JWT token directly.
- To obtain a prefetched token, create a local user that contains your Cloud Pak for Data username
and API, for example:
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.dlim config -t -u username -k apikey - Run the
command:
dlim model list --jwt-token $USER_ACCESS_TOKEN --rest-server cpd_route
- To obtain a prefetched token, create a local user that contains your Cloud Pak for Data username
and API, for example:
- To see what subcommands are available with the dlim command, run the
dlim --helpcommand: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 apikeyThe 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 listReturn the inference service
token:
dlim config -t -u username -k apikey