Skip to content

feat(lane D): Hippius Hub migration to huggingface_hub (king publish + pull-king) - #1058

Merged
tensorlink-dev merged 4 commits into
mainfrom
hippius-hub-hf-migration
Dec 1, 2026
Merged

tensorlink-dev merged 4 commits into
mainfrom
hippius-hub-hf-migration

Conversation

@tensorlink-dev

Copy link
Copy Markdown
Contributor

Why

Live 2026-12-01 21:00 UTC: the Hippius registry API refuses model pushes (manifest PUT 403: "the registry API takes container images, not models … Push models with huggingface_hub: set HF_ENDPOINT=https://hub.hippius.com and use a hip_ key"). The patched king publish (HfApi on hub.hippius.com) succeeded at 21:14: https://hub.hippius.com/cascade/laned-king-c4096-5hpkleju

What (one feature: Hippius Hub migration to huggingface_hub)

  1. Lane D publication (cascade/lane_d/mirrors.py; publish.py via the folded-in fix(lane D): king Hub repo name is lowercase (first live publish 401) #1057 commit)
    • Writer: HfApi(endpoint=HIPPIUS_HF_ENDPOINT or https://hub.hippius.com, token=HIPPIUS_HF_TOKEN) for create_repo / upload_file / takedown delete_file. No HIPPIUS_HF_TOKEN: MirrorError (HF_TOKEN / HIPPIUS_HUB_TOKEN are not borrowed).
    • Reader: an anonymous HfApi(endpoint=…, token=False) for read-back, list, size (RepoMirror(read_api=), open_live_mirrors(hub_read_api=)).
    • Endpoint and token are set per instance. Global HF_ENDPOINT / HF_TOKEN are never read or set, because the validator and trainer use real HF for fallbacks and datasets.
    • 401/403 counts as missing on reads only (the Hub answers 401 for a missing repo; probed anonymously). A write or takedown answered 401/403 raises.
    • Lowercase repo names: fix(lane D): king Hub repo name is lowercase (first live publish 401) #1057 is folded in (its commit is cherry-picked here). The HippiusApi HfUriError create_repo catch from the hot patch is dropped, since HfApi doesn't need it.
  2. Miner cascade lane-d pull-king: anonymous_hub_api() returns HfApi(endpoint=https://hub.hippius.com, token=False) (HIPPIUS_HF_ENDPOINT overrides it). The signature and hash checks are unchanged.
  3. Trainer/validator checkpoint pushes/pulls (cascade/shared/hippius.py): NOT changed. Design note below. Owner decides.

Docs: MINER_LANE_D.md (pull-king endpoint, king link), OPERATOR.md (new "Hub credentials for king publication (HIPPIUS_HF_TOKEN)" paragraph and the king-publish row), LANE_D.md, the king-publish unit template comment.

Design note for (3): why upload_dir_to_hub is untouched

Read-only anonymous probes, 2026-12-01:

probe result
registry.hippius.com OCI HEAD manifests/sha256:0d7e107f… for lane A king cascade/ckpt-r824229856147703689-challenger-cascade-moe-v2-120m-u164 200 (old pointers still resolve the way released code reads them)
hub.hippius.com/api/models/<that repo> 200, "digests":["sha256:0d7e107f…"], "sha":"c8e3e78c…"
hub.hippius.com/<that repo>/resolve/sha256:0d7e…/config.json 200 (the HF API also resolves OCI digests as revisions)
new HfApi-pushed king cascade/laned-king-c4096-5hpkleju on hub API 200, "sha":"ebc14b66…" (40-hex git commit), no digests
the same king on the OCI registry, manifests/main and manifests/ebc14b66… 404

So a push through HfApi upload_folder returns a git commit sha, not an OCI sha256: digest, and the result is not visible on the OCI registry. As pointers, the released readers would fail both ways:

  • @sha256: → hippius_hub.snapshot_download on registry.hippius.com: the repo isn't there (404), and no sha256 digest exists to pin.
  • @hf:<sha> → released fetch_from_hub calls huggingface_hub.snapshot_download with no endpoint, so it goes to huggingface.co, where the repo doesn't exist.

Validators and satellites that never update (owner 2026-11-30) could not read new lane A/B/C checkpoints. This PR stops at (1)+(2) as instructed. Existing @sha256: pointers stay readable, and their read path is unchanged. Options for the owner:

  • (a) A new pointer form, e.g. @hh:<commit> (hub.hippius.com revision). It needs a validator release, and the satellites would burn on it.
  • (b) Ask Hippius to allow OCI model pushes for cascade, or to expose HF-pushed repos with a sha256: digest on the registry (the hub already lists digests for OCI-pushed repos).
  • (c) Push via HfApi and read new refs through hub.hippius.com, which resolves both old sha256: revisions and commit shas. This is a reader change for every validator.

Until then the trainer's upload_dir_to_hub (hippius_hub OCI push) is expected to hit the same 403. The upload_dir_to_hub_or_hf HF fallback path is untouched.

Tests (torch-free, fake huggingface_hub.HfApi)

  • New tests/unit/test_lane_d_hub_hf_migration.py (14). It covers: writer endpoint and hip_ key per instance; os.environ unchanged; HIPPIUS_HF_ENDPOINT override, never HF_ENDPOINT; no key → MirrorError; reads anonymous; takedown through the writer; 401/403 → missing on get/size/list; 401/403 on upload/delete raises; full publish_king with split clients; pull-king anonymous on hub.hippius.com, end to end from the publisher's repo. All 14 fail on origin/main.
  • tests/accept/w10/test_w10_pull_king.py: the anonymous-client test now pins HfApi(endpoint=hub.hippius.com, token=False) (README contract updated).
  • From fix(lane D): king Hub repo name is lowercase (first live publish 401) #1057: tests/unit/test_lane_d_hub_repo_lowercase.py.
  • Green, one file at a time: w13/* (all), w10 pull_king/cli/rules, test_lane_d_king_publish_streaming, test_incident_rules, w_launch lessons guards, r5 job templates, w12a lane guides. Ruff clean.

PATHS: tests/accept/w13/PATHS gains the new test. W10's lane_d_pull_king.py and docs are already in W10 PATHS.

Supersedes #1057 (closed after this PR opened).

🤖 Generated with Claude Code

https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe

tensorlink-dev and others added 2 commits December 1, 2026 21:15
…ublish 401)

The first live king publish failed with 401 Unauthorized on
cascade/laned-king-c4096-5HpKLEju/manifests/main. The Hippius registry
(Harbor) answers 401 "un-recognized request" for any call on a repository
name with an uppercase letter (anonymous probe: the existing
cascade/ckpt-...-king-toto2-4m answers 200, the same name with KING answers
401; a missing lowercase laned-king repo answers 404). hub_repo used the raw
mixed-case ss58 prefix. It now lowercases hotkey8 and refuses any result that
is not a valid OCI repository name. The publisher and pull-king share
hub_repo, so both sides move together; no king was ever published, so no
existing repo is renamed.

Not upload_file vs upload_folder: both GET manifests/main through the same
fetch_manifest(missing_ok=True) (404 tolerated, 401 raised), and the 401 hit
the read-back pre-check (hf_hub_download) before any upload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe
…us.com

Live 2026-12-01: the Hippius registry API refuses model pushes (manifest PUT
403, "Push models with huggingface_hub: set HF_ENDPOINT=https://hub.hippius.com
and use a hip_ key"). The Hub mirror now writes (create, upload, takedown
delete) through HfApi(endpoint=HIPPIUS_HF_ENDPOINT or https://hub.hippius.com,
token=HIPPIUS_HF_TOKEN) and reads (read-back, list, size) through an anonymous
HfApi(token=False) on the same endpoint; endpoint/token are per instance, the
global HF_ENDPOINT / HF_TOKEN are never read or set. 401/403 counts as missing
on reads only. pull-king reads hub.hippius.com anonymously via HfApi.
Lane A/B/C checkpoint pushes/pulls are unchanged (design note in the PR).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cascade Ignored Ignored Preview Dec 1, 2026 9:53pm UTC

Request Review

tensorlink-dev and others added 2 commits December 2, 2026 07:41
…eam first

On base it failed with PullError hippius_hub_missing instead of an assertion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe
@tensorlink-dev
tensorlink-dev added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit cbaff7d Dec 1, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant