Hello World
Your first ML pipeline with ZenML - from local development to cloud deployment in minutes.
Last updated
Was this helpful?
Your first ML pipeline with ZenML - from local development to cloud deployment in minutes.
Last updated
Was this helpful?
This guide will help you build and deploy your first ZenML pipeline, starting locally and then transitioning to the cloud without changing your code.
Install ZenML
Start by installing ZenML in a fresh Python environment:
This gives you access to both the ZenML Python SDK and CLI tools.
Write your first pipeline
Create a simple run.py
file with a basic workflow:
Run this pipeline locally with python run.py
. ZenML automatically tracks the execution and stores artifacts.
Create your ZenML account
Create a with a 14-day free trial (no payment information required). It will provide you with a dashboard to visualize pipelines, manage infrastructure, and collaborate with team members.
First-time users will need to set up a workspace and project. This process might take a few minutes. In the meanwhile, feel free to check out the page to get familiar with the main ideas ZenML is built on. Once ready, connect your local environment:
Create your first remote stack
A "stack" in ZenML represents the infrastructure where your pipelines run. Moving from local to cloud resources is where ZenML truly shines.
The fastest way to create a cloud stack is through the Infrastructure-as-Code option. This uses Terraform to deploy cloud resources and register them as a ZenML stack.
You'll need:
version 1.9+ installed locally
Authentication configured for your preferred cloud provider (AWS, GCP, or Azure)
Appropriate permissions to create resources in your cloud account
The deployment wizard will guide you through each step.
Run your pipeline on the remote stack
Now run your pipeline in the cloud without changing any code.
First, activate your new stack:
Then run the exact same script:
ZenML handles packaging code, building containers, orchestrating execution, and tracking artifacts automatically.
What's next?
Congratulations! You've just experienced the core value proposition of ZenML:
Write Once, Run Anywhere: The same code runs locally during development and in the cloud for production
Separation of Concerns: Infrastructure configuration and ML code are completely decoupled, enabling independent evolution of each
Full Tracking: Every run, artifact, and model is automatically versioned and tracked
To continue your ZenML journey, explore these key topics:
Pipeline Development: Discover advanced features like and
Artifact Management: Learn how ZenML automatically
Organization: Use and to keep your ML projects structured
Containerization: Understand how ZenML for reproducible execution
Stacks & Infrastructure: Explore the concepts behind and for authentication
Secrets Management: Learn how to securely
Templates: Create for standardized workflows