Registering a Mistral model

Register the model using the Cloudera AI Registry API. During registration, Cloudera AI Registry copies the files from the remote object storage location into its internal storage.

Before you register the model, collect the following values:
  • name: The registry model name, for example mistral/medium-3.5. Cloudera AI Gateway and Inference selects the runtime by this name, so a model with a different name cannot be deployed. The name can have a maximum of 50 characters.

  • repo_id: The repository ID.

  • remote_object_storage_path: Use the path returned by GET /api/v3/config exactly as provided. If the value differs, the request fails with HTTP 400.

  1. Register the model.

    The following example registers the mistral-medium-3-5-0 model.

    curl -X POST https://<registry-host>/api/v3/models \
      --header "Cookie: hadoop-jwt=$HADOOP_JWT" \
      -H "Content-Type: application/json" \
      -d '{"name": "mistral/medium-3.5",
           "create_model_version_request_payload": {
             "metadata": {"model_repo_type": "MISTRAL"},
             "download_model_repo_request": {
               "source": "REMOTE",
               "repo_id": "mistral-medium-3-5-0",
               "remote_object_storage_path": "<remote_object_storage_path>"}}}'
    
  2. In the response, note the Model ID from the id field.
  3. Check the status of the import.
    curl --header "Cookie: hadoop-jwt=$HADOOP_JWT" https://<registry-host>/api/v3/models/<model ID>/versions/1

    The status field progresses from REGISTERING to UPLOADING, and finally to READY. Importing large models can take considerable time. Once the status is READY, the model is available for deployment.

  4. Optional: Delete the uploaded files after the status changes to READY.

    Once the status is READY, Cloudera AI Registry has its own copy of the model. You can delete the files in <remote_object_storage_path>/mistral/<repository ID>/ and the local ./models directory.