Skip to content

feat(settings): a Hugging Face token in Settings → Components - #379

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-ws42o4
Oct 15, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-ws42o4

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: gated models (pyannote's speaker diarization, some GGUF local models, a gated Laya model) needed HF_TOKEN in the server's environment, which the compose files don't pass on, so a Docker install had no way to use them without editing compose. A 401 said "set HF_TOKEN".

After: Settings → Components has Hugging Face token (a secret field). Downloads of gated models use it, and the error says to add it there. HF_TOKEN still wins when it's set.

How: components.hf_token is a new secret setting (encrypted, write-only like the other keys, validated as a token), with HF_TOKEN as its environment override. components.hf_token(cfg) is what the local-model download, Laya's snapshot_download and pyannote use. The token goes only to huggingface.co.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests. (test_a_hugging_face_token_in_settings_downloads_gated_models)
  • My change requires documentation updates, and I have updated docs/ accordingly. (components.md, local-models.md, processing.md)
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. (n/a)

Done questions (AGENTS.md)

  • Goal: one more environment-only setting is in the web app; merged on green CI.
  • Agents: PUT /api/v1/settings/components with hf_token.
  • Zero setup: optional; nothing changes without it.
  • Fewest clicks: one field.
  • Configurable: editable in Settings, empty by default; not in the wizard.
  • Light: n/a.
  • Private and secure: sealed like other secrets, never returned by the API, sent to huggingface.co only; P-SECRETS in threat-model.md names it.
  • Cost: n/a.
  • User decides: off until someone adds a token.
  • Upgrades: HF_TOKEN keeps working and wins; no stored-data change.
  • Honest: docs say where it's set.
  • Tests and docs updated; OpenAPI unchanged (make openapi).
  • Open: n/a.
  • Reported in the thread; refine later: none.

🤖 Generated with Claude Code

https://claude.ai/code/session_014Y4mUBxDN6pTR2fykqrfYV


Generated by Claude Code

Gated models (pyannote's speaker diarization, some GGUF models) needed HF_TOKEN in the
environment, which the Docker compose files don't even pass on. components.hf_token is a secret
in Settings → Components and the settings API, kept encrypted and sent to huggingface.co only;
HF_TOKEN still wins when it's set.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Y4mUBxDN6pTR2fykqrfYV
@adeelahmad adeelahmad self-assigned this Oct 15, 2026
@adeelahmad
adeelahmad merged commit e9a9b7d into main Oct 15, 2026
11 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-ws42o4 branch October 15, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants