{"id":28394252,"url":"https://github.com/teachablehub/python-sdk","last_synced_at":"2025-07-07T22:03:44.658Z","repository":{"id":57473724,"uuid":"318494934","full_name":"teachablehub/python-sdk","owner":"teachablehub","description":"Python SDK for the TeachableHub's Machine-Learning Deployment Platform","archived":false,"fork":false,"pushed_at":"2021-08-13T13:20:45.000Z","size":1979,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T05:18:53.941Z","etag":null,"topics":["deployment-automation","machine-learning","machine-learning-library","mlops","sdk-python","serving","teachable","teachablehub"],"latest_commit_sha":null,"homepage":"https://www.teachablehub.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teachablehub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-04T11:25:13.000Z","updated_at":"2022-07-14T03:10:49.000Z","dependencies_parsed_at":"2022-09-26T17:40:58.131Z","dependency_job_id":null,"html_url":"https://github.com/teachablehub/python-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/teachablehub/python-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teachablehub%2Fpython-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teachablehub%2Fpython-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teachablehub%2Fpython-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teachablehub%2Fpython-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teachablehub","download_url":"https://codeload.github.com/teachablehub/python-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teachablehub%2Fpython-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262158630,"owners_count":23267989,"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":["deployment-automation","machine-learning","machine-learning-library","mlops","sdk-python","serving","teachable","teachablehub"],"created_at":"2025-05-31T18:07:50.373Z","updated_at":"2025-07-07T22:03:44.651Z","avatar_url":"https://github.com/teachablehub.png","language":"Python","readme":"# About\n\nDeployment, Prediction, and Management API interactions of TeachableHub Machine-Learning Deployment Platform via Python.\n\n# Usage\n\n## Deploy a model\n\nYou can integrate this SDK in your training logic, Jupyter notebook during experimentation, or your CI/CD system during the production environment. This SDK is also applicable for deploying existing models from your model registry or storage.\n\n```python\nfrom teachablehub.deployments.sklearn import TeachableDeployment\n\n# ... training logic here ...\n\ndeployment = TeachableDeployment(\n    teachable=\"user/teachable\",\n    environment=\"production\",\n    deploy_key=\"your-deploy-key-here\",\n)\n\ndeployment.model(clf)\ndeployment.deploy(\n    summary=\"Automatic deployment from our CI via sklearn-deploy.py\",\n    activate=True\n)\n```\n\n### Other deployment examples\nWe have prepared a couple of simple and advanced examples to show you some standard ways to integrate the TeachableHub platform very easily inside your training process. Also, there are ideas on how you can deploy your already trained and stored models to TeachableHub.\n\nIn the advanced examples, you will find some excellent tips and tricks on sharing knowledge between the training environment and the deployments via the Context API or creating and enforcing Features Schema with Validation to make your Model Serving API more understandable and secure.\n\nTake a look at the examples here:\n\n- [Ludwig example](https://github.com/teachablehub/python-sdk/blob/master/examples/ludwig-train-deploy.py)\n- [Deploy existing model example](https://github.com/teachablehub/python-sdk/blob/master/examples/deploy-existing.py)\n- [Deploy advanced example](https://github.com/teachablehub/python-sdk/blob/master/examples/sklearn-train-deploy-advanced.py)\n- [Sklearn Regression Advanced Example](https://github.com/teachablehub/python-sdk/blob/master/examples/sklearn-train-deploy-regression-advanced.py)\n\n## Make predictions\n\n### Simple ndarray predictions\n\n```python\nfrom teachablehub.clients import TeachableHubPredictAPI\n\nteachable = TeachableHubPredictAPI(\n    teachable=\"user/teachable\",\n    environment=\"production\",\n    serving_key=\"your-serving-key-here\"\n)\n\npredictions = teachable.predict([[0.03, 0.05, -0.002, -0.01, 0.04, 0.01, 0.08, -0.04, 0.005, -0.1]])\nprint(predictions)\n````\n\n### Advanced predictions with Features Validation\n\n```python\nfrom teachablehub.clients import TeachableHubPredictAPI\n\nteachable = TeachableHubPredictAPI(\n    teachable=\"user/teachable\",\n    environment=\"production\",\n    serving_key=\"your-serving-key-here\"\n)\n\nfeatures = {\n    \"age\": 0.03,\n    \"sex\": 0.05,\n    \"bmi\": -0.002,\n    \"bp\": -0.01,\n    \"s1\": 0.04,\n    \"s2\": 0.01,\n    \"s3\": 0.08,\n    \"s4\": -0.04,\n    \"s5\": 0.005,\n    \"s6\": -0.1\n}\n\npredictions = teachable.predict(features, order='desc', limit=10, threshold=0.5)\nprint(predictions)\n````\n\n# Supported Tools \u0026 Frameworks\n\n- [Uber's Luwdig](https://github.com/ludwig-ai/ludwig) - Ludwig is a toolbox on top of TensorFlow that allows to train and evaluate deep learning models without the need to write code.\n- [scikit-learn](https://scikit-learn.org/stable/) - Machine Learning in Python\n- [Google's Teachablemachine](https://teachablemachine.withgoogle.com/) Image Classification\n\n\n# Requirements\n\n- Python 3.7.7+ (probably could work with Python 3.4+ as well.)\n- Create a teachable here: `https://app.teachablehub.com/create`\n- Create a deploy key here: `https://app.teachablehub.com/\u003cuser\u003e/\u003cteachable\u003e/settings/deploy-keys`\n- Create a Serving key here: `https://app.teachablehub.com/\u003cuser\u003e/\u003cteachable\u003e/settings/serving-keys`\n\n# Installation\n\nfrom source\n\n```sh\ngit clone https://github.com/teachablehub/python-sdk.git\ncd python-sdk\npython setup.py install\n```\n\n\nwith pip\n\n```sh\npip install teachablehub\n```\n\n# Contributing\n\nThanks for looking at this section. We're open to any cool ideas, so if you have one and are willing to share - fork the repo, apply changes and open a pull request. :)\n\n# Copyright\n\nCopyright (c) 2021 CloudStrap AD. See LICENSE for further details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteachablehub%2Fpython-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteachablehub%2Fpython-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteachablehub%2Fpython-sdk/lists"}