zenml init command initializes a ZenML repository in your current directory, setting up the necessary configuration and resource management tools.
Basic Usage
.zen folder in your current directory containing ZenML configuration and metadata.
Command Options
Custom Path
Initialize ZenML in a specific directory:Using Project Templates
Bootstrap your project with a ready-to-use template:starter- Basic ZenML project structuree2e_batch- End-to-end batch inference pipelinenlp- Natural language processing templatellm_finetuning- LLM fine-tuning template
Template with Defaults
Skip interactive prompts and use default values:Custom Template URL
Use a custom Copier template from GitHub:Specify Template Version
Use a specific version tag:Complete Option Reference
| Option | Type | Description |
|---|---|---|
--path | Path | Directory path where ZenML should be initialized (defaults to current directory) |
--template | String | Name or URL of a ZenML project template (e.g., starter, e2e_batch, or gh:owner/repo) |
--template-tag | String | Optional version tag for custom template URLs (ignored for built-in templates) |
--template-with-defaults | Flag | Use template default values without interactive prompts |
Examples
Initialize in Current Directory
Initialize with Starter Template
- Project name
- Project description
- Author information
- Other template-specific options
Quick Template Setup (No Prompts)
Initialize in Specific Directory
Use Custom GitHub Template
What Gets Created
When you runzenml init, ZenML creates:
-
.zendirectory - Hidden folder containing:- Configuration files
- Local metadata database (if using local mode)
- Cache files
-
Template files (if using
--template):- Python pipeline definitions
- Configuration files
- Example notebooks
- README and documentation
- Requirements files
Template Requirements
To use project templates, you need the templates extra:When to Use zenml init
Usezenml init when:
Starting a New Project
Initialize ZenML in a new ML project to enable pipeline tracking and stack management.
Using Project Templates
Bootstrap a project with best practices and example code using built-in templates.
Setting Up Team Projects
Establish a shared project structure with standardized configurations.
Exploring ZenML
Quickly set up example projects to learn ZenML features.
Common Workflows
Initialize and Connect to Server
Start with Template
Initialize Existing Project
Exploring Templates
Before initializing, you can explore templates on GitHub:- Starter: https://github.com/zenml-io/template-starter
- E2E Batch: https://github.com/zenml-io/template-e2e-batch
- NLP: https://github.com/zenml-io/template-nlp
- LLM Finetuning: https://github.com/zenml-io/template-llm-finetuning
Troubleshooting
Already Initialized
If you runzenml init in a directory that’s already initialized, you’ll see an error. To reinitialize:
Template Installation Issues
If template creation fails:- Ensure you have
zenml[templates]installed - Check your internet connection (templates are fetched from GitHub)
- Verify the template name or URL is correct
Next Steps
After initializing your repository:Login to Server
Connect to ZenML Pro or self-hosted server
Configure Stack
Set up your MLOps stack components
Install Integrations
Add integrations for cloud providers and tools
Run Pipeline
Execute your first pipeline
