Skip to content
Back to skills

Hf Download

ASecurity

Download primitives for HuggingFace assets - files, folder snapshots, and model weights with exponential backoff on rate limits. Use when pulling models, datasets, or caches from HuggingFace to the local environment.

  • 7 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentspythonbashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned October 3, 2026

npx -y skills add richfrem/agent-plugins-skills --skill hf-download --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hf Download?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Hf Download
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/richfrem-hf-download/badge)](https://www.skillsdirectory.com/skills/richfrem-hf-download)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: hf-download
plugin: dev-utils
description: >
  Download primitives for HuggingFace assets - files, folder snapshots, and model weights with exponential backoff on rate limits. Use when pulling models, datasets, or caches from HuggingFace to the local environment.
allowed-tools: Bash, Read
---

# HuggingFace Download Primitives (`hf-download`)

Fetches files, folder snapshots, and model weights from HuggingFace repositories with built-in exponential backoff.

## Contents

- [Critical Constraints](#critical-constraints)
- [Dependencies](#dependencies)
- [Quick start](#quick-start)
- [Workflow](#workflow)
- [Verification](#verification)
- [References](#references)

## 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 `hf-upload`.

## Dependencies

Requires Python 3.8+ (standard library only).

## Quick start

```bash
# Download a single file from repository
python3 plugins/dev-utils/skills/hf-download/scripts/hf_download.py \
  --filename data/soul_traces.jsonl \
  --local-dir ./local_data

# Download a model snapshot with pattern matching
python3 plugins/dev-utils/skills/hf-download/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 plugins/dev-utils/skills/hf-download/scripts/hf_download.py --help

# Audit skill compliance
python3 plugins/agent-scaffolders/scripts/audit_skill.py plugins/dev-utils/skills/hf-download --mode source
```

## References

- [acceptance-criteria.md](references/acceptance-criteria.md) — Acceptance criteria and verification checklist.
- [fallback-tree.md](references/fallback-tree.md) — Procedural fallback handling for download failures.

Files in this skill

  • SKILL.md2.5 KB
  • acceptance-criteria.md734 B
  • evals/evals.json593 B
  • evals/results.tsv73 B
  • fallback-tree.md1.2 KB
  • requirements.txt24 B
  • scripts/hf_config.py29 B
  • scripts/hf_download.py31 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.