Skip to content

Hopsworks Model Registry#

Hopsworks Community Hopsworks Model Registry Documentation PyPiStatus Scala/Java Artifacts Downloads CodeStyle License

HSML is the library to interact with the Hopsworks Model Registry. The library makes it easy to export and manage models.

The library automatically configures itself based on the environment it is run. However, to connect from an external Python environment additional connection information, such as host and port, is required. For more information about the setup from external environments, see the setup section.

Getting Started On Hopsworks#

Instantiate a connection and get the project model registry handle

import hsml

# Create a connection
connection = hsml.connection()

# Get the model registry handle for the project's model registry
mr = connection.get_model_registry()

Create a new model

mnist_model_meta = mr.tensorflow.create_model(name="mnist",
                                              metrics={"accuracy": 0.94},
                                              description="mnist model description")"/tmp/model_directory")

Download a model

mnist_model_meta = mr.get_model("name", version=1)

model_path =

Delete a model


Get best performing model

mnist_model_meta = mr.get_best_model('mnist', 'accuracy', 'max')

You can find more examples on how to use the library in


Documentation is available at Hopsworks Model Registry Documentation.


For general questions about the usage of Hopsworks Machine Learning please open a topic on Hopsworks Community.

Please report any issue using Github issue tracking.


If you would like to contribute to this library, please see the Contribution Guidelines.