Skip to content

feat: handle gated HuggingFace models gracefully#4

Merged
weklund merged 2 commits intomainfrom
fix/handle-gated-models
Apr 2, 2026
Merged

feat: handle gated HuggingFace models gracefully#4
weklund merged 2 commits intomainfrom
fix/handle-gated-models

Conversation

@weklund
Copy link
Copy Markdown
Owner

@weklund weklund commented Apr 2, 2026

Summary

  • Added gated: bool field to CatalogEntry and marked 4 gated models (Gemma 3 4B/12B/27B, Llama 3.3 8B)
  • Default recommendations (init --accept-defaults) now exclude gated models so zero-config path works without HF auth
  • pull does a pre-flight token check for gated models with an actionable error message (license link, HF_TOKEN instructions, non-gated alternatives)
  • Catches GatedRepoError separately for "has token but hasn't accepted license" case
  • Warns when gated models are explicitly added via --add
  • Documented gated model usage in README

Fixes #3

Test plan

  • 1415 unit tests pass (1400 existing + 15 new)
  • Lint clean (ruff check)
  • New tests cover: catalog gated field parsing, scoring exclude_gated filter, pull token pre-flight check, GatedRepoError handling, CLI error formatting, init gated exclusion + --add warning

🤖 Generated with Claude Code

weklund and others added 2 commits April 1, 2026 22:33
Add gated model awareness across the stack:
- Add `gated` field to CatalogEntry; mark Gemma 3 and Llama 3.3 models
- Exclude gated models from default recommendations so init --accept-defaults
  always picks downloadable models without HF authentication
- Pre-flight token check in pull with actionable error message
- Catch GatedRepoError for "has token but no license" case
- Warn when gated models are explicitly added via --add
- Document gated model usage in README

Fixes #3

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@weklund weklund merged commit 09295e5 into main Apr 2, 2026
1 check passed
@weklund weklund added the enhancement New feature or request label Apr 2, 2026
weklund added a commit that referenced this pull request Apr 4, 2026
## Summary
- Adds `permissions: contents: read` to `ci.yml`,
`integration-nightly.yml`, and `integration-prerelease.yml`
- Resolves all 4 open CodeQL code-scanning alerts
([#1](https://github.com/weklund/mlx-stack/security/code-scanning/1),
[#2](https://github.com/weklund/mlx-stack/security/code-scanning/2),
[#3](https://github.com/weklund/mlx-stack/security/code-scanning/3),
[#4](https://github.com/weklund/mlx-stack/security/code-scanning/4))
- Follows least-privilege principle — these workflows only need read
access to checkout code and run tests
- `release-please.yml` and `publish.yml` already had explicit
permissions

## Test plan
- [ ] CI passes on this PR (confirms `contents: read` is sufficient)
- [ ] CodeQL re-scan shows alerts resolved after merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle gated HuggingFace models gracefully without owning credential management

1 participant