ZenML: MLOps for Reliable AI
raw JSON → 0.94.3 verified Fri May 01 auth: no python
ZenML is an open-source MLOps framework that helps you build reproducible, production-ready ML pipelines. It provides a unified interface for orchestrating pipelines, managing infrastructure, and tracking experiments across various backends (local, cloud, Kubernetes). The current version is 0.94.3, with frequent releases (multiple per month). It requires Python >=3.10,<3.14.
pip install zenml Common errors
error ModuleNotFoundError: No module named 'zenml.core' ↓
cause Using old import path that was removed in v0.20+.
fix
Use
from zenml import pipeline, step instead. error ImportError: cannot import name 'ArtifactConfig' from 'zenml.artifacts' ↓
cause ArtifactConfig moved to the top-level module in v0.93+.
fix
Use
from zenml import ArtifactConfig. error TypeError: 'ArtifactVersionResponse' object is not iterable ↓
cause Code expects a single artifact version, but in v0.93+ `regular_inputs` returns a list for each key.
fix
Iterate over the list: for artifact in step_run.regular_inputs['key']: ...
error sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: ... ↓
cause ZenML server database schema not migrated; older version of database used with newer server.
fix
Run
zenml upgrade or manually delete and reinitialize the database (careful with production data). Warnings
breaking In v0.93.0, `StepRunResponse.regular_inputs` changed from `Dict[str, ArtifactVersionResponse]` to `Dict[str, List[ArtifactVersionResponse]]`. Code relying on old type will break. ↓
fix Update code to handle lists of artifact versions instead of single artifacts.
gotcha The `zenml init` command is not needed unless you're using ZenML Pro or legacy project structure. For most users, simply installing and importing ZenML is sufficient. ↓
fix Skip `zenml init` unless instructed by the documentation for ZenML Pro.
breaking In v0.93.0, database migration may fail if pipelines without any runs exist. Delete such pipelines before upgrading server. ↓
fix Run the provided script to delete pipelines with `latest_run_status is None` before server upgrade.
gotcha Custom step operator flavors must implement new `submit_step` and `get_step_status` methods (v0.94+). Legacy `launch` method only works for static pipelines. ↓
fix Update custom step operators to implement the new methods.
Install
pip install zenml[server] pip install zenml[templates,server] Imports
- pipeline wrong
from zenml.core import pipelinecorrectfrom zenml import pipeline - step wrong
from zenml.steps import stepcorrectfrom zenml import step - Client wrong
from zenml import Clientcorrectfrom zenml.client import Client - ArtifactConfig wrong
from zenml.artifacts import ArtifactConfigcorrectfrom zenml import ArtifactConfig
Quickstart
from zenml import pipeline, step
@step
def load_data() -> dict:
return {'data': [1, 2, 3]}
@step
def train_model(data: dict) -> str:
return 'model trained with ' + str(len(data['data'])) + ' samples'
@pipeline
def my_pipeline():
data = load_data()
train_model(data)
if __name__ == '__main__':
my_pipeline()
print('Pipeline run completed')