Tutorials#
These tutorials demonstrate how to interact with the Model Registry microservice using curl
commands on a Linux system.
Tutorial 1: Storing a Model in the Registry#
Time to Complete#
10 minutes
Learning Objectives#
By the end of this tutorial, you will:
Know how to store a model using the POST
/models
endpoint.Understand the supported fields for storing a model in the registry.
Prerequisites#
The model registry should be running as per the Get Started Guide.
Step 1: Send a POST request to store a model.#
Use the following curl
command to send a POST request with FormData fields corresponding to the model’s properties.
curl -X POST 'PROTOCOL://HOSTNAME:32002/models' \
--header 'Content-Type: multipart/form-data' \
--form 'name="MODEL_NAME"' \
--form 'file=@MODEL_ARTIFACTS_ZIP_FILE_PATH;type=application/zip' \
--form 'version="MODEL_VERSION"'
Replace
PROTOCOL
withhttps
if HTTPS mode is enabled. Otherwise, usehttp
.If HTTPS mode is enabled, and you are using self-signed certificates, add the
-k
option to yourcurl
command to ignore SSL certificate verification.
Replace
HOSTNAME
with the actual host name or IP address of the host system where the service is running.Replace
MODEL_NAME
with the name of the model to be stored.Replace
MODEL_ARTIFACTS_ZIP_FILE_PATH
with the file path to the zip file containing the model’s artifacts.Replace
MODEL_VERSION
with the version of the model to be stored.
For the complete list of supported model properties, visit PROTOCOL://HOSTNAME:32002/docs
.
Step 2: Parse the response.#
The response will include the ID of the newly stored model.
Tutorial 2: Fetching a List of Models in the Registry#
Time to Complete#
10 minutes
Learning Objectives#
By the end of this tutorial, you will:
Know how to get the metadata for 1 or more registered models using the GET
/models
endpoint.Know how to filter the list of models.
Prerequisites#
The model registry should be running as per the Get Started Guide.
Step 1: Send a GET request to retrieve a list of models.#
Use the following curl
command to send a GET request to the /models
endpoint.
curl -X GET 'PROTOCOL://HOSTNAME:32002/models'
Replace
PROTOCOL
withhttps
if HTTPS mode is enabled. Otherwise, usehttp
.If HTTPS mode is enabled, and you are using self-signed certificates, add the
-k
option to yourcurl
command to ignore SSL certificate verification.
Replace
HOSTNAME
with the actual host name or IP address of the host system where the service is running.
Step 2: Include query parameters (optional).#
If you want to filter the list, you can include query parameters in the URL.
For example, to filter by project_name
:
curl -X GET 'PROTOCOL://HOSTNAME:32002/models?project_name=PROJECT_NAME'
Replace
PROJECT_NAME
with the project_name associated to a model stored in the registry.
For the complete list of supported query parameters, visit PROTOCOL://HOSTNAME:32002/docs
.
Step 3: Parse the response.#
The response will be a list containing the metadata of models stored in the registry.
Tutorial 3: Get a model in the Registry#
Time to Complete#
10 minutes
Learning Objectives#
By the end of this tutorial, you will:
know how to get a model in the model registry.
Prerequisites#
The model registry should be running as per the Get Started Guide.
Step 1: Send a GET request to get a model.#
Use the following curl
command to send a GET request to the /models/MODEL_ID
endpoint.
curl -L -X GET 'PROTOCOL://HOSTNAME:32002/models/MODEL_ID'
Replace
PROTOCOL
withhttps
if HTTPS mode is enabled. Otherwise, usehttp
.If HTTPS mode is enabled, and you are using self-signed certificates, add the
-k
option to yourcurl
command to ignore SSL certificate verification.
Replace
HOSTNAME
with the actual host name or IP address of the host system where the service is running.Replace
MODEL_ID
with theid
of the desired model.
Step 2: Parse the response.#
The response will have a 200 OK
status code and the metadata for a model.
Tutorial 4: Updating 1 or more properties for a specific model in the Registry#
Time to Complete#
10 minutes
Learning Objectives#
By the end of this tutorial, you will:
know how to update 1 or more properties for a model in the model registry.
Prerequisites#
The model registry should be running as per the Get Started Guide.
Step 1: Send a PUT request to update properties of a model.#
Use the following curl
command to send a PUT request to the /models
endpoint.
curl -L -X PUT 'PROTOCOL://HOSTNAME:32002/models/MODEL_ID' \
--form 'score="NEW_MODEL_SCORE"' \
--form 'format="NEW_MODEL_FORMAT"'
Replace
PROTOCOL
withhttps
if HTTPS mode is enabled. Otherwise, usehttp
.If HTTPS mode is enabled, and you are using self-signed certificates, add the
-k
option to yourcurl
command to ignore SSL certificate verification.
Replace
HOSTNAME
with the actual host name or IP address of the host system where the service is running.Replace
MODEL_ID
with theid
of the desired model.Replace
NEW_MODEL_SCORE
, andNEW_MODEL_FORMAT
with the desired new values to be stored.
For the complete list of supported query parameters, visit PROTOCOL://HOSTNAME:32002/docs
.
Parse the response.#
The response will be a JSON object containing a status of the operation and a message.
Tutorial 5: Downloading files for a specific model in the Registry#
Time to Complete#
10 minutes
Learning Objectives#
By the end of this tutorial, you will:
know how to download files for a model in the model registry.
Prerequisites#
The model registry should be running as per the Get Started Guide.
Step 1: Send a GET request to download files associated with a model in the Registry.#
Use the following curl
command to send a GET request to the /models/MODEL_ID/files
endpoint.
curl -X GET 'PROTOCOL://HOSTNAME:32002/models/MODEL_ID/files'
Replace
PROTOCOL
withhttps
if HTTPS mode is enabled. Otherwise, usehttp
.If HTTPS mode is enabled, and you are using self-signed certificates, add the
-k
option to yourcurl
command to ignore SSL certificate verification.
Replace
HOSTNAME
with the actual host name or IP address of the host system where the service is running.Replace
MODEL_ID
with theid
of the desired model.
Step 2: Parse the Response.#
The response will be a Zip file.
Tutorial 6: Deleting a Model in the Registry#
Time to Complete#
10 minutes
Learning Objectives#
By the end of this tutorial, you will:
know how to delete a model in the model registry.
Prerequisites#
The model registry should be running as per the Get Started Guide.
Step 1: Send a DELETE request to delete a model.#
Use the following curl
command to send a DELETE request to the /models/MODEL_ID
endpoint.
curl -L -X DELETE 'PROTOCOL://HOSTNAME:32002/models/MODEL_ID'
Replace
PROTOCOL
withhttps
if HTTPS mode is enabled. Otherwise, usehttp
.If HTTPS mode is enabled, and you are using self-signed certificates, add the
-k
option to yourcurl
command to ignore SSL certificate verification.
Replace
HOSTNAME
with the actual host name or IP address of the host system where the service is running.Replace
MODEL_ID
with theid
of the desired model.
Step 2: Parse the response.#
The response will have a 200 OK
status code and an empty body.
Summary#
In this tutorial, you learned how to:
Store a New Model in the Registry
Fetch a List of Models in the Registry
Get a model in the Registry
Update 1 or more properties for a specific model in
Download files for a specific model in the Registry
Delete Model in the Registry
Learn More#
Understand the components, services, architecture, and data flow in the Overview.
Understand how to fetch metadata for projects and models as well as download models from a remote Intel Geti server in the Advanced Tutorials.