{"id":19643746,"url":"https://github.com/logicalclocks/machine-learning-api","last_synced_at":"2025-04-09T18:17:07.244Z","repository":{"id":37092354,"uuid":"406025777","full_name":"logicalclocks/machine-learning-api","owner":"logicalclocks","description":"Hopsworks Machine Learning Api 🚀 Model management with a model registry and model serving","archived":false,"fork":false,"pushed_at":"2024-11-12T10:50:06.000Z","size":5416,"stargazers_count":8,"open_issues_count":17,"forks_count":20,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-09T18:17:01.991Z","etag":null,"topics":["model-registry","model-serving"],"latest_commit_sha":null,"homepage":"https://docs.hopsworks.ai/machine-learning-api/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logicalclocks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-13T15:22:52.000Z","updated_at":"2024-07-05T14:11:54.000Z","dependencies_parsed_at":"2023-11-09T12:26:17.958Z","dependency_job_id":"f197e189-ed93-4893-9524-1607a74fd8fa","html_url":"https://github.com/logicalclocks/machine-learning-api","commit_stats":{"total_commits":91,"total_committers":6,"mean_commits":"15.166666666666666","dds":0.4505494505494505,"last_synced_commit":"cf68efdedfd748b5aacd074d3ba7d84f23511d25"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicalclocks%2Fmachine-learning-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicalclocks%2Fmachine-learning-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicalclocks%2Fmachine-learning-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicalclocks%2Fmachine-learning-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logicalclocks","download_url":"https://codeload.github.com/logicalclocks/machine-learning-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085322,"owners_count":21045139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["model-registry","model-serving"],"created_at":"2024-11-11T14:23:42.516Z","updated_at":"2025-04-09T18:17:07.222Z","avatar_url":"https://github.com/logicalclocks.png","language":"Python","readme":"# Hopsworks Model Management\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://community.hopsworks.ai\"\u003e\u003cimg\n    src=\"https://img.shields.io/discourse/users?label=Hopsworks%20Community\u0026server=https%3A%2F%2Fcommunity.hopsworks.ai\"\n    alt=\"Hopsworks Community\"\n  /\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.hopsworks.ai\"\u003e\u003cimg\n    src=\"https://img.shields.io/badge/docs-HSML-orange\"\n    alt=\"Hopsworks Model Management Documentation\"\n  /\u003e\u003c/a\u003e\n  \u003ca\u003e\u003cimg\n    src=\"https://img.shields.io/badge/python-3.8+-blue\"\n    alt=\"python\"\n  /\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/hsml/\"\u003e\u003cimg\n    src=\"https://img.shields.io/pypi/v/hsml?color=blue\"\n    alt=\"PyPiStatus\"\n  /\u003e\u003c/a\u003e\n  \u003ca href=\"https://archiva.hops.works/#artifact/com.logicalclocks/hsml\"\u003e\u003cimg\n    src=\"https://img.shields.io/badge/java-HSML-green\"\n    alt=\"Scala/Java Artifacts\"\n  /\u003e\u003c/a\u003e\n  \u003ca href=\"https://pepy.tech/project/hsml/month\"\u003e\u003cimg\n    src=\"https://pepy.tech/badge/hsml/month\"\n    alt=\"Downloads\"\n  /\u003e\u003c/a\u003e\n  \u003ca href=https://github.com/astral-sh/ruff\u003e\u003cimg\n    src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\"\n    alt=\"Ruff\"\n  /\u003e\u003c/a\u003e\n  \u003ca\u003e\u003cimg\n    src=\"https://img.shields.io/pypi/l/hsml?color=green\"\n    alt=\"License\"\n  /\u003e\u003c/a\u003e\n\u003c/p\u003e\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\nHowever, to connect from an external Python environment additional connection information, such as host and port, is required.\n\n## Getting Started On Hopsworks\n\nGet started easily by registering an account on [Hopsworks Serverless](https://app.hopsworks.ai/). Create your project and a [new Api key](https://docs.hopsworks.ai/latest/user_guides/projects/api_key/create_api_key/). In a new python environment with Python 3.8 or higher, install the [client library](https://docs.hopsworks.ai/latest/user_guides/client_installation/) using pip:\n\n```bash\n# Get all Hopsworks SDKs: Feature Store, Model Serving and Platform SDK\npip install hopsworks\n# or just the Model Registry and Model Serving SDK\npip install hsml\n```\n\nYou can start a notebook and instantiate a connection and get the project feature store handler.\n\n```python\nimport hopsworks\n\nproject = hopsworks.login() # you will be prompted for your api key\n\nmr = project.get_model_registry()\n# or\nms = project.get_model_serving()\n```\n\nor using `hsml` directly:\n\n```python\nimport hsml\n\nconnection = hsml.connection(\n    host=\"c.app.hopsworks.ai\", #\n    project=\"your-project\",\n    api_key_value=\"your-api-key\",\n)\n\nmr = connection.get_model_registry()\n# or\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\n# Tutorials\n\nYou can find more examples on how to use the library in our [tutorials](https://github.com/logicalclocks/hopsworks-tutorials).\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).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogicalclocks%2Fmachine-learning-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogicalclocks%2Fmachine-learning-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogicalclocks%2Fmachine-learning-api/lists"}