Artifacts

An artifact is a named, versioned reference to an object in storage. Instead of remembering which bucket path holds last week’s training set, you register the output under a name, and downstream tasks, triggers, and apps refer to it by that name.

Your data path does not change. Files, directories, and dataframes are offloaded to object storage exactly as before. An artifact adds a name, a version, and a record of where it came from. Registering under the same name again creates a new version, and Union records which run produced each version and which tasks and apps consume it, so you can trace a deployed model back to the dataset it was trained on.

Any flyte.io.File, flyte.io.Dir, or flyte.io.DataFrame can become an artifact. The most common way is to wrap a task’s return value:

@env.task(produces_artifacts=True)
async def train() -> File:
    weights = await File.from_local("model.pt")
    return artifacts.new(weights, artifacts.Metadata(name="trained-model"))