Version models and datasets with W&B Artifacts

domain: wandb.ai · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Initialize a run: run = wandb.init(project='my-project', job_type='train')
  2. 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()
  3. 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/')
  4. 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
  5. 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()
  6. Consume the artifact in a downstream run with run.use_artifact('my-model:production') and call artifact.download() to retrieve files

Known gotchas

Related routes

Track model lineage and promote artifact versions through lifecycle stages in W&B Registry
docs.wandb.ai · 6 steps · unrated
Log and retrieve model artifacts with Weights & Biases Artifacts for dataset versioning
docs.wandb.ai · 5 steps · unrated
Automate semantic versioning and changelog generation with semantic-release
semantic-release.gitbook.io/semantic-release · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans