{ "info": { "author": "Fitle", "author_email": "nerds@fitle.com", "bugtrack_url": null, "classifiers": [], "description": "# scikit-deploy\n\nDeploy models trained with scikit-learn with Docker.\n\n## Requirements\n\nYou will need python 3 and Docker installed on your system.\nYou can deploy any model trained with scikit-learn, or which implements the same `predict()` method as scikit-learn models (eg. xgboost).\n\n## Installing\n\n`pip install scikit-deploy`\n\n## Configuration\n\nFirst, you will need a model trained using scikit-learn 0.20 (should support all versions later on) which has been pickled.\n\nYou will also need a `configuration.json` file describing the model metadata and build information.\nIt takes the following form:\n\n```\n{\n \"image_tag\": \"{{the tag given to the generated docker image}}\",\n \"endpoints\": [\"{{the endpoints to call for scoring}}\"],\n}\n```\n\nEndpoints have the following format:\n\n```\n{\n \"route\": \"{{the HTTP route to call for scoring}}\",\n \"model_path\": \"{{model absolute path}}\",\n \"inputs\": [{{the input features, objects with \"name\" and optional fields \"default\", \"offset\" and \"scaling\" }}],\n \"outputs\": [{{the output targets, objects with \"name\" and optional fields \"offset\" and \"scaling\"}}]\n}\n```\n\nFor inputs, the offset will be substracted to the value and then the difference will be divided by the scaling. For outputs, the offset will be added to the value and the sum will be multiplied by the scaling.\nOffset and scaling values are typically used to normalize and denormalize the inputs and outputs respectively.\n\nHere is an example config file :\n\n```\n{\n \"image_tag\": \"my_super_model:latest\",\n \"endpoints\": [\n {\n \"route\": \"/super-score\",\n \"model_path\": \"/home/toto/model.pkl\",\n \"inputs\": [{\"name\": \"x\"}, {\"name\": \"y\", \"default\": 1.551, \"offset\": 50, \"scaling\": 2}],\n \"outputs\": [{\"name\": \"z\", \"offset\": 3, \"scaling\": 1.4}]\n }\n ],\n\n}\n```\n\n## Building your image\n\nRun the following command:\n\n`skdeploy -c /path/to/config.json`\n\nThis will run a Docker build using the image name you have provided.\n\nIf your models require extra dependencies, you can specify an additional `requirements.txt` file to include\nfor your server with the `-r`flag:\n\n`skdeploy -c /path/to/config -r /path/to/requirements.txt`\n\nIf you need to specify a SSH private key in case your requirements are part of a private repository, use the `-k` flag:\n\n`skdeploy -c /path/to/config -r /path/to/requirements.txt -k \"$(cat /path/to/private_key)\"`\n\n\n## Running and testing the server\n\nThe server running inside the Docker container listens on port 5000.\nTo test your server on local port 8080 for example, run it using docker:\n\n`docker run -p 8080:5000 your_image_tag`\n\nAnd you can start querying the server ; for the config file above, this would be done as :\n\n`GET localhost:8080/super-score?x=1337&y=115.16`\n\nWhich would yield the json\n\n```\n{\n \"prediction\": {\n \"z\": 11525\n }\n}\n```\n\nYou can also send a `POST` request to the endpoint. In this case, the body must be a JSON array of the inputs. Using the `POST` method, you can ask the server for several predictions in one request. For example:\n\n```\n[\n {\"x\": 1337, \"y\": 115.16},\n {\"x\": 2664, \"y\": 98.3},\n]\n```\n\nWhich would yield\n\n```\n{\n [\n {\"prediction\": {\"z\": 11525}},\n {\"prediction\": {\"z\": 3457}}\n ]\n}\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fitle-dev/scikit-deploy", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "scikit-deploy", "package_url": "https://pypi.org/project/scikit-deploy/", "platform": "", "project_url": "https://pypi.org/project/scikit-deploy/", "project_urls": { "Homepage": "https://github.com/fitle-dev/scikit-deploy" }, "release_url": "https://pypi.org/project/scikit-deploy/2.1.3/", "requires_dist": null, "requires_python": "", "summary": "Scikit-learn model REST API deployment with docker", "version": "2.1.3" }, "last_serial": 5607881, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "a32c15a174921fc570cafd2ad5973a08", "sha256": "70a35751debb517e85fafd3c4b614d43c217ea5bcec4869e1295bec9077f6d4e" }, "downloads": -1, "filename": "scikit_deploy-1.1-py3.6.egg", "has_sig": false, "md5_digest": "a32c15a174921fc570cafd2ad5973a08", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 786057, "upload_time": "2018-10-25T15:57:35", "url": "https://files.pythonhosted.org/packages/6f/9d/836e75d3acf826bf414173524d3468368b8d2a4726b92fa7cf3ef9fa5a60/scikit_deploy-1.1-py3.6.egg" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "412fdb7e19524f967234e0b6d3e3c06c", "sha256": "6c65fedaa104288492cbcd1846f4326a525cfff6d662fd7aee59a3a377c5aa9b" }, "downloads": -1, "filename": "scikit_deploy-1.2-py3.6.egg", "has_sig": false, "md5_digest": "412fdb7e19524f967234e0b6d3e3c06c", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 786057, "upload_time": "2018-10-25T15:57:37", "url": "https://files.pythonhosted.org/packages/d0/be/801efbfa74bef96dc9280c0f2479e061ab026e9aaa8d0b45c0212e29715f/scikit_deploy-1.2-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "1f28c7ede257be4d4247b058dc289cfe", "sha256": "a06e0d1350b0eda222b573bf4faafa2afc165fd2672beba19a46aa083fcb5829" }, "downloads": -1, "filename": "scikit_deploy-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "1f28c7ede257be4d4247b058dc289cfe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 785755, "upload_time": "2018-10-25T15:57:31", "url": "https://files.pythonhosted.org/packages/79/46/62d3f6656a5b5dab27766000f41f7f23de2e9bbf8b2abdb9f56a452b703f/scikit_deploy-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2793f64cc19ade4668e81d77ad01edda", "sha256": "7f6dbc88b3af76afdbfd888748d708a2012615f41a40ed086db66206494ee927" }, "downloads": -1, "filename": "scikit-deploy-1.2.tar.gz", "has_sig": false, "md5_digest": "2793f64cc19ade4668e81d77ad01edda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 779516, "upload_time": "2018-10-25T15:57:33", "url": "https://files.pythonhosted.org/packages/50/d1/f6719fc6a393998d1c24e1ae998a499a6fb1faa92792ad5af0aa69c343b1/scikit-deploy-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "0ae9d84628dc53d546c3d19aded8738e", "sha256": "aaaa0dd6fb01df1e5eac4b5360c303ed61c95524be2e0a8f6109876b6268e989" }, "downloads": -1, "filename": "scikit-deploy-1.3.tar.gz", "has_sig": false, "md5_digest": "0ae9d84628dc53d546c3d19aded8738e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 780299, "upload_time": "2018-11-13T09:12:34", "url": "https://files.pythonhosted.org/packages/9c/9f/5f8d70bb74556e40f7ffcc7843a5403159400fe76595d7463dd6417d16b6/scikit-deploy-1.3.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "27be66b9eb74686304abf9e19cbdc7a2", "sha256": "fc352d8f8abfd516d120bc07029400e70e16be15540e16ecd8c5ca1f1bd75e21" }, "downloads": -1, "filename": "scikit-deploy-1.3.1.tar.gz", "has_sig": false, "md5_digest": "27be66b9eb74686304abf9e19cbdc7a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 780613, "upload_time": "2018-11-13T09:21:41", "url": "https://files.pythonhosted.org/packages/72/02/f40b8cd705ff0dc283021189560821450489d64e8f0e71f8fa03f7c8e6b2/scikit-deploy-1.3.1.tar.gz" } ], "1.3.2": [ { "comment_text": "", "digests": { "md5": "d39ace597a68c6a51b99056beaa59cde", "sha256": "218a5489322b877ab84abede99102e7fd663c8d56e8f4dac1a619dd10d4af228" }, "downloads": -1, "filename": "scikit-deploy-1.3.2.tar.gz", "has_sig": false, "md5_digest": "d39ace597a68c6a51b99056beaa59cde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 780292, "upload_time": "2018-11-13T09:29:07", "url": "https://files.pythonhosted.org/packages/5d/df/212d0b8f1aec77d47315bf1ead74366aef50f12467661b68da30c4245ca8/scikit-deploy-1.3.2.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "36d7978e5d0f63d72d4a3a7740a3d94c", "sha256": "c838a5629160f37687abf896a7f3ad671742e0a96d5b1ec788858d0bd1dda67d" }, "downloads": -1, "filename": "scikit-deploy-2.0.0.tar.gz", "has_sig": false, "md5_digest": "36d7978e5d0f63d72d4a3a7740a3d94c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 780973, "upload_time": "2018-12-10T09:21:11", "url": "https://files.pythonhosted.org/packages/be/9c/6b73ff53321360f852edd9f3638c0561ed64df079397826a4e8510d69541/scikit-deploy-2.0.0.tar.gz" } ], "2.1.2": [ { "comment_text": "", "digests": { "md5": "a4fa45ebc3d7e38fbe62d87c1aaf3467", "sha256": "c27e5c19b43e4644e80cc4524a63cebf2d3f77ae18b8d0624fae586314931e8f" }, "downloads": -1, "filename": "scikit_deploy-2.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a4fa45ebc3d7e38fbe62d87c1aaf3467", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 788498, "upload_time": "2019-07-29T14:54:55", "url": "https://files.pythonhosted.org/packages/aa/38/e5a2de3b84da2b19461ea20ac287cdc61e9f3af3860ba38d797110ef0899/scikit_deploy-2.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df3828da0b8c209c48f7d606de93f82d", "sha256": "8714e8996880f3ef6f6c43887a5af7ec933ebbb128bad23d51a7d0cd1e0f9bcd" }, "downloads": -1, "filename": "scikit-deploy-2.1.2.tar.gz", "has_sig": false, "md5_digest": "df3828da0b8c209c48f7d606de93f82d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 781836, "upload_time": "2019-07-29T14:54:56", "url": "https://files.pythonhosted.org/packages/0a/df/69f4354a037828b876a5f84660296ac9bb27a2d73cfe6c05b71d889e8447/scikit-deploy-2.1.2.tar.gz" } ], "2.1.3": [ { "comment_text": "", "digests": { "md5": "acd0aa7b1831a10e1fae3b1554134096", "sha256": "20cba24a116c50890e06c1ee0cd8bf3255ea07241ab12a92ffba1167ebd695d6" }, "downloads": -1, "filename": "scikit-deploy-2.1.3.tar.gz", "has_sig": false, "md5_digest": "acd0aa7b1831a10e1fae3b1554134096", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 774513, "upload_time": "2019-07-30T14:00:57", "url": "https://files.pythonhosted.org/packages/4f/d7/33c09a47ab34a110f36217bdb4c0837a2e5698dd9db2017d2add01fa4c62/scikit-deploy-2.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "acd0aa7b1831a10e1fae3b1554134096", "sha256": "20cba24a116c50890e06c1ee0cd8bf3255ea07241ab12a92ffba1167ebd695d6" }, "downloads": -1, "filename": "scikit-deploy-2.1.3.tar.gz", "has_sig": false, "md5_digest": "acd0aa7b1831a10e1fae3b1554134096", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 774513, "upload_time": "2019-07-30T14:00:57", "url": "https://files.pythonhosted.org/packages/4f/d7/33c09a47ab34a110f36217bdb4c0837a2e5698dd9db2017d2add01fa4c62/scikit-deploy-2.1.3.tar.gz" } ] }