richfrem/agent-plugins-skills / plugins/dev-utils/.apm/skills/managing-huggingface-assets
managing-huggingface-assets
VerifiedSets up, downloads from and uploads to HuggingFace repositories with credential hygiene and exponential backoff. Use to validate HuggingFace credentials and dataset structure, download files, snapshots or model weights, or upload files, folders, learning snapshots and JSONL traces. Not for searching the Hub or other storage providers.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.7 KB |
| evals/evals.json | config | 2.1 KB |
| references/acceptance-criteria.md | markdown | 2.2 KB |
| references/download.md | markdown | 1.7 KB |
| references/fallback-tree.md | markdown | 3.4 KB |
| references/init.md | markdown | 1.4 KB |
| references/upload.md | markdown | 2.1 KB |
| scripts/hf_config.py | script | 6.2 KB |
| scripts/hf_download.pyexecutable | script | 6.5 KB |
| scripts/hf_init.py | script | 2.7 KB |
| scripts/hf_upload.py | script | 13.2 KB |
references/download.md
View on GitHub# HuggingFace download (`download` mode)
Fetches files, folder snapshots, and model weights from HuggingFace repositories with built-in exponential backoff.
## Critical Constraints
- **Credential Hygiene**: Consume `HUGGING_FACE_TOKEN` exclusively via environment variables; never embed tokens in arguments or logs.
- **Rate-Limit Resilience**: Operations must employ exponential backoff (up to 5 retries) on HTTP 429/503 errors.
- **Target Path Containment**: Restrict download destinations to designated working folders (`./local_data`, `./models`).
- **Download Scope**: Dedicated to fetching assets. For uploading snapshots or soul traces, use the `upload` mode.
## Dependencies
Requires Python 3.8+ (standard library only).
## Quick start
```bash
# Download a single file from repository
python3 scripts/hf_download.py \
--filename data/soul_traces.jsonl \
--local-dir ./local_data
# Download a model snapshot with pattern matching
python3 scripts/hf_download.py \
--repo-id unsloth/gemma-4-12b-it-GGUF \
--repo-type model \
--allow-patterns "*UD-Q4_K_XL.gguf" \
--local-dir ./models
```
## Workflow
1. **Phase 1: Environment & Token Check**: Verify `huggingface_hub` installation and presence of `HUGGING_FACE_TOKEN`.
2. **Phase 2: Target Path & Parameter Selection**: Select repository ID, asset type (`dataset` or `model`), and destination path.
3. **Phase 3: Execution with Backoff**: Run `hf_download.py` via CLI or asynchronous Python API.
4. **Phase 4: Asset Integrity Verification**: Confirm that target files or model artifacts are present and non-empty.
## Verification
```bash
# Verify CLI help and script loading
python3 scripts/hf_download.py --help
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |