ZenML: The Ultimate Open-Source Framework for MLOps

Farisology
6 min readAug 18, 2023

--

Empower Your ML Workflows with the Ultimate Open-Source Framework

Foster collaboration across the team (Photo from ZenML Docs)

MLOps is incredibly important in the ML landscape because it brings efficiency, reliability, and scalability to machine learning projects. It streamlines the process of taking ML models from development to production, ensuring smooth operations and faster time-to-market. MLOps enables teams to manage and monitor models effectively, leading to better decision-making and improved business outcomes. By embracing MLOps practices, organizations can unleash the full potential of their ML initiatives and drive innovation with confidence.

In the past, data scientists and ML engineers operated without the concept of MLOps stacks. However, the foundations were similar, relying on orchestrators and cloud resources for automation. Today, numerous MLOps platforms from big tech companies and others have emerged, offering various options. But there’s one framework that stands out: ZenML. As an open-source MLOps platform, ZenML offers exceptional capabilities that set it apart. In this article, we’ll explore why you should give ZenML a try and experience its remarkable potential.

Understanding ZenML

Unlike any other, ZenML promotes no vendor lock-in

Key features

  1. Glue: ZenML unlike other frameworks empowers you to plug your own choice of orchestrator, artefacts store, model deployer and etc. Your stack is literally completely yours.
  2. Modularity: ZenML enforces a modular approach to building ML workflows. Breaking down workflows into smaller, reusable steps, promotes code reusability, maintainability, and scalability.
  3. Standardization: ZenML helps standardize ML practices within a team or organization. It provides a consistent framework for developing and deploying ML workflows, enabling collaboration and streamlining processes.
  4. Reproducibility: With ZenML, it’s easy to reproduce ML workflows, ensuring consistent results. It tracks data and model versions, making it effortless to recreate experiments and verify results.

Pipeline structure

(Representation of a pipeline dag) Photo from ZenML Docs

ZenML enables a modular approach to ML workflows by breaking them down into smaller, independent components called steps. Each step performs a specific task, such as data preprocessing, feature engineering, or model training. This modular design promotes code reusability, maintainability, and scalability. Steps can be easily combined and rearranged to create different pipelines, providing flexibility and adaptability to changing requirements.

Observe how the following pipeline is built with two steps. Each step is a Python method denoted with the step decorator:

from zenml import pipeline, step

@step
def step_1() -> str:
return "world"

@step
def step_2(input_one: str, input_two: str) -> None:
combined_str = input_one + ' ' + input_two
print(combined_str)

@pipeline
def my_pipeline():
output_step_one = step_1()
step_2(input_one="hello", input_two=output_step_one)

my_pipeline()

ZenML uses a pipeline structure to orchestrate the execution of steps in a logical sequence. A pipeline represents the end-to-end flow of an ML workflow. It defines the order in which steps are executed and manages their dependencies. Pipelines make it easy to visualize and manage complex ML workflows, ensuring that data flows smoothly from one step to another. The pipeline structure provides a clear and organized way to manage the entire ML workflow, from data preprocessing to model deployment.

By adopting a modular approach and pipeline structure, ZenML allows for the creation of scalable, reproducible, and manageable ML workflows. It promotes code organization, collaboration among team members, and the ability to reuse and iterate on specific steps or pipelines. This structure enhances the overall efficiency and effectiveness of ML workflow management.

Build locally

In the course of ML workflow development, the data scientists can test and iterate on their workflow code and design locally. The pipeline can run using a local stack and debugging is easy before rolling it out to production. The ZenML client provides a user-friendly interface to test and run pipelines during development.

Federate responsibilities

It’s easier to manage the Ops of MLOps in ZenML. Data scientists and ML engineers can build workflows and design pipelines for various projects. The platform engineer can work on the creation of stacks and provision of resources that the data science team require to operate their pipeline.

The Zen for your ML Operations

The reality of MLOps today is that you need advanced expertise and considerable investment to make a good ML practice for your team. This is a limiting factor and could trap the field and practitioners in narrow ally and poor implementations. The ideal solution is getting a simple ML stack managed with some framework that doesn’t dictate your choices. This ideal solution is what ZenML is able to deliver.

Regardless of the size of your team and the level of expertise you have, you can get most of MLOps with ZenML

The creation of the MLOps stack and the level of complexity all depend on the choices you made. For example, you could have a simple stack that consists of an orchestrator (be it Kubeflow or Airflow), tracking with MLflow and Minio. Alternatively, your team might need more like drift detection and other components and it can be managed in the pipeline level and stack level giving you absolute flexibility even for relatively small teams.

ZenML Sandbox

You can have a one-click MLOps platform to experience ZenML with production-grade Stack from the main website here:

At your fingertips an experience like no other that will give a sense of how this can be truly transformative for your team. There are more resources to even take this infra into your own cloud with ZenML stack recipes.

Hands-on ZenML

If you want to get your hands on with code and tutorials to see the lower level of creating a stack and running a simple use-case you can check this series of articles:

ZenML projects

The framework has been growing at a fast pace and the amount of projects and development is impressive. There are many projects that are shared on the main website to help you replicate production-grade use cases.

Final words

In my quest to establish an efficient MLOps practice, I extensively researched and evaluated various options. Among them, ZenML emerged as the clear choice. Its modular approach and pipeline structure enables seamless integration, scalability, and code reusability. What sets ZenML apart is its unmatched flexibility to build customizable MLOps stacks that can run on any cloud platform. With ZenML, teams can embrace the freedom of no vendor lock-in and harness the power of open-source tools. While ZenML is a growing project with areas for improvement, we all have the opportunity to contribute and help shape its future. Together, we can bridge the gaps and ensure ZenML continues to deliver on its promise of empowering ML practitioners.

Thank you for reading thus far.

If you are interested in learning more and tutorials on building an MLOps stack with ZenML check out my series. https://farisology.com/series/mlops-zenml

--

--

Farisology

Fares Hasan enjoys working with start-ups and developing Machine Learning & Data Science products.