Skip to main content

Version and deploy your models following GitOps principles

Project description

[![Check, test and release](https://github.com/iterative/mlem/actions/workflows/check-test-release.yml/badge.svg)](https://github.com/iterative/mlem/actions/workflows/check-test-release.yml) [![codecov](https://codecov.io/gh/iterative/mlem/branch/main/graph/badge.svg?token=WHU4OAB6O2)](https://codecov.io/gh/iterative/mlem) [![PyPi](https://img.shields.io/pypi/v/mlem.svg?label=pip&logo=PyPI&logoColor=white)](https://pypi.org/project/mlem)

MLEM is in early alpha. Thank you for trying it out! 👋

Alpha include model registry functionality, and upcoming Beta will add model deployment functionality.

## What is MLEM 🐶

MLEM is a tool to help you version and deploy your Machine Learning models. At the top level, MLEM consists of two parts:

  1. Model registry part:
    1. Storing model along with information required to use it: environment, methods, input data schema.

    2. Turning your Git repo into a model registry.

  2. Deployment part:
    1. Packing a model to use in any serving scenario.

    2. Provider-agnostic deployment.

Speaking generally, the goal of MLEM is to enable easy and error-safe way to transition ML model from training to serving environment.

## Key features

  • MLEM is not intrusive. It doesn’t ask you to rewrite your training code. Just add two lines to your python script: one to import the library and one to save the model.

  • MLEM turns your Git repository into an easy-to-use model registry. Have a centralized place to store your models along with all metainformation. You don’t need to set up a separate backend server to use it as a model registry.

  • Stick to your workflow. Use Gitflow or any other Git workflow you like. Because MLEM models are saved as mere artifacts, treat them as any other artifact your produce. Commit metainformation to your repo and store model binaries in any other way you usually do.

  • Use your model whatever your like:
    • Turn your model to a python package with one command. You find that helpful if you use your model embedded in some other Python application.

    • Use your model for batch scoring. You can use MLEM CLI to get predictions for a data file or folder with files. The docker container you build will be capable of this by default.

    • Turn your model to a REST API application with Dockerfile prepared with one command. If you like, treat it as a separate git repo or build a Docker container from a model directly.

    • Deploy your model. MLEM is a provider-agnostic deployment tool. You don’t have to learn new providers when you deploy models to a different cloud or PaaS. MLEM abstracts that for you and simplifies the model deployment tasks. If your provider is not listed yet, you can write a simple plugin to work with MLEM or upvote the issue for creating one.

## Installation

Install MLEM with pip:

` $ pip install mlem `

To install the development version, run:

` $ pip install git+https://github.com/iterative/mlem `

## Anonymized Usage Analytics

To help us better understand how MLEM is used and improve it, MLEM captures and reports anonymized usage statistics. You will be notified the first time you run mlem init.

### What MLEM’s analytics record the following information per event: - MLEM version (e.g., 0.1.2+5fb5a3.mod) and OS version (e.g., MacOS 10.16) - Command name and exception type (e.g., ls, ValueError or get, MLEMRootNotFound) - Country, city (e.g., RU, Moscow) - A random user_id (generated with [uuid](https://docs.python.org/3/library/uuid.html))

### Implementation The code is viewable in [analytics.py](https://github.com/iterative/mlem/mlem/analytics.py). They are done in a separate background process and fail fast to avoid delaying any execution. They will fail immediately and silently if you have no network connection.

MLEM’s analytics are sent through Iterative’s proxy to Google BigQuery over HTTPS.

### Opting out MLEM analytics help the entire community, so leaving it on is appreciated. However, if you want to opt out of MLEM’s analytics, you can disable it via setting an environment variable MLEM_NO_ANALYTICS=true or by adding no_analytics: true to .mlem/config.yaml

This will disable it for the project. We’ll add an option to opt out globally soon.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlem-0.1.6.tar.gz (101.3 kB view details)

Uploaded Source

Built Distribution

mlem-0.1.6-py3-none-any.whl (132.1 kB view details)

Uploaded Python 3

File details

Details for the file mlem-0.1.6.tar.gz.

File metadata

  • Download URL: mlem-0.1.6.tar.gz
  • Upload date:
  • Size: 101.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for mlem-0.1.6.tar.gz
Algorithm Hash digest
SHA256 2e158e92ebbbb32d90155024b6d9f26dfafb51c6297934169bc2268bff77f9da
MD5 8ad7ab129db556677c0d8491847b06e3
BLAKE2b-256 ddf1973ecd872577ec253191eedf2743e60257426afe9d4c77f21ddefc6fc739

See more details on using hashes here.

File details

Details for the file mlem-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: mlem-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 132.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for mlem-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 75264b0b446326660d94b5a3b613229fdb10548534d35eb495567413525a0b17
MD5 bb86acc6f4c8e67b48738c83c8126ba8
BLAKE2b-256 bdc7f2c1b2363759b8ed659a3e1c6bd7ed205e396ed9aaae561935e02755d675

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page