Skip to main content

Hopsworks Model Management

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

HSML is the library to interact with the Hopsworks Model Registry and Model Serving. The library makes it easy to export, manage and deploy 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 and serving handles

import hsml

# Create a connection
connection = hsml.connection()

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

# Get the model serving handle for the current model registry
ms = connection.get_model_serving()

Create a new model

model = mr.tensorflow.create_model(name="mnist",
                                   version=1,
                                   metrics={"accuracy": 0.94},
                                   description="mnist model description")
model.save("/tmp/model_directory") # or /tmp/model_file

Download a model

model = mr.get_model("mnist", version=1)

model_path = model.download()

Delete a model

model.delete()

Get best performing model

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

Deploy a model

deployment = model.deploy()

Start a deployment

deployment.start()

Make predictions with a deployed model

data = { "instances": [ model.input_example ] }

predictions = deployment.predict(data)

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

Documentation

Documentation is available at Hopsworks Model Management Documentation.

Issues

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.

Contributing

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

Release files for hsml 3.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hsml 3.7.2
File Size Uploaded
hsml-3.7.2.tar.gz 62.4 kB Details

Release files / hsml-3.7.2.tar.gz

Download URL hsml-3.7.2.tar.gz
Size 62.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cf9766eeba754737df6efa74621c6b74bf29f3342d312df3ebde1c17662f21ea
BLAKE2b-256 checksum
How to use checksums
a2c5caae4d25b0501df62f004b0d7207748a9624f565867abbca112a02d8cf68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

3.7.2 This release

1 release file

3.7.1

1 release file

3.7.0

1 release file

3.5.1

1 release file

3.4.6

1 release file

3.4.5

1 release file

3.4.4

1 release file

3.4.3

1 release file

3.4.2

1 release file

3.2.1

1 release file

3.2.0

1 release file

3.1.0

1 release file

3.0.3

1 release file

3.0.2

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.5.3

1 release file

2.5.2

1 release file

2.5.1

1 release file

2.5.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page