huggingface-best
🤖 AI Summary
This skill parses a user's task and device constraints, queries Hugging Face leaderboards for top models, filters results by device memory, and returns a benchmark comparison table.
How to Install
Claude Code:
git clone --depth 1 https://github.com/huggingface/skills.git && cp skills/skills/huggingface-best ~/.claude/skills/huggingface-best -r# HuggingFace Best Model Finder
Finds the best models for a task by querying official HF benchmark leaderboards, enriching
results with model size data, filtering for what fits on the user's device, and returning a
comparison table with benchmark scores.
---
## Step 1: Parse the request
Extract from the user's message:
- **Task**: what they want the model to do (coding, math/reasoning, chat, OCR, RAG/retrieval, speech recognition, image classification, multimodal, agents, etc.)
- **Device**: hardware constraints (MacBook M-series 8/16/32/64GB unified memory, RTX GPU with VRAM amount, CPU-only, cloud/no constraint, etc.)
If device is not mentioned, skip filtering entirely and return the highest-performing models regardless of size. If the task is genuinely ambiguous, ask one clarifying question.
### Device → max parameter budget
When a device is specified, extract its available memory (unified RAM for Apple Silicon, VRAM for discrete GPUs) and apply:
- **fp16 max params (B)** ≈ memory (GB) ÷ 2
- **Q4 max params (B)** ≈ memory (GB) × 2
Examples: 16GB → 8B fp16 / 32B Q4 — 24GB VRAM → 12B fp16 / 48B Q4 — 8GB → 4B fp16 / 16B Q4
---
## Step 2: Find relevant benchmark datasets
Fetch the full list of official HF benchmarks:
```bash
curl -s -H "Authorization: Bearer $(cat ~/.cache/huggingface/token)" \
"https://huggingface.co/api/datasets?filter=benchmark:official&limit=500" | jq '[.[] | {id, tags, description}]'
```
Read the returned list and select the datasets most relevant to the user's task — match on dataset id, tags, and description. Use your judgment; don't limit yourself to 2-3. Aim for comprehensive coverage: if 5 benchmarks clearly cover the task, use all 5.
---
## Step 3: Fetch top models from leaderboards
For each selected benchmark dataset:
```bash
curl -s -H "Authorization: Bearer $(cat ~/.cache/huggingface/token)" \
"https://huggingface.co/api/datasets///leaderboard" | jq '[.[:15] | .[] | {rank, modelId, value, verified}]'
```
Collect model IDs and scores across all benchmarks. If a leaderboard returns an error (404, 401, etc.), skip it and note it in the output.
---
## Step 4: Enrich with model metadata
For the top 10-15 candidate model IDs, get model infos.
```bash
# REST API
curl -s -H "Authorization: Bearer $(cat ~/.cache/huggingface/token)" \
"https://huggingface.co/api/models/org/model1" | jq '{safetensors, tags, cardData}'
# CLI (hf-cli)
hf models info org/model1 --json | jq '{safetensors, tags, cardData}'
```
Extract from each response:
- **Parameters**: `safetensors.total` → convert to B (e.g., 7_241_748_480 → "7.2B")
- **License**: from model card tags (look for `license:apache-2.0`, `license:mit`, etc.)
- If `safetensors` is absent, parse size from the model name (look for "7b", "8b", "13b", "70b", "72b", etc.)
---
## Step 5: Filter and rank
**If a device was specified:**
1. Remove models exceeding the fp16 parameter budget for the device
2. Flag models that fit only with Q4 qua
Details
| Category | AI/ML → ml |
| Source | huggingface/skills |
| SKILL.md | View on GitHub → |
| Repo Stars | ★ 10.7K |
| Est. per Skill | 357 (shared across 30 skills from this repo) |
| Difficulty | Intermediate |
| Risk Level | N/A |
Related Skills
pptx-official
PPTX creation, editing, and analysis Overview A user may ask you to create, edit, or analyze the con
brand-perception-psychologist
You are a Brand Psychologist and Semiotics Researcher. Your task is to diagnose what a brand's curre
odoo-qweb-templates
Odoo QWeb Templates Overview QWeb is Odoo's primary templating engine, used for PDF reports, website
robius-event-action
Robius Event and Action Patterns Skill Best practices for event handling and action patterns in Make
Works Well With
Skills from the same repository — often designed to work together
hf-mem
hfmem estimates the required memory for inference, including model weights and an optional KV cache,
hf-cli
Install: curl -LsSf https://hf.co/cli/install.sh | bash -s. The Hugging Face Hub CLI tool hf is avai
trl-training
TRL Training Skill You are an expert at using the TRL (Transformers Reinforcement Learning) library