Introduction¶
When building applications or running experiments, the first concrete question is often: “Which model should I use for this task?” Common approaches include browsing blogs, reading community discussions, or picking a checkpoint that “roughly fits” based on parameter count, then cross-referencing scattered evaluation snippets. The Hugging Face Hub already hosts official leaderboard datasets tagged with benchmark:official, but aligning tasks, leaderboards, parameter counts, and local GPU or unified memory constraints still requires repeated API calls and model card lookups.
Below is an introduction to the huggingface-best Skill provided by Hugging Face in the huggingface/skills repository. It encodes the workflow “parse requirements → consult official leaderboards → enrich metadata → filter by device → output a comparison table” as a fixed, agent-executable process suitable for environments that support Agent Skills, such as Cursor, Claude Code, Codex, and Gemini CLI.
What This Is¶
huggingface-best is an Agent Skill focused on “model recommendation and comparison.” It follows the Agent Skills standard and is delivered as a directory containing SKILL.md (YAML frontmatter + operational instructions).
It is maintained by Hugging Face as part of the same Skills ecosystem as the Hub CLI and MCP. The Skill’s description specifies that it should be triggered when users ask for the best/recommended model for a task, which AI model to use, or want to compare models by benchmark scores. Even if users do not mention Hugging Face or benchmarks, the Skill should be enabled whenever the intent is model selection or comparison.
The core output is: based on official HF benchmark leaderboard results, combined with model parameter count and license information, the Skill makes deployability judgments under user-supplied device constraints and returns a ranked recommendation in a Markdown comparison table.
Core Functions¶
Parse Task and Device¶
Extract from the user’s message:
- Task: coding, math/reasoning, chat, OCR, RAG/retrieval, ASR, image classification, multimodal, agent, etc.
- Device: e.g., MacBook M-series with 8/16/32/64 GB unified memory, RTX with specified VRAM, CPU-only, cloud/unconstrained, etc.
If no device is mentioned, do not filter by size; return the best-performing models by benchmark scores. When the task is genuinely ambiguous, the Skill instructs to ask just one clarifying question.
Device → Parameter Budget¶
When a device is specified, estimate from available memory (unified memory for Apple Silicon, VRAM for discrete GPUs):
- Max parameters (B) for fp16 ≈ memory (GB) ÷ 2
- Max parameters (B) for Q4 ≈ memory (GB) × 2
Examples: 16 GB → ~8 B fp16 / 32 B Q4; 24 GB VRAM → ~12 B fp16 / 48 B Q4; 8 GB → ~4 B fp16 / 16 B Q4.
Query Official Benchmarks and Leaderboards¶
- Fetch the full list of official benchmark datasets (
filter=benchmark:official), and match datasets relevant to the user’s task by id, tags, and description, aiming for comprehensive coverage rather than picking only a few. - For each selected dataset, call the leaderboard API to get the top 15 entries (including rank, modelId, value, verified).
- For ~10–15 candidate model IDs, call the Models API or
hf models infoto extract parameter count (prefersafetensors.total), license tags, etc.; if safetensors is unavailable, parse values like7b,70bfrom the model name.
The HTTP requests above use the Hub API in the Skill instructions, with the header configured as:
Authorization: Bearer $(cat ~/.cache/huggingface/token)
Filter, Sort, and Output¶
- With device constraints: remove models that exceed the fp16 budget; mark models that only fit under Q4 as Q4; keep high-ranking models that slightly exceed the budget and note they require Q4; do not silently drop them.
- Without device constraints: sort solely by benchmark scores and keep ~5–8 models.
- If proprietary/API models appear on leaderboards (e.g., GPT-4, Claude, Gemini), include them but mark as API only; exclude them if the user explicitly requests local/open-source only.
The final output is a Markdown comparison table: models link to https://huggingface.co/<model_id>, multiple benchmark columns use — to indicate not evaluated, the top entry is marked with ⭐, and “On device” takes values such as Yes (fp16), Q4 only, Too large, API only, etc.
After presenting the table, the Skill prompts whether to run the recommended model; if confirmed, it then provides guidance for local deployment or HF Jobs.
Errors and Fallbacks¶
- If a leaderboard returns 404/401 etc.: skip it and note it is unavailable in the output.
- If no task-relevant benchmark is found: use the Skill’s curated fallback, or use
hub_repo_searchto filter by task and sort bytrendingScore. - If all leaderboards fail: fall back to popular models by task tags, and state that the results reflect popularity rather than benchmark scores.
Installation and Activation¶
This Skill is part of the huggingface/skills repository under the skills/huggingface-best directory. The repository notes: the Marketplace default focuses on hf-cli; other workflow Skills can be installed on demand via hf skills add <skill-name>, or discovered by clients that support Skills via CLI/MCP.
Claude Code¶
After registering the plugin marketplace and installing the CLI Skill, add this Skill using hf:
/plugin marketplace add huggingface/skills
/plugin install hf-cli@huggingface/skills
hf skills add huggingface-best
Codex¶
Copy or symlink the corresponding directory under the repository’s skills/ to Codex’s standard .agents/skills path (e.g., $REPO_ROOT/.agents/skills or $HOME/.agents/skills), and have the client load SKILL.md per the Agent Skills standard. Alternatively, use the repository-generated agentsmd/AGENTS.md as a fallback.
Gemini CLI¶
gemini extensions install https://github.com/huggingface/skills.git --consent
Or run gemini extensions install . --consent in the local extensions directory (see the repository’s gemini-extension.json).
Cursor¶
Install via the repository’s Cursor plugin manifests (.cursor-plugin/plugin.json, .mcp.json); the Marketplace entry primarily targets hf-cli, and additional Skills are likewise recommended to be installed via:
hf skills add huggingface-best
Before executing API queries, ensure ~/.cache/huggingface/token is configured and the hf CLI is installed (hf models info, etc.). To complement model selection, the repository also provides Skills such as huggingface-local-models (llama.cpp / GGUF local execution) and hf-mem (estimate memory required to load weights), which can be installed together as needed.
Typical Usage¶
The Skill is automatically triggered by the Agent when users ask in natural language, with typical phrasings including: best model for X, what model should I use for, top models for [task], which model runs on my laptop, compare models for, what's state of the art for, etc.
On the Agent side, it calls the Hub API according to the Skill’s steps. For example, to list official benchmarks:
curl -s -H "Authorization: Bearer $(cat ~/.cache/huggingface/token)" \
"https://huggingface.co/api/datasets?filter=benchmark:official&limit=500" | jq '[.[] | {id, tags, description}]'
To get the leaderboard for a selected dataset:
curl -s -H "Authorization: Bearer $(cat ~/.cache/huggingface/token)" \
"https://huggingface.co/api/datasets/<namespace>/<repo>/leaderboard" | jq '[.[:15] | .[] | {rank, modelId, value, verified}]'
Users only need to state the task and device in the conversation, e.g.: “For Python coding on a 16 GB M2 MacBook, recommend open-source models that can run locally and compare benchmarks.” The Agent should return a table with license and “can run on this device in fp16/Q4” columns, and provide follow-up options for local execution or HF Jobs.
Use Cases and Notes¶
Suitable for: task-oriented model selection based on HF official leaderboards in a short time; comparing multiple benchmark scores in a single table; cases with clear memory limits on local or edge devices where the Agent should automatically judge parameter count and quantization tiers.
Notes:
- The fp16/Q4 budgets are approximate formulas within the Skill; actual inference is also affected by context length, framework, and KV cache. The “On device” column is a selection hint, not strict profiling; for fine-grained memory estimation, use hf-mem.
- It depends on the Hub API and a token; some leaderboards may be unavailable, in which case the output will note this and may fall back to trending searches.
- Benchmark coverage changes as official datasets are updated; the Agent should judge relevance to the task based on the returned list rather than relying on a fixed set of tables.
Closing¶
huggingface-best turns “consult official benchmarks, align with devices, generate comparison tables” into a repeatable Agent workflow, reducing the time spent manually stitching together information from the Hub and evaluation results. Official Skill documentation and source directory:
https://github.com/huggingface/skills/tree/main/skills/huggingface-best