From 22a54f731dcde7d1f922c795f547eb6b864d29dd Mon Sep 17 00:00:00 2001 From: Pascal Linxweiler Date: Thu, 22 Oct 2026 09:39:41 +0200 Subject: [PATCH] Release 0.14.1: use Xet for files over 50 GB huggingface_hub 2.1.1 refuses files over MAX_HTTP_DOWNLOAD_SIZE (50 GB) without Xet; Kaname disables Xet by default for steady progress, so such downloads failed. A download that includes a file over the limit now runs hf with Xet enabled and says so in the job log. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 9 +++++++++ README.md | 3 ++- package-lock.json | 4 ++-- package.json | 2 +- src/worker/download.ts | 11 +++++++++-- src/worker/hf-layout.ts | 14 ++++++++++++++ src/worker/xet.test.ts | 19 +++++++++++++++++++ 7 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 src/worker/xet.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index f029a82..7d059fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); each milestone of step 1 (Hugging Face downloader) is released as a minor version. +## [0.14.1] - 2026-10-22 + +### Fixed + +- Downloads with a file over 50 GB failed with "The file is too large to be downloaded using the + regular download method". `hf` (huggingface_hub 2.1.1) only downloads such files over Xet, which + Kaname turns off by default for steady progress; a download that includes one now uses Xet (noted + in the job log; its progress grows in bursts). + ## [0.14.0] - 2026-10-21 A quality eval next to the speed benchmarks: a short, deterministic check of tool calling, coding and diff --git a/README.md b/README.md index d071cc8..f8eb27a 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,8 @@ Notes on the `hf` CLI (huggingface_hub 2.1.1, pinned in the image): - Interrupted files are **not resumed**: a re-run skips finished files and restarts unfinished ones. Kaname cleans up the leftover partial files. - With Xet transfers the partial file only grows in large bursts, so Kaname disables Xet by default - to show accurate progress. + to show accurate progress. Files over 50 GB can only be downloaded with Xet, so a download that + includes one uses Xet anyway. - `hf` exits successfully even if nothing matched, so Kaname checks every file's size and hash metadata after each download. - Files that already exist in the target folder without hf's metadata (copied in by hand) are diff --git a/package-lock.json b/package-lock.json index e52b96b..d0fadda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kaname", - "version": "0.14.0", + "version": "0.14.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kaname", - "version": "0.14.0", + "version": "0.14.1", "dependencies": { "@base-ui/react": "^1.8.0", "@libsql/client": "^0.18.0", diff --git a/package.json b/package.json index 57531ac..d0bbec6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kaname", - "version": "0.14.0", + "version": "0.14.1", "private": true, "scripts": { "dev": "concurrently -k -n web,worker -c blue,magenta \"npm:dev:web\" \"npm:dev:worker\"", diff --git a/src/worker/download.ts b/src/worker/download.ts index 2cddd7a..93a1b5b 100644 --- a/src/worker/download.ts +++ b/src/worker/download.ts @@ -25,6 +25,7 @@ import { modelDir, removeLocalFile, removeStaleIncomplete, + xetFor, } from "./hf-layout"; import { JobLog } from "./job-log"; import { log } from "./log"; @@ -248,6 +249,12 @@ export class DownloadRunner implements Runner { expected: ExpectedFile[], ): Promise<{ code: number | null; signal: NodeJS.Signals | null; error?: string }> { const env = coreEnv(); + const xet = xetFor(expected, env.HF_HUB_DISABLE_XET); + if (xet.forcedBy.length) { + this.jobLog.system( + `Using Xet for this download: ${xet.forcedBy.slice(0, 3).join(", ")}${xet.forcedBy.length > 3 ? ", …" : ""} is over 50 GB, which hf only downloads with Xet (progress grows in bursts).`, + ); + } const args = [ "download", this.model.repoId, @@ -264,7 +271,7 @@ export class DownloadRunner implements Runner { if (v !== undefined) childEnv[k] = v; } Object.assign(childEnv, { - HF_HUB_DISABLE_XET: env.HF_HUB_DISABLE_XET ? "1" : "0", + HF_HUB_DISABLE_XET: xet.useXet ? "0" : "1", HF_HUB_DISABLE_PROGRESS_BARS: "1", HF_HUB_DISABLE_TELEMETRY: "1", NO_COLOR: "1", @@ -275,7 +282,7 @@ export class DownloadRunner implements Runner { this.jobLog.system( `$ hf download ${this.model.repoId} --revision ${this.job.targetSha} --local-dir ${dir} ` + - `(${expected.length} --include pattern(s); xet ${env.HF_HUB_DISABLE_XET ? "off" : "on"}; token ${env.HF_TOKEN ? "set" : "not set"})`, + `(${expected.length} --include pattern(s); xet ${xet.useXet ? "on" : "off"}; token ${env.HF_TOKEN ? "set" : "not set"})`, ); return new Promise((resolve) => { diff --git a/src/worker/hf-layout.ts b/src/worker/hf-layout.ts index 20ff466..9e21d70 100644 --- a/src/worker/hf-layout.ts +++ b/src/worker/hf-layout.ts @@ -137,3 +137,17 @@ export async function listLocalFiles(dir: string): Promise<{ path: string; size: } return out.sort((a, b) => a.path.localeCompare(b.path)); } + +/** huggingface_hub's MAX_HTTP_DOWNLOAD_SIZE (2.1.1): larger files can only come over Xet. */ +export const MAX_HTTP_DOWNLOAD_BYTES = 50 * 1000 * 1000 * 1000; + +/** + * Whether hf may use Xet for these files. Kaname turns Xet off for steady progress, but hf refuses + * files over 50 GB without it ("too large to be downloaded using the regular download method"), so + * such a job uses Xet regardless. Returns the files that forced it, for the log. + */ +export function xetFor(files: ExpectedFile[], disabledBySetting: boolean): { useXet: boolean; forcedBy: string[] } { + if (!disabledBySetting) return { useXet: true, forcedBy: [] }; + const big = files.filter((f) => f.size > MAX_HTTP_DOWNLOAD_BYTES).map((f) => f.path); + return { useXet: big.length > 0, forcedBy: big }; +} diff --git a/src/worker/xet.test.ts b/src/worker/xet.test.ts new file mode 100644 index 0000000..7104f51 --- /dev/null +++ b/src/worker/xet.test.ts @@ -0,0 +1,19 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { MAX_HTTP_DOWNLOAD_BYTES, xetFor } from "./hf-layout"; + +const f = (path: string, size: number) => ({ path, size, etags: [] }); + +describe("Xet for files over 50 GB", () => { + it("stays off for ordinary files when the setting disables it", () => { + assert.deepEqual(xetFor([f("a.gguf", 20e9), f("b.gguf", MAX_HTTP_DOWNLOAD_BYTES)], true), { useXet: false, forcedBy: [] }); + }); + + it("turns on for a job with a file hf only downloads over Xet", () => { + assert.deepEqual(xetFor([f("small.json", 1000), f("Huge-BF16.gguf", 54e9)], true), { useXet: true, forcedBy: ["Huge-BF16.gguf"] }); + }); + + it("is on whenever the setting allows Xet", () => { + assert.deepEqual(xetFor([f("a.gguf", 1)], false), { useXet: true, forcedBy: [] }); + }); +});