hsml


Namehsml JSON
Version 3.7.1 PyPI version JSON
download
home_pagehttps://github.com/logicalclocks/machine-learning-api
SummaryHSML: An environment independent client to interact with the Hopsworks Model Registry
upload_time2024-04-29 09:34:00
maintainerNone
docs_urlNone
authorLogical Clocks AB
requires_pythonNone
licenseApache License 2.0
keywords hopsworks ml models machine learning models model registry tensorflow pytorch machine learning mlops dataops
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Hopsworks Model Management

<p align="center">
  <a href="https://community.hopsworks.ai"><img
    src="https://img.shields.io/discourse/users?label=Hopsworks%20Community&server=https%3A%2F%2Fcommunity.hopsworks.ai"
    alt="Hopsworks Community"
  /></a>
    <a href="https://docs.hopsworks.ai"><img
    src="https://img.shields.io/badge/docs-HSML-orange"
    alt="Hopsworks Model Management Documentation"
  /></a>
  <a href="https://pypi.org/project/hsml/"><img
    src="https://img.shields.io/pypi/v/hsml?color=blue"
    alt="PyPiStatus"
  /></a>
  <a href="https://archiva.hops.works/#artifact/com.logicalclocks/hsml"><img
    src="https://img.shields.io/badge/java-HSML-green"
    alt="Scala/Java Artifacts"
  /></a>
  <a href="https://pepy.tech/project/hsml/month"><img
    src="https://pepy.tech/badge/hsml/month"
    alt="Downloads"
  /></a>
  <a href="https://github.com/psf/black"><img
    src="https://img.shields.io/badge/code%20style-black-000000.svg"
    alt="CodeStyle"
  /></a>
  <a><img
    src="https://img.shields.io/pypi/l/hsml?color=green"
    alt="License"
  /></a>
</p>

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
```python
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
```python
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
```python
model = mr.get_model("mnist", version=1)

model_path = model.download()
```

Delete a model
```python
model.delete()
```

Get best performing model
```python
best_model = mr.get_best_model('mnist', 'accuracy', 'max')

```

Deploy a model
```python
deployment = model.deploy()
```

Start a deployment
```python
deployment.start()
```

Make predictions with a deployed model
```python
data = { "instances": [ model.input_example ] }

predictions = deployment.predict(data)
```

