Edit on GitHub

Get Started

Assuming MLEM is already installed in your active python environment, let's initialize it by running mlem init inside a Git project:

If you want to follow along with this tutorial and try MLEM, you can use our example repo. You'll need to fork it first (so you can push models). Then clone it locally:

$ git clone <your fork>
$ cd example-mlem-get-started

Next let's create an isolated virtual environment to cleanly install all the requirements (including MLEM) there:

$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
$ mlem init

A few internal files will be created:

$ tree .mlem
└─── config.yaml

Now you’re ready to MLEM!

In our example repository, you'll find tags for each step we take in the different sections of this tutorial. You can just see what is going on there or reproduce everything yourself and compare. In the different Get Started sections, those tags will be marked with ⛳ emoji. Click on it to expand the section and see the git commands to run if you are following along. Just like this Git tag that concludes this section:

Tag: 1-mlem-init

$ git add .mlem
$ git status
Changes to be committed:
        new file:   .mlem/config.yaml
$ git commit -m "Initialize MLEM"

To compare your results with the tag you can also run the following

$ git diff 1-mlem-init

The output will be empty if you have the same files staged/committed

MLEM’s features can be grouped around those common functional use cases. We’ll explore them one by one in the next few pages:

More examples on how to use MLEM in different scenarios can be found in Use Cases section

🐛 Found an issue? Let us know! Or fix it:

Edit on GitHub

Have a question? Join our chat, we will help you:

Discord Chat