Artifacts
Learn how ZenML manages data artifacts, tracks versioning and lineage, and enables effective data flow between steps.
Artifacts in the Pipeline Workflow
Basic Artifact Usage
Creating Artifacts (Step Outputs)
from zenml import pipeline, step
import pandas as pd
@step
def create_data() -> pd.DataFrame:
"""Creates a dataframe that becomes an artifact."""
return pd.DataFrame({
"feature_1": [1, 2, 3],
"feature_2": [4, 5, 6],
"target": [10, 20, 30]
})
@step
def create_prompt_template() -> str:
"""Creates a prompt template that becomes an artifact."""
return """
You are a helpful customer service agent.
Customer Query: {query}
Previous Context: {context}
Please provide a helpful response following our company guidelines.
"""Consuming Artifacts (Step Inputs)
Artifacts vs. Parameters
Accessing Artifacts After Pipeline Runs
Working with Artifact Types
Type Annotations
Returning Multiple Outputs
Naming Your Artifacts
How Artifacts Work Under the Hood
Materializers: How Data Gets Stored
Lineage and Caching
Advanced Artifact Usage
Accessing Artifacts from Previous Runs
Cross-Pipeline Artifact Usage
Visualizing Artifacts
Managing Artifacts
Registering Existing Data as Artifacts
Register an Existing Folder
Register an Existing File
Register Framework Checkpoints
Conclusion
Last updated
Was this helpful?