MLEM Documentation

website·Indexed 33 days ago

https://mlem.ai

MLEM is a tool for managing machine learning models and artifacts, featuring support for various model types (TensorFlow, ONNX, CatBoost), storage extensions (DVC, fsspec), and deployment targets (Kubernetes, SageMaker). It includes GTO (Git Tag Ops), a command-line tool for creating Artifact and Model Registries within Git repositories.

Tokens
45.8K
Snippets
275
Records
409
Agent score
67%

What's inside MLEM

  1. Overview of GTO Artifact Registry

    GTO is a tool used to create an Artifact Registry (such as a Machine Learning Model Registry) directly within a Git repository. It enables centralized storage and operationalization of artifacts and metadata, allowing teams to manage model lifecycles, versions, and releases using GitOps principles. GTO leverages Git tags to register versions and assign stages, and uses an artifacts.yaml file to store metadata including the artifact's path, type, and description.
  2. Overview of GTO Artifact Registry

    GTO allows you to create an Artifact Registry or Model Registry directly within a Git repository by using annotated Git tags with a specific format. This enables versioning and stage assignment of artifacts (like models or datasets) using Git as the source of truth.
  3. Overview of GTO artifact versioning

    GTO is a tool used to manage machine learning artifact versions and their deployment stages (e.g., testing, shadow, production) within a Git repository. It uses Git tags to track versions and stage assignments, allowing for Git-native integration with CI/CD pipelines.
  4. Overview of MLEM for ML model deployment

    MLEM is an open-source tool that simplifies ML model deployments by allowing users to save models via Python calls while automatically capturing model metadata in a human-readable YAML format. It is designed to be framework-agnostic and supports Git-native ML model registries, often used in combination with other Iterative.ai tools like GTO or DVC to enable software engineering best practices (such as GitFlow) in ML development.
  5. Overview of GTO (Git Tag Ops)

    GTO (Git Tag Ops) is a tool designed to create an Artifact Registry directly within a Git repository. It provides a centralized location to store and operationalize artifacts and their associated metadata. GTO enables developers to manage the artifact lifecycle, handle versions and releases, and automate testing and deployment using GitOps workflows. A primary use case for GTO is the implementation of a Machine Learning Model Registry.
  6. Overview of MLEM for ML Model Packaging and Deployment

    MLEM is a tool designed to package, deploy, and serve Machine Learning models, supporting both real-time serving and batch processing scenarios. When integrated with GTO, MLEM enables the creation of a Model Registry using a Git repository, providing a centralized system to store models and metadata, manage model lifecycles, versions, and releases, and automate deployments via GitOps.
  7. Overview of MLEM for ML model packaging and serving

    MLEM is an open-source Python tool designed to package and serve Machine Learning models. It allows developers to transform models into Python modules for programmatic use or package them as fully deployable services within Docker images. By defining standard interfaces and formats for datasets and models, MLEM supports various model types and deployment targets, enabling local serving or deployment on any cloud infrastructure.
  8. Understand MLEM anonymized usage analytics

    MLEM collects anonymized usage statistics to prioritize features and fixes. Data is sent via Iterative's proxy to Google BigQuery over HTTPS in a background process that fails silently to avoid delaying execution.

    Collected Data:

    • MLEM version and OS version
    • Command name and exception type
    • Country and city
    • A random user_id generated via uuid

    Retention: User and event data are retained for 14 months.

  9. LightGBM model and dataset support in mlem

    mlem provides ModelType and ModelIO implementations for lightgbm.Booster. Additionally, it provides LightGBMDataType with associated Reader and Writer implementations for lightgbm.Dataset objects.
  10. Use Torch implementations in mlem

    mlem provides the following implementations for PyTorch:

    • ModelType and ModelIO for torch.nn.Module.
    • An ImportHook for importing files saved using torch.save.
    • DataType, Reader, and Writer implementations for torch.Tensor.
  11. Understand MLEM Objects and Metafiles

    An MLEM Object is the fundamental unit in MLEM used to manage models, data, and other object types. MLEM Objects are stored as YAML metafiles with a .mlem extension. These metafiles may be associated with one or more 'artifacts' (the actual data or model files).

    • Single Artifact: If an object has one artifact, the artifact typically shares the same filename as the metafile but without the .mlem extension (e.g., model.mlem and model).
    • Multiple Artifacts: If an object has multiple artifacts, they are stored in a directory named after the metafile (e.g., model.mlem with artifacts in model/data.pkl and model/data2.pkl).

    MLEM Objects can be created using mlem.api.save() or the mlem declare CLI command.