apache / apache/texera

HuggingFace model browser: X-HF-Token support is dead code (frontend never sends it)

Open
#7,205 1 comment 0 reactions 1 assignee Claimed by @PG1204 View on GitHub
Dominant language
Scala
Stars
314
Forks
187
Avg merge
1d 21h
Merged PRs (30d)
214

Description

### Task Summary

`HuggingFaceModelResource` reads an `X-HF-Token` header (and its docstring says the frontend forwards it), but no frontend code sends it, so model/task browsing is always anonymous.

### Context
Private models never appear and anonymous HF rate limits always apply. Either the frontend should forward the user's token, or the backend token-handling is dead code. This needs a product decision.

### Proposed change
Decide direction:
- Forward: send `X-HF-Token` from the model-select component's `/huggingface/models` and `/tasks` calls.
- Remove: delete the `userToken` / `sanitizeToken` paths and the cache-bypass-on-token logic.

### Required test
Forward -> assert the header is sent; Remove -> update `HuggingFaceModelResourceSpec`.

### Related
Touches the same resource as #7204 (model-browser robustness).

### Task Type

- [x] Refactor / Cleanup
- [ ] DevOps / Deployment / CI
- [ ] Testing / QA
- [ ] Documentation
- [ ] Performance
- [ ] Other

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.