Creating a Model Endpoint using API
You can select a specific Cloudera AI Inference service instance and a model version from Cloudera Model Registry to create a new model endpoint.
-
Retrieve a registered model's model ID and model
version.
This information is available in the Registered Models page in the CML control plane UI.
-
Create the model specification for the selected model.
# cat ./examples/mlflow/model-spec-cml-registry.json { "namespace": "serving-default", "name": "mlflow-wine-test-from-registry-onnx", "source": { "registry_source": { "version": 2, "model_id": "3azn-tmqe-wsze-5u4s" } } }
export DOMAIN=$(cdp ml describe-ml-serving-app --app-crn [***app-crn***] | jq -r '.app.cluster.domainName')
-
Create the model endpoint by using the following Cloudera Machine Learning serving
deployEndpoint API:
curl -v -H "Content-Type: application/json" -H "Authorization: Bearer ${CDP_TOKEN}" "https://${DOMAIN}/api/v1alpha1/deployEndpoint" -d @./examples/mlflow/model-spec-cml-registry.json
The
DOMAIN
looks likeml-67814ad5-b79.eng-ml-d.xcu2-8y8x.dev.cldr.work
.You can retrieve the
CDP_TOKEN
by performing the steps from Preparing to interact with the Cloudera AI.