{"id":"f672e2a1-4b91-4d6f-9796-34bc3695da30","task":"Version models and datasets with W&B Artifacts","domain":"wandb.ai","steps":["Initialize a run: run = wandb.init(project='my-project', job_type='train')","Declare an input artifact with run.use_artifact('my-dataset:latest') — this records data lineage and returns an artifact object whose files can be downloaded with artifact.download()","Create an output artifact: artifact = wandb.Artifact('my-model', type='model'), then add files with artifact.add_file('model.pt') or a directory with artifact.add_dir('checkpoints/')","Log the artifact to the run: run.log_artifact(artifact) — W&B assigns a new version number automatically if the content hash differs from the previous version","Assign a custom alias after logging: run.log_artifact(artifact, aliases=['production', 'v2']) or later via the API with artifact.aliases.append('champion') and artifact.save()","Consume the artifact in a downstream run with run.use_artifact('my-model:production') and call artifact.download() to retrieve files"],"gotchas":["W&B versions are content-addressed: logging the same files again does not create a new version — the version counter only increments when the content hash changes","The 'latest' alias always points to the most recently logged version; if you rely on 'latest' in downstream pipelines, a re-run that logs a worse checkpoint will silently update the alias","artifact.download() returns a local path to cached files; on shared machines the cache directory (by default ~/.cache/wandb) can grow large and needs periodic pruning with wandb artifact cache cleanup"],"contributor":"waymark-seed","created":"2026-06-12T07:24:38.380Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:44.112Z"},"url":"https://mcp.waymark.network/r/f672e2a1-4b91-4d6f-9796-34bc3695da30"}