Skip to content

v0.4.1

Choose a tag to compare

@github-actions github-actions released this 19 Nov 17:26
· 7 commits to main since this release

Datasets, a faster first download through the pull-through cache, and a metrics endpoint.

This is the first published release since v0.3.1. A v0.4.0 tag exists but nothing was published from it: it did not compile for 32-bit ARM, which stopped the release at the image build. v0.4.1 is that release with the fix.

Before you upgrade: this release changes the metadata database (schema version 3). The upgrade runs by itself at start and a v0.3.1 data directory needs nothing done to it, but v0.3.1 cannot open the database afterwards. Take a backup first if you might go back: modelctl backup now.

Datasets

Dataset repositories work everywhere model repositories do: mirror them, cache them on demand, push, pull, upload and serve them.

modelctl mirror --repo-type dataset stanfordnlp/imdb
export HF_ENDPOINT=http://localhost:8080
python -c "from datasets import load_dataset; print(load_dataset('stanfordnlp/imdb'))"
  • snapshot_download(repo_type="dataset"), hf download --repo-type dataset, dataset_info, list_repo_tree, get_paths_info and uploads are tested against the real huggingface_hub.
  • load_dataset("org/name") is tested with the real datasets library, including against datasets mirrored from huggingface.co in the two common layouts (split files at the top level, and configuration directories declared in the dataset card). Other layouts are expected to work but are not tested.
  • The Hub's dataset viewer (parquet conversion, row previews) is not implemented; the library falls back to the repository's own files. See Datasets, including a note on the datasets-server. host name the library derives from HF_ENDPOINT.
  • A model and a dataset of the same name are two repositories.
  • modelctl mirror, push, pull, list, inspect and delete take --repo-type dataset. The REST API has /api/v1/datasets/... beside /api/v1/repos/....
  • In the pull-through allow list a dataset is matched as datasets/namespace/name, so acme/* still means models only.

Pull-through: the first download no longer waits

Until now the first download of a file the registry did not hold waited until the whole file had been fetched and verified, which is longer than Hugging Face clients wait for a large file. Now the file is sent to the clients waiting for it while it is being fetched.

  • The end of the file is held back until the whole of it has matched its digest. A mismatch cuts the download short, so a client cannot end up with a complete file that failed verification. Nothing unverified is ever stored.
  • Files of 1 MiB or less are still sent only after verification.
  • --pull-through-stream=false (REGISTRY_PULL_THROUGH_STREAM) restores the previous behaviour.
  • What this changes about the guarantee for that first request, and the remaining risks, are in the operations guide.

Monitoring

GET /metrics is a Prometheus endpoint: cache hits against upstream fetches, pull-through failures by cause, the fetch queue, uploads and mirrors, what is stored, and the age of the last backup. No metric names a repository, a file or a token. It follows read access. The operations guide lists every metric, with a scrape configuration and three alerts.

Also new

  • get_paths_info (POST /api/{models,datasets}/{repo}/paths-info/{rev}), which HfFileSystem uses, and file sizes in model_info and dataset_info when asked with files_metadata=True.
  • Security reports can be sent to security@model.delivery as well as through GitHub.
  • Release archives carry a signed build attestation, and the image carries build provenance and an SBOM. Base images are pinned by digest. Verifying a release.
  • Alternatives: other open-source projects in this space, and when one of them is the better choice.

Fixed

  • modelctl pull no longer fails on every retry when a partial file is stale or the server ignores a resume request; it discards the partial and downloads the file afresh.
  • A stored file that could not be removed from storage during delete or gc keeps its record, so a later gc retries it. Counts and bytes freed report only what was actually removed.
  • --backup-keep N keeps exactly N, and backup names are never reused, however many are taken in one second.

Upgrade notes

  • The database upgrade is described at the top. A backup taken by v0.3.1 restores and is upgraded on start.
  • datasets and metrics are now reserved and cannot be used as a namespace for new repositories. An existing repository under either name stays readable and can be deleted, but takes no new revisions.
  • The test suite now runs against huggingface_hub 2.4 and datasets 5.2.
  • The tenth and later backups taken within one second are named registry-<time>_a10.db and so on, so that names sort in the order taken.

Full Changelog: v0.3.1...v0.4.1