huggingface-best

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.

npx skills add https://github.com/huggingface/skills --skill huggingface-best

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:

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:

curl -s -H "Authorization: Bearer $(cat ~/.cache/huggingface/token)" \
  "https://huggingface.co/api/datasets/<namespace>/<repo>/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.

# 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 quantization (multiply budget by ~4 for Q4 capacity)
  3. If a highly-ranked model is slightly over budget, keep it with a "needs Q4" note — don't silently drop it

If no device was mentioned: skip all size filtering — just rank by benchmark score.

Then: rank by benchmark score (descending), keep top 5-8 models.

Include proprietary models (GPT-4, Claude, Gemini) if they appear on leaderboards, but flag them as "API only / not self-hostable". If the user explicitly asked for local/open models only, exclude them.


Step 6: Output

Comparison table

| # | Model | Params | [Benchmark 1] | [Benchmark 2] | License | On device |
|---|-------|--------|--------------|--------------|---------|-----------|
| ⭐1 | [org/name](https://huggingface.co/org/name) | 7B | 85.2% | — | Apache 2.0 | Yes (fp16) |
| 2 | [org/name](https://huggingface.co/org/name) | 13B | 83.1% | 71.5% | MIT | Q4 only |
| 3 | [org/name](https://huggingface.co/org/name) | 70B | 90.0% | 81.0% | Llama | Too large |
  • Link model names to https://huggingface.co/<model_id>
  • Use for benchmarks where the model wasn't evaluated
  • Star the top recommended pick with ⭐
  • "On device" values: Yes (fp16), Q4 only, Too large, API only

Follow-up

After presenting the table, ask the user: "Would you like to run [top recommended model]?"

If they say yes, ask whether they'd prefer to:


Error handling

  • Leaderboard not found: skip, note "leaderboard unavailable" in output
  • Model missing from hub_repo_details: fall back to parsing size from model name
  • No benchmarks found for task: use the curated fallback table above, or try hub_repo_search with filters=["<task>"] sorted by trendingScore
  • All leaderboards fail: fall back to hub_repo_search for popular models tagged with the task, note that results are by popularity rather than benchmark score

Thêm skills từ huggingface

Hugging Face Cli
huggingface
Execute Hugging Face Hub operations using the `hf` CLI. Use when the user needs to download models/datasets/spaces, upload files to Hub repositories, create repos, manage local cache, or run compute jobs on HF infrastructure. Covers authentication, file transfers, repository creation, cache operations, and cloud compute.
official
Hugging Face Datasets
huggingface
Tạo và quản lý tập dữ liệu trên Hugging Face Hub. Hỗ trợ khởi tạo kho lưu trữ, định nghĩa cấu hình/lời nhắc hệ thống, cập nhật hàng dữ liệu theo luồng, và truy vấn/chuyển đổi tập dữ liệu dựa trên SQL. Được thiết kế để hoạt động cùng với máy chủ HF MCP cho các quy trình làm việc tập dữ liệu toàn diện.
official
Hugging Face Evaluation
huggingface
Add and manage evaluation results in Hugging Face model cards. Supports extracting eval tables from README content, importing scores from Artificial Analysis API, and running custom model evaluations with vLLM/lighteval. Works with the model-index metadata format.
official
Hugging Face Jobs
huggingface
Chạy bất kỳ khối lượng công việc nào trên cơ sở hạ tầng Hugging Face Jobs. Bao gồm các tập lệnh UV, công việc dựa trên Docker, lựa chọn phần cứng, ước tính chi phí, xác thực bằng token, quản lý bí mật, cấu hình thời gian chờ và lưu trữ kết quả. Được thiết kế cho các khối lượng công việc tính toán đa năng bao gồm xử lý dữ liệu, suy luận, thử nghiệm, công việc hàng loạt và bất kỳ tác vụ nào dựa trên Python.
official
Hugging Face Model Trainer
huggingface
Train or fine-tune language models using TRL (Transformer Reinforcement Learning) on Hugging Face Jobs infrastructure. Covers SFT, DPO, GRPO and reward modeling training methods, plus GGUF conversion for local deployment. Includes guidance on dataset preparation, hardware selection, cost estimation, and model persistence.
official
Hugging Face Paper Publisher
huggingface
Xuất bản và quản lý các bài báo nghiên cứu trên Hugging Face Hub. Hỗ trợ tạo trang bài báo, liên kết bài báo với mô hình/bộ dữ liệu, xác nhận quyền tác giả và tạo các bài viết nghiên cứu chuyên nghiệp dựa trên markdown.
official
Hugging Face Tool Builder
huggingface
Build reusable scripts and tools using the Hugging Face API. Useful when chaining or combining API calls, or when tasks will be repeated/automated. Creates reusable command line scripts to fetch, enrich, or process data from Hugging Face Hub.
official
Hugging Face Trackio
huggingface
Track and visualize ML training experiments with Trackio. Use when logging metrics during training (Python API) or retrieving/analyzing logged metrics (CLI). Supports real-time dashboard visualization, HF Space syncing, and JSON output for automation.
official