Skip to main content

DeployMe

Codacy grade GitHub branch checks state Codecov

PyPI - Python Version

If you have been working on ML models, then you have probably faced the task of deploying these models. Perhaps you are participating in a hackathon or want to show your work to management.

According to our survey, more than 60% of the data-scientists surveyed faced this task and more than 60% of the respondents spent more than half an hour creating such a service.

The most common solution is to wrap it in some kind of web framework (like Flask).

Our team believes that it can be made even easier!

Our tool automatically collects all the necessary files and dependencies, creates a docker container, and launches it! And all this in one line of source code.

Pipeline

  1. First, we initialize the project directory for the next steps;
  2. Next, we serialize your machine learning models (for example, with Joblib or Pickle);
  3. Next, we create a final .py file based on the templates that contains the endpoint handlers. Handlers are chosen based on models, and templates based on your preferences (templates are also .py files using, for example, Sanic or Flask);
  4. Copy or additionally generate the necessary files (e.g. Dockerfile);
  5. The next step is to compile the API documentation for your project;
  6. After these steps, we build a Docker container, or a Python package, or we just leave the final directory and then we can deploy your project in Kubernetes, or in Heroku.

Prerequisites

On your PC with local run you must have Docker & Python >= 3.8

Installation

Install deployme with pip:

pip install deployme

or with your favorite package manager.

Example

from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier

from deployme import cook

X, y = load_iris(return_X_y=True, as_frame=True)

clf = RandomForestClassifier()
clf.fit(X, y)

cook(strategy="docker", model=clf, port=5010)

After running script you can see new Docker container. To interact with service simply open URL, logged after script running.

On this page you can see Swagger UI, test simple requests (examples included). For direct post-requests you can use Curl:

curl -X POST "http://127.0.0.1:5001/predict" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{\"data\":[{\"sepal length (cm)\":5.8,\"sepal width (cm)\":2.7,\"petal length (cm)\":3.9,\"petal width (cm)\":1.2}]}"

Models support

Currently, we support the following models:

  • sklearn
  • xgboost
  • catboost
  • lightgbm

RoadMap

  1. Deploy to Heroku & clusters
  2. Model's basic vizualization
  3. Tighter integration with LightAutoML
  4. Support many popular ML-frameworks, such as XGBoost, TensorFlow, CatBoost, etc.
  5. Your ideas!

Contribution

We are always open to your contributions! Please check our issue's and make PR.

Metadata

Release files for deployme 0.5.0

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

Source distribution (sdist)

Source distribution for deployme 0.5.0
File Size Uploaded
deployme-0.5.0.tar.gz 39.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deployme 0.5.0
File Interpreter ABI Platform
deployme-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 91.4 kB

Release files / deployme-0.5.0.tar.gz

Download URL deployme-0.5.0.tar.gz
Size 39.2 kB
Tags Source
SHA-256 checksum
How to use checksums
79400e648d3ec825c79e1594f4bd502dfef6979dda37e01e09fdec43091560b5
BLAKE2b-256 checksum
How to use checksums
23bce777937bbbe6d0a85e173eff71e8e734838732d76a63bcd324af10dda227
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.9.2 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.13 tqdm/4.64.1 importlib-metadata/5.1.0 keyring/23.11.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.8

Release files / deployme-0.5.0-py3-none-any.whl

Download URL deployme-0.5.0-py3-none-any.whl
Size 52.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6e249328f9ecb69a44f36293e87f444c62efd720ef3cc2c13ae4b5909f2a5e4
BLAKE2b-256 checksum
How to use checksums
29814659d3477bd78138c4b438deb4480ce344216e093f03b87fbfbd20990575
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.9.2 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.13 tqdm/4.64.1 importlib-metadata/5.1.0 keyring/23.11.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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