Skip to main content

Python SDK for the ML Artifact Registry

Project description

zvondb

Python SDK for the ML Artifact Registry — track artifacts, their lineage, and versions across ML experiments.

Installation

pip install zvondb

Quick start

from zvondb import Registry

with Registry(project="my-project") as reg:
    exp = reg.ensure_experiment("my-experiment", parent="baseline")

    with exp.start_job(name="train", git_sha="abc123") as job:
        # Resolve input artifacts (walks parent chain)
        data = job.resolve("TrainingData")
        print(f"Using {data.name} v{data.version} from {data.path}")

        # ... train your model ...

        # Register output artifact
        job.create(
            "TrainedModel",
            type="model",
            storage_name="s3",
            description="Model trained on latest data",
            metadata={"val_loss": 0.15},
            tags=["v1"],
        )
        # Or use create_with_info() to get version and other details
        artifact = job.create_with_info(
            "TrainedModel",
            type="model",
            storage_name="s3",
            description="Model trained on latest data",
            metadata={"val_loss": 0.15},
        )
        print(f"Created {artifact.name} v{artifact.version} at {artifact.path}")

        job.complete()

Configuration

Environment variable Constructor param Default Description
ZVONDB_URL base_url http://localhost:8000 Registry server URL
ZVONDB_API_KEY api_key "" API authentication token

Key concepts

  • Registry — entry point; manages projects and experiments
  • Experiment — a branch of work that can inherit artifacts from a parent experiment
  • Job — a unit of work that consumes and produces artifacts
  • Artifact — a versioned, typed piece of data with metadata, tags, and lineage

Registering external data

exp = reg.get_experiment("baseline")
exp.register("TrainingData", type="dataset", path="s3://bucket/data/v3", description="External dataset")

# Jobs can now resolve it
with exp.start_job(name="train", git_sha="abc") as job:
    data = job.resolve("TrainingData")

W&B integration

with exp.start_job(name="train", git_sha="abc123") as job:
    job.inject_wandb_env()  # Sets WANDB_API_KEY, WANDB_PROJECT, WANDB_RUN_ID etc.
    # Tracking URL auto-set to https://wandb.ai/{entity}/{project}/runs/{job_id}

    # Frameworks like Axolotl that respect W&B env vars just work.
    # For manual usage:
    import wandb
    wandb.init()
    wandb.log({"loss": 0.5})

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zvondb-0.3.3.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zvondb-0.3.3-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file zvondb-0.3.3.tar.gz.

File metadata

  • Download URL: zvondb-0.3.3.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for zvondb-0.3.3.tar.gz
Algorithm Hash digest
SHA256 89327745947aa1c89dc85ba349c745d49c81187ab6c40cf57e7410560e5aa303
MD5 04be473e22586de9ba74c54176c42942
BLAKE2b-256 e676d77e46fe9b15c45f63440f77ff3380595253a5e169f2a36003d07836c677

See more details on using hashes here.

File details

Details for the file zvondb-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: zvondb-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for zvondb-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e378ed0a1bb4b146c4beb7f8228df0c38aa764e1fcf604cabe870f39029fff45
MD5 2578d655659a59f7b75022c0a1fbaf34
BLAKE2b-256 b12d3feb68bbb29073cb82b371e2f2bf8f526104c3976e5ffd3659b2371d0bf9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page