Try in Colab
W&B deactivates the option to set a TTL policy for model artifacts linked to the Model Registry. This is to help ensure that linked models do not accidentally expire if used in production workflows.
- Only team admins can view a team’s settings and access team level TTL settings such as (1) permitting who can set or edit a TTL policy or (2) setting a team default TTL.
- If you do not see the option to set or edit a TTL policy in an artifact’s details in the W&B App UI or if setting a TTL programmatically does not successfully change an artifact’s TTL property, your team admin has not given you permissions to do so.
Auto-generated Artifacts
Only user-generated artifacts can use TTL policies. Artifacts auto-generated by W&B cannot have TTL policies set for them. The following Artifact types indicate an auto-generated Artifact:run_table
code
job
- Any Artifact type starting with:
wandb-*
<>
with your own.
Define who can edit and set TTL policies
Define who can set and edit TTL policies within a team. You can either grant TTL permissions only to team admins, or you can grant both team admins and team members TTL permissions.Only team admins can define who can set or edit a TTL policy.
- Navigate to your team’s profile page.
- Select the Settings tab.
- Navigate to the Artifacts time-to-live (TTL) section.
- From the TTL permissions dropdown, select who can set and edit TTL policies.
- Click on Review and save settings.
- Confirm the changes and select Save settings.

Create a TTL policy
Set a TTL policy for an artifact either when you create the artifact or retroactively after the artifact is created. For all the code snippets below, replace the content wrapped in<>
with your information to use the code snippet.
Set a TTL policy when you create an artifact
Use the W&B Python SDK to define a TTL policy when you create an artifact. TTL policies are typically defined in days.Defining a TTL policy when you create an artifact is similar to how you normally create an artifact. With the exception that you pass in a time delta to the artifact’s
ttl
attribute.- Create an artifact.
- Add content to the artifact such as files, a directory, or a reference.
- Define a TTL time limit with the
datetime.timedelta
data type that is part of Python’s standard library. - Log the artifact.
Set or edit a TTL policy after you create an artifact
Use the W&B App UI or the W&B Python SDK to define a TTL policy for an artifact that already exists.When you modify an artifact’s TTL, the time the artifact takes to expire is still calculated using the artifact’s
createdAt
timestamp.- Python SDK
- W&B App
- Fetch your artifact.
- Pass in a time delta to the artifact’s
ttl
attribute. - Update the artifact with the
save
method.
Set default TTL policies for a team
Only team admins can set a default TTL policy for a team.
- Navigate to your team’s profile page.
- Select the Settings tab.
- Navigate to the Artifacts time-to-live (TTL) section.
- Click on the Set team’s default TTL policy.
- Within the Duration field, set the TTL policy in units of days.
- Click on Review and save settings. 7/ Confirm the changes and then select Save settings.

Set a TTL policy outside of a run
Use the public API to retrieve an artifact without fetching a run, and set the TTL policy. TTL policies are typically defined in days. The following code sample shows how to fetch an artifact using the public API and set the TTL policy.Deactivate a TTL policy
Use the W&B Python SDK or W&B App UI to deactivate a TTL policy for a specific artifact version.- Python SDK
- W&B App
- Fetch your artifact.
- Set the artifact’s
ttl
attribute toNone
. - Update the artifact with the
save
method.
View TTL policies
View TTL policies for artifacts with the Python SDK or with the W&B App UI.- Python SDK
- W&B App
Use a print statement to view an artifact’s TTL policy. The following example shows how to retrieve an artifact and view its TTL policy: