Artifact is KFP’s generic artifact type for files and data outputs that do not fit specialized categories such as Dataset, Model, or Metrics. Use it when a pipeline component must pass a file while preserving descriptive metadata. section 7.2.3 section 8.1.4
Use the generic type when the output is operational data rather than a specialized ML artifact:
- Annotate configuration files with Output[Artifact], write the file through output_config.path, and attach fields such as config_type and version. section 7.2.3
- Pass auxiliary validation inputs such as a YOLO data.yaml file as Input[Artifact], alongside specialized Model, Dataset, and Metrics artifacts. section 8.1.4
- Prefer Dataset, Model, or Metrics when the data matches those specialized categories and their associated tracking behavior. section 7.2.3 section 8.1.4
Versioned training configuration
A component can serialize a configuration dictionary to output_config.path, then record config_type as training_parameters and version as 1.0 in the artifact metadata. A YOLO validation component can consume a similarly packaged data.yaml artifact. section 7.2.3 section 8.1.4
@dsl.component
def save_config(
config: Dict[str, Any],
output_config: Output[Artifact]):
with open(output_config.path, 'w') as f:
json.dump(config, f)
output_config.metadata.update({
'config_type': 'training_parameters',
'version': '1.0'
})
Inspect the complete KFP component pattern for writing a configuration file and updating generic artifact metadata. section 7.2.3
