ticket #62: spike — is a Hugging Face token worth using?
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bf7b6a3 parent: 2c18fab added
.tickets/issues/0062-spike-hugging-face-token.yaml +64 -0 | new file mode 100644 | ||
| @@ -0,0 +1,64 @@ | ||
| 1 | +# Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | |
| 2 | +id: 62 | |
| 3 | +title: "Spike: is a Hugging Face token worth using (gated models, rate limits, private repos)?" | |
| 4 | +state: open | |
| 5 | +author: | |
| 6 | + name: k33g | |
| 7 | + email: ph.charriere@gmail.com | |
| 8 | +createdAt: 2026-11-27T07:30:00.000Z | |
| 9 | +updatedAt: 2026-11-27T07:30:00.000Z | |
| 10 | +labels: | |
| 11 | + - "spike" | |
| 12 | + - "area::models" | |
| 13 | + - "priority::low" | |
| 14 | +epic: "Model management" | |
| 15 | +related: | |
| 16 | + - 57 | |
| 17 | + - 33 | |
| 18 | +body: | | |
| 19 | + Asked by the user (2026-11-27, while testing the TUI's Models screen): check whether using a Hugging Face token is worth it. | |
| 20 | + | |
| 21 | + ## What is already true (read in the code, 2026-11-27) | |
| 22 | + - Downloads (`rzb models pull`, the TUI's Models screen, and loading an uncached model on its first request) go through `MLXEngine` → `HubDownloader(client: HubClient(), …)`. swift-huggingface's `HubClient()` already looks for a token, in this order: `HF_TOKEN`, `HUGGING_FACE_HUB_TOKEN`, `HF_TOKEN_PATH`, `$HF_HOME/token`, `~/.cache/huggingface/token` (where `hf auth login` writes it), `~/.huggingface/token`. So a token present on the Mac is probably already used; nothing in razorbill says so. | |
| 23 | + | |
| 24 | + ## Questions | |
| 25 | + 1. **Gated models** (e.g. `meta-llama/*`, some Gemma/Mistral repos; most `mlx-community/*` conversions are not gated): without a token, what error does `rzb models pull` give — a clear "accept the licence and log in" or an opaque 401/403? With a token whose account accepted the licence, does it work? | |
| 26 | + 2. **Rate limits**: Hugging Face limits anonymous downloads more than authenticated ones. Do large multi-file downloads (a 9B model, a full cache refresh) hit 429 without a token? Speed difference? | |
| 27 | + 3. **Private repositories** (the user's own conversions): do they work with a token, and is the error without one understandable? | |
| 28 | + 4. **Which code paths use it**: confirm the server's on-demand download and the TUI download use the same `HubClient()` detection (run on the Mac with and without `HF_TOKEN`). | |
| 29 | + 5. **Safety**: the token must never appear in logs, `/rzb/status`, error messages or `rzb tui` (it stays an environment variable or the HF token file, never a razorbill config key). | |
| 30 | + | |
| 31 | + ## Possible outcomes | |
| 32 | + - Docs only (EN+FR): "for gated or private models, run `hf auth login` or set `HF_TOKEN`", plus the error to expect without it. | |
| 33 | + - Clearer errors: map 401/403 from the Hub to a message naming the fix (`model_gated` / `model_private`?). | |
| 34 | + - `rzb version` or `rzb models` showing whether a token was found (never its value), and/or the TUI's Models screen. | |
| 35 | + - Nothing more if it already works and the errors are clear. | |
| 36 | + | |
| 37 | + ## Output | |
| 38 | + Answers to the five questions (checked on the Mac), then the tickets for whatever is worth doing. | |
| 39 | +tasks: | |
| 40 | + - id: 1 | |
| 41 | + title: "Pull a gated, a private and a large public model with and without HF_TOKEN on the Mac; note errors and speed" | |
| 42 | + state: open | |
| 43 | + priority: low | |
| 44 | + author: | |
| 45 | + name: k33g | |
| 46 | + email: ph.charriere@gmail.com | |
| 47 | + createdAt: 2026-11-27T07:30:00.000Z | |
| 48 | + - id: 2 | |
| 49 | + title: "Check the server's on-demand download and the TUI download use the same token detection; check nothing logs the token" | |
| 50 | + state: open | |
| 51 | + priority: low | |
| 52 | + author: | |
| 53 | + name: k33g | |
| 54 | + email: ph.charriere@gmail.com | |
| 55 | + createdAt: 2026-11-27T07:30:00.000Z | |
| 56 | + - id: 3 | |
| 57 | + title: "Decide: docs only, clearer errors, and/or a 'token found' indication; write the tickets" | |
| 58 | + state: open | |
| 59 | + priority: low | |
| 60 | + author: | |
| 61 | + name: k33g | |
| 62 | + email: ph.charriere@gmail.com | |
| 63 | + createdAt: 2026-11-27T07:30:00.000Z | |
| 64 | +comments: [] | |
| new file mode 100644 | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | +# Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | ||
| 2 | +id: 62 | ||
| 3 | +title: "Spike: is a Hugging Face token worth using (gated models, rate limits, private repos)?" | ||
| 4 | +state: open | ||
| 5 | +author: | ||
| 6 | + name: k33g | ||
| 7 | + email: ph.charriere@gmail.com | ||
| 8 | +createdAt: 2026-11-27T07:30:00.000Z | ||
| 9 | +updatedAt: 2026-11-27T07:30:00.000Z | ||
| 10 | +labels: | ||
| 11 | + - "spike" | ||
| 12 | + - "area::models" | ||
| 13 | + - "priority::low" | ||
| 14 | +epic: "Model management" | ||
| 15 | +related: | ||
| 16 | + - 57 | ||
| 17 | + - 33 | ||
| 18 | +body: | | ||
| 19 | + Asked by the user (2026-11-27, while testing the TUI's Models screen): check whether using a Hugging Face token is worth it. | ||
| 20 | + | ||
| 21 | + ## What is already true (read in the code, 2026-11-27) | ||
| 22 | + - Downloads (`rzb models pull`, the TUI's Models screen, and loading an uncached model on its first request) go through `MLXEngine` → `HubDownloader(client: HubClient(), …)`. swift-huggingface's `HubClient()` already looks for a token, in this order: `HF_TOKEN`, `HUGGING_FACE_HUB_TOKEN`, `HF_TOKEN_PATH`, `$HF_HOME/token`, `~/.cache/huggingface/token` (where `hf auth login` writes it), `~/.huggingface/token`. So a token present on the Mac is probably already used; nothing in razorbill says so. | ||
| 23 | + | ||
| 24 | + ## Questions | ||
| 25 | + 1. **Gated models** (e.g. `meta-llama/*`, some Gemma/Mistral repos; most `mlx-community/*` conversions are not gated): without a token, what error does `rzb models pull` give — a clear "accept the licence and log in" or an opaque 401/403? With a token whose account accepted the licence, does it work? | ||
| 26 | + 2. **Rate limits**: Hugging Face limits anonymous downloads more than authenticated ones. Do large multi-file downloads (a 9B model, a full cache refresh) hit 429 without a token? Speed difference? | ||
| 27 | + 3. **Private repositories** (the user's own conversions): do they work with a token, and is the error without one understandable? | ||
| 28 | + 4. **Which code paths use it**: confirm the server's on-demand download and the TUI download use the same `HubClient()` detection (run on the Mac with and without `HF_TOKEN`). | ||
| 29 | + 5. **Safety**: the token must never appear in logs, `/rzb/status`, error messages or `rzb tui` (it stays an environment variable or the HF token file, never a razorbill config key). | ||
| 30 | + | ||
| 31 | + ## Possible outcomes | ||
| 32 | + - Docs only (EN+FR): "for gated or private models, run `hf auth login` or set `HF_TOKEN`", plus the error to expect without it. | ||
| 33 | + - Clearer errors: map 401/403 from the Hub to a message naming the fix (`model_gated` / `model_private`?). | ||
| 34 | + - `rzb version` or `rzb models` showing whether a token was found (never its value), and/or the TUI's Models screen. | ||
| 35 | + - Nothing more if it already works and the errors are clear. | ||
| 36 | + | ||
| 37 | + ## Output | ||
| 38 | + Answers to the five questions (checked on the Mac), then the tickets for whatever is worth doing. | ||
| 39 | +tasks: | ||
| 40 | + - id: 1 | ||
| 41 | + title: "Pull a gated, a private and a large public model with and without HF_TOKEN on the Mac; note errors and speed" | ||
| 42 | + state: open | ||
| 43 | + priority: low | ||
| 44 | + author: | ||
| 45 | + name: k33g | ||
| 46 | + email: ph.charriere@gmail.com | ||
| 47 | + createdAt: 2026-11-27T07:30:00.000Z | ||
| 48 | + - id: 2 | ||
| 49 | + title: "Check the server's on-demand download and the TUI download use the same token detection; check nothing logs the token" | ||
| 50 | + state: open | ||
| 51 | + priority: low | ||
| 52 | + author: | ||
| 53 | + name: k33g | ||
| 54 | + email: ph.charriere@gmail.com | ||
| 55 | + createdAt: 2026-11-27T07:30:00.000Z | ||
| 56 | + - id: 3 | ||
| 57 | + title: "Decide: docs only, clearer errors, and/or a 'token found' indication; write the tickets" | ||
| 58 | + state: open | ||
| 59 | + priority: low | ||
| 60 | + author: | ||
| 61 | + name: k33g | ||
| 62 | + email: ph.charriere@gmail.com | ||
| 63 | + createdAt: 2026-11-27T07:30:00.000Z | ||
| 64 | +comments: [] | ||