Get started with ZenML in minutes. This quickstart demonstrates the core ZenML concepts: pipelines, steps, and artifacts.
- Create a simple ZenML pipeline
- Run it locally for development
- Deploy it as a managed HTTP endpoint
- Track artifacts and metadata automatically
pip install "zenml[server]"
zenml initRun the pipeline locally to see ZenML in action:
pip install -r requirements.txt
python run.pyThis executes a simple pipeline and tracks all artifacts in your local ZenML instance.
See your pipeline runs, artifacts, and metadata:
zenml login # If you haven't alreadyOpen your browser to the ZenML dashboard (URL shown after login) to visualize your pipeline run.
Create an immutable snapshot of your pipeline for reproducibility and sharing:
zenml pipeline snapshot create pipelines.simple_pipeline.simple_pipeline --name my_snapshotSnapshots freeze your pipeline code, configuration, and container images so:
- Reproducibility: Run the exact same pipeline months later
- Collaboration: Share ready-to-use pipeline configs with teammates
- Automation: Trigger from dashboards or CI/CD systems without code access
As well as running a pipeline in batch mode, ZenML allows you to deploy the same pipeline as a real-time HTTP service:
# Deploy your pipeline directly
zenml pipeline deploy pipelines.simple_pipeline.simple_pipeline
# OR deploy a snapshot (if you created one above)
zenml pipeline snapshot deploy my_snapshot --deployment simple_pipelineKey insight: zenml pipeline deploy automatically creates an implicit snapshot behind the scenes!
Get your deployment URL:
zenml deployment describe simple_pipelineCall your deployed pipeline as an HTTP endpoint:
# Using ZenML CLI
zenml deployment invoke simple_pipeline --name="Alice"
# Using curl
ENDPOINT=http://localhost:8000 # Replace with your deployment URL
curl -X POST "$ENDPOINT/invoke" \
-H "Content-Type: application/json" \
-d '{"parameters": {"name": "Bob"}}'Key insight: Your pipeline now runs as a persistent HTTP service. Same code, real-time inference!
Run the same pipeline on cloud infrastructure without changing any code:
# Create a cloud stack
zenml stack register my_cloud_stack --orchestrator kubeflow --artifact-store s3 --deployer aws...
# Activate it
zenml stack set my_cloud_stack
# Run the same code - it automatically runs on the cloud!
python run.py
# Or deploy the pipeline directly on your cloud infrastructure!
zenml pipeline deploy pipelines.simple_pipeline.simple_pipelineKey insight: ZenML separates ML code from infrastructure. Your pipeline runs identically locally, deployed as a service, or in the cloud!
quickstart/
├── run.py # Main entry point
├── pipelines/
│ └── simple_pipeline.py # Pipeline definition
├── steps/
│ └── simple_step.py # Step definitions
├── requirements.txt # Dependencies
└── configs/
└── default.yaml # Pipeline configuration
- LLM Agent Example: Check out
examples/deploying_agent/for document analysis with an embedded web UI - Agent Training Loop: See
examples/agent_outer_loop/for a comprehensive agent with training and evaluation - Classical ML: Explore
examples/deploying_ml_model/for traditional ML workflows - Documentation: Read the ZenML docs