You can find more examples on how to use the library in [examples.hopsworks.ai](https://examples.hopsworks.ai).

## Documentation

Documentation is available at [Hopsworks Model Management Documentation](https://docs.hopsworks.ai/).

## Issues

For general questions about the usage of Hopsworks Machine Learning please open a topic on [Hopsworks Community](https://community.hopsworks.ai/).
Please report any issue using [Github issue tracking](https://github.com/logicalclocks/machine-learning-api/issues).


## Contributing

If you would like to contribute to this library, please see the [Contribution Guidelines](CONTRIBUTING.md).
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/logicalclocks/machine-learning-api",
    "name": "hsml",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "Hopsworks, ML, Models, Machine Learning Models, Model Registry, TensorFlow, PyTorch, Machine Learning, MLOps, DataOps",
    "author": "Logical Clocks AB",
    "author_email": "robin@logicalclocks.com",
    "download_url": "https://files.pythonhosted.org/packages/39/de/4cf716fde00f649606e27fe5d0c3ff78543c295b1c40834ada12914d70f0/hsml-3.7.1.tar.gz",
    "platform": null,
    "description": "# Hopsworks Model Management\n\n<p align=\"center\">\n  <a href=\"https://community.hopsworks.ai\"><img\n    src=\"https://img.shields.io/discourse/users?label=Hopsworks%20Community&server=https%3A%2F%2Fcommunity.hopsworks.ai\"\n    alt=\"Hopsworks Community\"\n  /></a>\n    <a href=\"https://docs.hopsworks.ai\"><img\n    src=\"https://img.shields.io/badge/docs-HSML-orange\"\n    alt=\"Hopsworks Model Management Documentation\"\n  /></a>\n  <a href=\"https://pypi.org/project/hsml/\"><img\n    src=\"https://img.shields.io/pypi/v/hsml?color=blue\"\n    alt=\"PyPiStatus\"\n  /></a>\n  <a href=\"https://archiva.hops.works/#artifact/com.logicalclocks/hsml\"><img\n    src=\"https://img.shields.io/badge/java-HSML-green\"\n    alt=\"Scala/Java Artifacts\"\n  /></a>\n  <a href=\"https://pepy.tech/project/hsml/month\"><img\n    src=\"https://pepy.tech/badge/hsml/month\"\n    alt=\"Downloads\"\n  /></a>\n  <a href=\"https://github.com/psf/black\"><img\n    src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\n    alt=\"CodeStyle\"\n  /></a>\n  <a><img\n    src=\"https://img.shields.io/pypi/l/hsml?color=green\"\n    alt=\"License\"\n  /></a>\n</p>\n\nHSML is the library to interact with the Hopsworks Model Registry and Model Serving. The library makes it easy to export, manage and deploy models.\n\nThe library automatically configures itself based on the environment it is run.\nHowever, 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.\n\n## Getting Started On Hopsworks\n\nInstantiate a connection and get the project model registry and serving handles\n```python\nimport hsml\n\n# Create a connection\nconnection = hsml.connection()\n\n# Get the model registry handle for the project's model registry\nmr = connection.get_model_registry()\n\n# Get the model serving handle for the current model registry\nms = connection.get_model_serving()\n```\n\nCreate a new model\n```python\nmodel = mr.tensorflow.create_model(name=\"mnist\",\n                                   version=1,\n                                   metrics={\"accuracy\": 0.94},\n                                   description=\"mnist model description\")\nmodel.save(\"/tmp/model_directory\") # or /tmp/model_file\n```\n\nDownload a model\n```python\nmodel = mr.get_model(\"mnist\", version=1)\n\nmodel_path = model.download()\n```\n\nDelete a model\n```python\nmodel.delete()\n```\n\nGet best performing model\n```python\nbest_model = mr.get_best_model('mnist', 'accuracy', 'max')\n\n```\n\nDeploy a model\n```python\ndeployment = model.deploy()\n```\n\nStart a deployment\n```python\ndeployment.start()\n```\n\nMake predictions with a deployed model\n```python\ndata = { \"instances\": [ model.input_example ] }\n\npredictions = deployment.predict(data)\n```\n\nYou can find more examples on how to use the library in [examples.hopsworks.ai](https://examples.hopsworks.ai).\n\n## Documentation\n\nDocumentation is available at [Hopsworks Model Management Documentation](https://docs.hopsworks.ai/).\n\n## Issues\n\nFor general questions about the usage of Hopsworks Machine Learning please open a topic on [Hopsworks Community](https://community.hopsworks.ai/).\nPlease report any issue using [Github issue tracking](https://github.com/logicalclocks/machine-learning-api/issues).\n\n\n## Contributing\n\nIf you would like to contribute to this library, please see the [Contribution Guidelines](CONTRIBUTING.md).",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "HSML: An environment independent client to interact with the Hopsworks Model Registry",
    "version": "3.7.1",
    "project_urls": {
        "Download": "https://github.com/logicalclocks/machine-learning-api/releases/tag/3.7.1",
        "Homepage": "https://github.com/logicalclocks/machine-learning-api"
    },
    "split_keywords": [
        "hopsworks",
        " ml",
        " models",
        " machine learning models",
        " model registry",
        " tensorflow",
        " pytorch",
        " machine learning",
        " mlops",
        " dataops"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39de4cf716fde00f649606e27fe5d0c3ff78543c295b1c40834ada12914d70f0",
                "md5": "4fba695add451b0bb22a0232c524aac4",
                "sha256": "a1abee7a61752955b79f9130075f142d33221e5ab4658f2122d42e40a639e1d9"
            },
            "downloads": -1,
            "filename": "hsml-3.7.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4fba695add451b0bb22a0232c524aac4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 59065,
            "upload_time": "2024-04-29T09:34:00",
            "upload_time_iso_8601": "2024-04-29T09:34:00.815138Z",
            "url": "https://files.pythonhosted.org/packages/39/de/4cf716fde00f649606e27fe5d0c3ff78543c295b1c40834ada12914d70f0/hsml-3.7.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 09:34:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "logicalclocks",
    "github_project": "machine-learning-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "hsml"
}
        
Elapsed time: 0.50175s