Garbage collection is best-effort. W&B does not guarantee how quickly freed space appears in your object storage after you delete an artifact. Large deployments or backlogs can take longer than expected. For how this fits with run data, retention settings, and optional operator actions, see Manage bucket storage and costs.
Artifact garbage collection workflow
This section provides a visual overview of how artifact deletion flows through soft-delete and garbage collection before files are permanently removed. The following diagram illustrates the complete artifact garbage collection process: You can schedule when artifacts are deleted from W&B with TTL policies. For more information, see Manage data retention with Artifact TTL policy.Artifacts deleted by a TTL policy, the W&B Python SDK, or the W&B App are first soft-deleted. Soft-deleted artifacts are then garbage-collected before they’re permanently deleted.
Deleting an entity, project, or artifact collection triggers the artifact deletion process described on this page. When you delete a run and choose to delete its associated artifacts, those artifacts follow the same soft-delete and garbage collection workflow.
Delete an artifact version
Delete an artifact version interactively with the W&B App or programmatically with the W&B Python SDK.- W&B App
- W&B Python SDK
To delete an artifact version:
- Navigate to the project that contains the artifact version you want to delete.
- Select the Artifacts tab.
- From the list of artifact types, select the type of artifact that contains the version you want to delete.
- Click the action () menu next to the artifact version you want to delete.
- From the dropdown, choose Delete Version.
Delete multiple artifact versions
Use this approach when you want to clean up several artifact versions logged by a single run in one operation, rather than deleting each version individually. The following code example shows how to delete multiple artifact versions. Provide the entity, project name, and run ID that created the artifact as arguments towandb.Api.run(). This returns a run object that you can use to access all artifact versions created by that run. Next, iterate through the artifact versions and delete the versions that match your criteria.
Replace the <entity>, <project>, <run_id>, and <artifact_name> placeholders with your own values:
Delete multiple artifact versions with a specific alias
To remove only versions tagged with a particular alias (for example, an obsolete release tag), filter on the alias before deleting. The following code demonstrates how to delete multiple artifact versions that have a specific alias. Replace the<entity>, <project>, <run_id>, <artifact_name>, and <alias> placeholders with your own values:
Delete an artifact collection
Deleting a collection removes the collection and all artifact versions it contains. Deleted versions follow the same soft-delete and garbage collection workflow described in the preceding sections.- W&B App
- W&B Python SDK
To delete an artifact collection:
- Navigate to the artifact collection you want to delete.
- Click the action () menu next to the artifact collection name.
- From the dropdown menu, select Delete.
Protected aliases and deletion permissions
Artifacts with protected aliases have special deletion restrictions. Protected aliases are aliases in the W&B Registry that registry admins can set to prevent unauthorized deletion.Important considerations for protected aliases:
- Non-registry admins can’t delete artifacts with protected aliases.
- Within a registry, registry admins can unlink protected artifact versions and delete collections and registries that contain protected aliases.
- For source artifacts: if a source artifact is linked to a registry with a protected alias, no user can delete it.
- Registry admins can remove the protected aliases from source artifacts and then delete them.
Enable garbage collection based on how W&B is hosted
Garbage collection timing is not guaranteed. See Manage bucket storage and costs for details.
- W&B Self-Managed: Set
GORILLA_ARTIFACT_GC_ENABLED=true. - Dedicated Cloud: Contact support to verify that garbage collection is active.
- Enable bucket versioning if you use AWS, Google Cloud, or any other storage provider such as Minio. If you use Azure, enable soft deletion, which is equivalent to bucket versioning.
X indicates you must satisfy the requirement:
| Environment variable | Enable versioning | |
|---|---|---|
| Multi-tenant Cloud | ||
| Multi-tenant Cloud with BYOB storage | X | |
| Dedicated Cloud | ||
| Dedicated Cloud with BYOB storage | X | |
| Self-Managed | X | X |
Secure storage connector is available only for Google Cloud Platform and Amazon Web Services.