LogoLogo
ProductResourcesGitHubStart free
  • Documentation
  • Learn
  • ZenML Pro
  • Stacks
  • API Reference
  • SDK Reference
  • Getting Started
    • Welcome to ZenML
    • Installation
    • Hello World
    • Core Concepts
    • System Architecture
  • Deploying ZenML
    • Deploy
      • Deploy with Docker
      • Deploy with Helm
      • Deploy using HuggingFace Spaces
      • Deploy with custom images
      • Secret management
      • Custom secret stores
    • Connect
      • with your User (interactive)
      • with an API Token
      • with a Service Account
    • Manage
      • Best practices for upgrading
      • Using ZenML server in production
      • Troubleshoot your ZenML server
      • Migration guide
        • Migration guide 0.13.2 → 0.20.0
        • Migration guide 0.23.0 → 0.30.0
        • Migration guide 0.39.1 → 0.41.0
        • Migration guide 0.58.2 → 0.60.0
  • Concepts
    • Steps & Pipelines
      • Configuration
      • Scheduling
      • Logging
      • Advanced Features
      • YAML Configuration
    • Artifacts
      • Materializers
      • Visualizations
    • Stack & Components
    • Service Connectors
    • Containerization
    • Code Repositories
    • Secrets
    • Tags
    • Metadata
    • Models
    • Templates
    • Dashboard
  • Reference
    • Community & content
    • Environment Variables
    • llms.txt
    • FAQ
    • Global settings
    • Legacy docs
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Getting Started

Hello World

Your first ML pipeline with ZenML - from local development to cloud deployment in minutes.

PreviousInstallationNextCore Concepts

Last updated 8 days ago

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.

1

Install ZenML

Start by installing ZenML in a fresh Python environment:

pip install zenml

This gives you access to both the ZenML Python SDK and CLI tools.

2

Write your first pipeline

Create a simple run.py file with a basic workflow:

from zenml import step, pipeline


@step
def basic_step() -> str:
    """A simple step that returns a greeting message."""
    return "Hello World!"


@pipeline
def basic_pipeline():
    """A simple pipeline with just one step."""
    basic_step()


if __name__ == "__main__":
    basic_pipeline()

Run this pipeline locally with python run.py. ZenML automatically tracks the execution and stores artifacts.

3

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:

# Log in and select your workspace
zenml login

# Activate your project
zenml project set <PROJECT_NAME>
4

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.

5

Run your pipeline on the remote stack

Now run your pipeline in the cloud without changing any code.

First, activate your new stack:

zenml stack set <NAME_OF_YOUR_NEW_STACK>

Then run the exact same script:

python run.py

ZenML handles packaging code, building containers, orchestrating execution, and tracking artifacts automatically.

6

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

ZenML Pro account
Core Concepts
Terraform
stores, versions, and tracks your data
tags
metadata
handles containerization
stacks
service connectors
handle sensitive information
reusable pipeline templates
scheduling
caching
The ZenML Pro Dashboard
Stack deployment options
Your pipeline in the ZenML dashboard
ZenML Pro Dashboard
ZenML Stack Deployment Options
Pipeline Run in ZenML Dashboard