huggingface-hub

huggingface-hub is a skill for Claude Code, Codex from furkangonel/cowrangler. It costs 22 tokens per session (2,556 once invoked), scanned A, original, MIT.

A connection to the Hugging Face Hub, a website where people share machine-learning models and datasets, for finding, running, and publishing them.

In plain words
What is it for?
Find suitable pre-trained models, run them locally or through the Inference API, load datasets, and upload trained models or datasets.
Why use it?
It brings model and dataset discovery, local use, and remote API access into one documented workflow, including the required sign-in steps.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Find suitable pre-trained models, run them locally or through the Inference API, load datasets, and upload trained models or datasets.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/furkangonel/cowrangler/huggingface-hub
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add furkangonel/cowrangler --skill huggingface-hub
Clone the repo
git clone --depth 1 https://github.com/furkangonel/cowrangler

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for huggingface-hub

README.md
[![agentmods](https://agentmods.dev/badge/skills/furkangonel/cowrangler/huggingface-hub/github.svg)](https://agentmods.dev/skills/furkangonel/cowrangler/huggingface-hub)
Your own site
<a href="https://agentmods.dev/skills/furkangonel/cowrangler/huggingface-hub"><img src="https://agentmods.dev/badge/skills/furkangonel/cowrangler/huggingface-hub/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for huggingface-hub

Your own site · 80×15
<a href="https://agentmods.dev/skills/furkangonel/cowrangler/huggingface-hub"><img src="https://agentmods.dev/badge/skills/furkangonel/cowrangler/huggingface-hub.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,556 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.02556
Opus 5 $0.00011 $0.01278
Sonnet 5 $0.00004 $0.00511
Haiku 4.5 $0.00002 $0.00256

Measured 10d ago against content hash e77c210448a6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

huggingface-hub scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

r = requests.post(url, headers=headers, json=payload)
bundled_skills/mlops/huggingface-hub/SKILL.md · 376 lines

How it starts

The opening of the file, as written. The whole thing — 376 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hugging Face Hub SOP

Discover, load, run, and publish models and datasets on the Hugging Face Hub. Covers CLI auth, transformers pipelines, the Inference API, push_to_hub, and dataset loading.

When to Use

  • User wants to find the right pre-trained model for a task
  • User wants to load and run a HF model locally
  • User wants to call the HF Inference API without loading weights locally
  • User wants to push a fine-tuned model or dataset to the Hub
  • User wants to work with HF datasets library

Part 1 — Auth Setup

1. Get a Token

  1. Go to https://huggingface.co/settings/tokens
  2. Click New token → name it → select Write role (needed for push_to_hub) or Read (for private model downloads)
  3. Copy the token (starts with hf_)

2. Login via CLI

pip install huggingface_hub

huggingface-cli login
# Paste your token when prompted; it is saved to ~/.cache/huggingface/token

Or set as environment variable (CI/CD):

export HUGGINGFACE_TOKEN="hf_..."

Or in ~/.cowrangler/credentials.env:

HUGGINGFACE_TOKEN=hf_...

3. Programmatic Auth

from huggingface_hub import login
import os

login(token=os.environ.get("HUGGINGFACE_TOKEN"))

Part 2 — Model Discovery

Search by Task

from huggingface_hub import HfApi

api = HfApi()

# Search models by task tag
models = api.list_models(
    task="text-classification",
    sort="downloads",
    direction=-1,
    limit=10,
)

for m in models:
    print(f"{m.modelId:50s}  downloads={m.downloads:>10,}  likes={m.likes}")

Common task tags: text-classification, token-classification, question-answering, text-generation, summarization, translation, fill-mask, sentence-similarity, image-classification, object-detection, automatic-speech-recognition, text-to-speech, image-to-text

Filter by Language and Library

models = api.list_models(
    task="text-classification",
    language="tr",       # ISO 639-1 language code
    library="transformers",
    sort="downloads",
    direction=-1,
    limit=5,
)
for m in models:
    print(m.modelId, m.downloads)

Read the full file on GitHub · 376 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 376 lines · 22 tokens per session scan A e77c210448a6

Subscribe to this mod's changes

huggingface-hub is a skill published in the GitHub repository furkangonel/cowrangler (2 stars, last pushed 3d ago), licensed MIT. It adds 22 tokens to every session and 2,556 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.