Commit 0897af3
committed
feat(lumen-app): hf_client helper with HF_TOKEN auto-attach + startup detection log
Single `models::hf_client(timeout)` builder consolidates all HuggingFace
HTTP touchpoints (`fetch_hub_sha`, `models::download`, periodic
`check_model_updates`). When `HF_TOKEN` (or legacy
`HUGGING_FACE_HUB_TOKEN`) env var is set, attaches
`Authorization: Bearer <token>` as a default header on every request
— unlocks gated HF repos and raises the anonymous rate-limit ceiling
for the update-check sweep.
Token is read from env only; no persistence in config.toml (avoids
plaintext-secret storage; future iteration can add Keychain). Startup
log reports detection status by env var name only, never the token
value, so users see "[lumen-app] HuggingFace token detected via
$HF_TOKEN — gated repos accessible" if it's set, or a clear "no
HuggingFace token configured" otherwise.1 parent 26cd2a5 commit 0897af3
3 files changed
Lines changed: 74 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
296 | 297 | | |
297 | 298 | | |
298 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
20 | 50 | | |
21 | 51 | | |
22 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
448 | 485 | | |
449 | 486 | | |
450 | 487 | | |
| |||
517 | 554 | | |
518 | 555 | | |
519 | 556 | | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
| 557 | + | |
524 | 558 | | |
525 | 559 | | |
526 | 560 | | |
| |||
0 commit comments