SAGEA LogoDocs & API
CookbooksCursus Cookbooks

Version Models & Datasets

Attach files to runs with automatic versioning — track model checkpoints, datasets, and other artifacts across experiments.

  • Version artifacts by name with descriptions
  • Attach single files or lists of files
  • Artifacts belong to projects, not runs — view across all runs

Time to complete: ~5 minutes

Prerequisites

  • pip install sagea-cursus
  • CURSUS_API_KEY and CURSUS_BASE_URL set in your environment

Step 1: Log a model checkpoint

# artifacts.py
import sagea_cursus as cursus
 
run = cursus.init(
    project="my-experiment",
    config={"lr": 1e-3, "epochs": 50},
    name="artifact-demo",
)
 
try:
    for step in range(50):
        loss = 1.0 / (step + 1)
        cursus.log({"train/loss": loss}, step=step)
 
    # log a single model file
    cursus.log_artifact(
        "best-model",
        "checkpoints/best.pt",
        type="model",
        description="Final trained weights",
    )
 
    # log a dataset as a list of files
    cursus.log_artifact(
        "training-data",
        ["train.csv", "val.csv", "test.csv"],
        type="dataset",
        description="Train/val/test split",
    )
 
    cursus.finish()
except Exception:
    cursus.finish("crashed")
    raise

Step 2: View artifacts on the dashboard

Open the run's Artifacts tab to see:

  • best-model — version 1, type model, description "Final trained weights", single file best.pt
  • training-data — version 1, type dataset, three files listed

Each call to log_artifact() with the same name creates a new version. Previous versions remain accessible.

Step 3: Use artifacts across runs

Artifacts belong to projects, not runs. View all versions of best-model in the project's Artifacts page — useful for comparing checkpoints across experiments.

Limits: ~100 MB per file, 1000 files per call, 120s upload timeout. Missing or unreadable files are skipped with a warning.

What's next

On this page