Skip to main content
skill CX Codex

huggingface-best — Claude Code skill: find the right model

This skill pulls top models for a task from HuggingFace leaderboards and drops the ones your hardware cannot hold.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add huggingface/skills --skill huggingface-best -a claude-code
Open on GitHub

What huggingface-best does

Ask it for a model and it splits your message into two things: the job the model must do, and the machine it will run on. It then lists official HuggingFace benchmarks through the API, takes the leading 15 models from each leaderboard, and fills in metadata — parameter count from safetensors.total, license from the model card.

Name a device and size filtering kicks in: roughly 2 GB of memory per billion parameters at fp16, four times that at Q4. A strong model that sits just above the budget stays in the list with a “needs Q4” note instead of vanishing. Say nothing about hardware and the ranking is pure benchmark score.

You get a table: rank, model name linked to https://huggingface.co/<model_id>, params, scores per benchmark, license, and a device column reading Yes (fp16), Q4 only, Too large or API only. Closed models such as GPT-4 and Gemini show up flagged as API-only unless you asked for local weights. One prerequisite matters: a HuggingFace token at ~/.cache/huggingface/token. Without it the API calls come back 401 and the skill has no leaderboards to read.

What it helps with

  • pick a model for a specific job instead of trusting a blog post
  • check whether a model fits in 16 GB of memory
  • compare open models by leaderboard scores
  • spot which models carry a permissive license
  • see which candidates are API-only

Example prompts for the agent

  • What's the best model for code generation right now?
  • Compare the top OCR models by benchmark score
  • Which chat model can I run on a MacBook with 16 GB of memory?

How to install huggingface-best

1Skills CLI (Vercel)

npx skills add huggingface/skills --skill huggingface-best -a claude-code

2Manually: put the files in place

~/.claude/skills/huggingface-best/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/huggingface-best/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about huggingface-best

How do I install huggingface-best in Claude Code?

Run npx skills add huggingface/skills --skill huggingface-best -a claude-code. The skill lands in ~/.claude/skills/huggingface-best/SKILL.md.

What does huggingface-best do?

It queries official HuggingFace benchmark leaderboards for a given task, enriches the candidates with size and license data, and returns a comparison table with scores.

What do I need before using it?

A HuggingFace token stored at ~/.cache/huggingface/token. The API requests carry it in the Authorization header, so without the token the leaderboards return nothing.

Source text

SKILL.md · Apache-2.0
---
name: huggingface-best
description: >-
  Use when the user asks about finding the best, top, or recommended model for a task,
  wants to know what AI model to use, or wants to compare models by benchmark scores.
  Triggers on: "best model for X", "what model should I use for", "top models for [task]",
  "which model runs on my laptop/machine/device", "recommend a model for", "what LLM should
  I use for", "compare models for", "what's state of the art for", or any question about
  choosing an AI model for a specific use case. Always use this skill when the user wants
  model recommendations or comparisons, even if they don't explicitly mention HuggingFace
  or benchmarks.
---

# 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/<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.

```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 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

```markdown
| # | 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:
- **Run locally** — ask about their device if not already known, then give appropriate setup instructions
- **Run on HF Jobs** — point them to the HF Jobs guide: https://huggingface.co/docs/huggingface_hub/en/guides/jobs

---

## 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

© huggingface · Apache-2.0 · huggingface/skills

Similar skills

Everything for AI and ML →

From the same set25

huggingface-community-evals Skill for running Hugging Face Hub model evaluations on local hardware via inspect-ai and lighteval. Use it to pick an inference backend or smoke-test a model before a full run. CX Codex +1 1,900installs huggingface-trackio Tracks ML training experiments with Trackio, sets up error alerts, and queries metrics via CLI. Built for autonomous agent loops and Hugging Face Spaces. CX Codex +1 1,900installs huggingface-local-models Finds a GGUF repo on Hugging Face, matches a quant to your memory and starts it with llama.cpp. No guessing at filenames. CX Codex +1 1,900installs huggingface-vision-trainer A skill that fine-tunes object detectors, image classifiers and SAM/SAM2 models on Hugging Face Jobs GPUs. Useful when you have no local GPU but still need a trained model on the Hub. CX Codex +1 1,900installs huggingface-paper-publisher Indexes arXiv papers on Hugging Face Hub, links them to model and dataset cards, verifies authorship and builds markdown drafts from templates. CX Codex +1 1,700installs huggingface-tool-builder A skill for building reusable command-line scripts that fetch, enrich, and process data from Hugging Face. Useful when chaining multiple API calls or running repeated automation tasks. CX Codex +1 1,600installs train-sentence-transformers A Claude Code skill that walks an agent through training sentence-transformers models, from picking the encoder type to pushing weights to the Hugging Face Hub. CX Codex +1 1,500installs huggingface-zerogpu Skill for Gradio apps on Hugging Face Spaces with ZeroGPU: where @spaces.GPU belongs, how to size duration, what breaks at the worker boundary. CX Codex +1 1,300installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor