Overview
This skill covers running evaluations against models on the Hugging Face Hub on local hardware using inspect-ai and lighteval. It guides backend selection (vllm, Hugging Face Transformers, accelerate), smoke testing, task selection, and fallback strategy.
It does not cover:
- Hugging Face Jobs orchestration
- Model-card or
model-indexedits - README table extraction
- Artificial Analysis imports
.eval_resultsgeneration or publishing- PR creation or community-evals automation
Remote boundary: If the user wants to run the same eval on Hugging Face Jobs, hand off to the hugging-face-jobs skill and pass it one of the local scripts in this skill.
Publishing boundary: If the user wants to publish results into the community evals workflow, stop after generating the evaluation run and hand off that publishing step to ~/code/community-evals.
All paths below are relative to the directory containing this
SKILL.md.
When to Use
- User wants to evaluate a Hugging Face Hub model locally on GPU or via inference providers.
- User needs to choose between
vllm, Hugging Face Transformers (hf), oracceleratebackends. - User wants a quick smoke test before scaling up a full benchmark run.
- User is working with
inspect-aitasks orlightevaltask strings (e.g., Open LLM Leaderboard style). - User asks about local GPU eval setup, backend fallback, or benchmark task selection.
Do NOT use for: HF Jobs orchestration, model-card PRs, .eval_results publication, or community-evals automation.
Prerequisites
- Prefer
uv runfor all local execution. - Set
HF_TOKENfor gated or private models. Use a placeholder likeYOUR_KEYin examples — never hardcode live secrets. - For local GPU runs, verify GPU access before starting.
Environment Check (PowerShell)
uv --version
$env:HF_TOKEN # Should be set; do not print the value in logs
nvidia-smi
If nvidia-smi is unavailable, either:
- Use
scripts/inspect_eval_uv.pyfor lighter provider-backed evaluation, or - Hand off to the
hugging-face-jobsskill if the user wants remote compute.
Script Reference Table
| Use case | Script |
|---|---|
Local inspect-ai eval on a Hub model via inference providers |
scripts/inspect_eval_uv.py |
Local GPU eval with inspect-ai using vllm or Transformers |
scripts/inspect_vllm_uv.py |
Local GPU eval with lighteval using vllm or accelerate |
scripts/lighteval_vllm_uv.py |
| Extra command patterns | examples/USAGE_EXAMPLES.md |
When to load each reference:
- Load
examples/USAGE_EXAMPLES.mdwhen the user asks for additional command patterns beyond the Quick Start below, or when troubleshooting a specific backend combination. - Load
scripts/inspect_eval_uv.pywhen using the inference providers path (Option A). - Load
scripts/inspect_vllm_uv.pywhen runninginspect-aion local GPU (Option B). - Load
scripts/lighteval_vllm_uv.pywhen runninglightevalon local GPU (Option C).
Procedure
Step 1 — Choose the Evaluation Framework
- Use
inspect-aiwhen you want explicit task control and inspect-native flows. - Use
lightevalwhen the benchmark is naturally expressed as a lighteval task string, especially leaderboard-style tasks.
Step 2 — Choose the Inference Backend
- Prefer
vllmfor throughput on supported architectures. - Use Hugging Face Transformers (
--backend hf) oraccelerateas compatibility fallbacks.
Step 3 — Start With a Smoke Test
inspect-ai: add--limit 10or similar.lighteval: add--max-samples 10.
Step 4 — Scale Up Only After the Smoke Test Passes
Remove the --limit / --max-samples flag and run the full benchmark.
Step 5 — If Remote Execution Is Needed, Hand Off
Switch to the hugging-face-jobs skill and pass it the same script plus the chosen arguments.
Quick Start
Option A: inspect-ai with Local Inference Providers
Best when the model is already supported by Hugging Face Inference Providers and you want the lowest local setup overhead.
uv run scripts/inspect_eval_uv.py `
--model meta-llama/Llama-3.2-1B `
--task mmlu `
--limit 20
Use this path when:
- You want a quick local smoke test.
- You do not need direct GPU control.
- The task already exists in
inspect-evals.
Option B: inspect-ai on Local GPU
Best when you need to load the Hub model directly, use vllm, or fall back to Transformers for unsupported architectures.
vLLM (default):
uv run scripts/inspect_vllm_uv.py `
--model meta-llama/Llama-3.2-1B `
--task gsm8k `
--limit 20
Transformers fallback:
uv run scripts/inspect_vllm_uv.py `
--model microsoft/phi-2 `
--task mmlu `
--backend hf `
--trust-remote-code `
--limit 20
Option C: lighteval on Local GPU
Best when the task is naturally expressed as a lighteval task string, especially Open LLM Leaderboard style benchmarks.
vLLM (default):
uv run scripts/lighteval_vllm_uv.py `
--model meta-llama/Llama-3.2-3B-Instruct `
--tasks "leaderboard|mmlu|5,leaderboard|gsm8k|5" `
--max-samples 20 `
--use-chat-template
accelerate fallback:
uv run scripts/lighteval_vllm_uv.py `
--model microsoft/phi-2 `
--tasks "leaderboard|mmlu|5" `
--backend accelerate `
--trust-remote-code `
--max-samples 20
Task Selection
inspect-ai examples:
mmlugsm8khellaswagarc_challengetruthfulqawinograndehumaneval
lighteval task strings use the format suite|task|num_fewshot:
leaderboard|mmlu|5leaderboard|gsm8k|5leaderboard|arc_challenge|25lighteval|hellaswag|0
Multiple lighteval tasks can be comma-separated in --tasks.
Backend Selection Summary
| Scenario | Recommended backend / script |
|---|---|
| Fast GPU inference, supported architecture | inspect_vllm_uv.py --backend vllm |
vllm does not support the model (inspect-ai) |
inspect_vllm_uv.py --backend hf |
| Fast GPU inference, lighteval, supported model | lighteval_vllm_uv.py --backend vllm |
vllm does not support the model (lighteval) |
lighteval_vllm_uv.py --backend accelerate |
| Inference Providers already cover the model, no GPU needed | inspect_eval_uv.py |
Hardware Guidance
| Model size | Suggested local hardware |
|---|---|
< 3B |
Consumer GPU / Apple Silicon / small dev GPU |
3B – 13B |
Stronger local GPU |
13B+ |
High-memory local GPU or hand off to hugging-face-jobs |
For smoke tests, prefer cheaper local runs plus --limit or --max-samples.
Pitfalls
CUDA or vLLM OOM:
- Reduce
--batch-size. - Reduce
--gpu-memory-utilization. - Switch to a smaller model for the smoke test.
- If necessary, hand off to
hugging-face-jobs.
- Reduce
Model unsupported by
vllm:- Switch to
--backend hfforinspect-ai. - Switch to
--backend accelerateforlighteval.
- Switch to
Gated or private repo access fails:
- Verify
HF_TOKENis set and valid. Do not print the token value in any logs or output.
- Verify
Custom model code required:
- Add
--trust-remote-codeto the command.
- Add
PowerShell line continuation: Use backtick (
`) for multi-line commands on Windows PowerShell, not backslash (\).Do not cross the remote boundary: This skill intentionally stops at local execution and backend selection. Do not attempt to orchestrate Hugging Face Jobs, create PRs, or publish
.eval_resultsfrom within this skill.
Verification
After running a smoke test, verify the eval completed successfully:
# Check that the eval produced output files (inspect-ai)
ls ./*.eval 2>$null; ls ./logs/ 2>$null
# Check that the eval produced output files (lighteval)
ls ./results/ 2>$null; ls ./outputs/ 2>$null
# Confirm GPU was utilized during the run (run nvidia-smi during or after)
nvidia-smi
Expected indicators of success:
- The command exits with code
0. inspect-aiproduces a.evallog file or alogs/directory with results.lightevalproduces aresults/oroutputs/directory with evaluation scores.nvidia-smishows GPU memory was allocated during the run (for GPU backends).- The smoke test with
--limit 20or--max-samples 20completes in a reasonable time (seconds to minutes depending on model size).
If verification fails:
- Re-check
HF_TOKENfor gated models. - Confirm the model name is correct on the Hugging Face Hub.
- Try a smaller model or fewer samples to isolate the issue.
- Switch backend (
vllm→hforaccelerate) if architecture support is the problem.
Examples
See:
examples/USAGE_EXAMPLES.md— additional local command patterns and edge cases.scripts/inspect_eval_uv.py— inference providers path source.scripts/inspect_vllm_uv.py— local GPU inspect-ai source.scripts/lighteval_vllm_uv.py— local GPU lighteval source.
Related Skills
hugging-face-jobs— hand off here when the user wants remote execution on Hugging Face Jobs, remote hardware selection, secret passing, job scheduling, or job monitoring.community-evals(automation) — hand off to~/code/community-evalswhen the user wants to publish evaluation results into the community evals workflow.