Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Evaluates code generation models across HumanEval, MBPP, MultiPL-E, and 15+ benchmarks with pass@k metrics. Use when benchmarking code models, comparing coding abilities, testing multi-language support, or measuring code generation quality. Industry standard from BigCode Project used by HuggingFace leaderboards.
.claude/skills/openlair-evaluating-code-models/SKILL.md| Model | Eval pass | Runs |
|---|---|---|
| gemini-3.6-flash | 97% | 32 |
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 85% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 108% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 88% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 117% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 272% | 0% |
BigCode Evaluation Harness evaluates code generation models across 15+ benchmarks including HumanEval, MBPP, and MultiPL-E (18 languages).
Installation:
bashgit clone https://github.com/bigcode-project/bigcode-evaluation-harness.git cd bigcode-evaluation-harness pip install -e . accelerate config
Evaluate on HumanEval:
bashaccelerate launch main.py \ --model bigcode/starcoder2-7b \ --tasks humaneval \ --max_length_generation 512 \ --temperature 0.2 \ --n_samples 20 \ --batch_size 10 \ --allow_code_execution \ --save_generations
View available tasks:
bashpython -c "from bigcode_eval.tasks import ALL_TASKS; print(ALL_TASKS)"
Evaluate model on core code benchmarks (HumanEval, MBPP, HumanEval+).
Checklist:
Code Benchmark Evaluation:
- [ ] Step 1: Choose benchmark suite
- [ ] Step 2: Configure model and generation
- [ ] Step 3: Run evaluation with code execution
- [ ] Step 4: Analyze pass@k resultsStep 1: Choose benchmark suite
Python code generation (most common):
Multi-language (18 languages):
Advanced:
Step 2: Configure model and generation
bash# Standard HuggingFace model accelerate launch main.py \ --model bigcode/starcoder2-7b \ --tasks humaneval \ --max_length_generation 512 \ --temperature 0.2 \ --do_sample True \ --n_samples 200 \ --batch_size 50 \ --allow_code_execution # Quantized model (4-bit) accelerate launch main.py \ --model codellama/CodeLlama-34b-hf \ --tasks humaneval \ --load_in_4bit \ --max_length_generation 512 \ --allow_code_execution # Custom/private model accelerate launch main.py \ --model /path/to/my-code-model \ --tasks humaneval \ --trust_remote_code \ --use_auth_token \ --allow_code_execution
Step 3: Run evaluation
bash# Full evaluation with pass@k estimation (k=1,10,100) accelerate launch main.py \ --model bigcode/starcoder2-7b \ --tasks humaneval \ --temperature 0.8 \ --n_samples 200 \ --batch_size 50 \ --allow_code_execution \ --save_generations \ --metric_output_path results/starcoder2-humaneval.json
Step 4: Analyze results
Results in results/starcoder2-humaneval.json:
json{ "humaneval": { "pass@1": 0.354, "pass@10": 0.521, "pass@100": 0.689 }, "config": { "model": "bigcode/starcoder2-7b", "temperature": 0.8, "n_samples": 200 } }
Evaluate code generation across 18 programming languages.
Checklist:
Multi-Language Evaluation:
- [ ] Step 1: Generate solutions (host machine)
- [ ] Step 2: Run evaluation in Docker (safe execution)
- [ ] Step 3: Compare across languagesStep 1: Generate solutions on host
bash# Generate without execution (safe) accelerate launch main.py \ --model bigcode/starcoder2-7b \ --tasks multiple-py,multiple-js,multiple-java,multiple-cpp \ --max_length_generation 650 \ --temperature 0.8 \ --n_samples 50 \ --batch_size 50 \ --generation_only \ --save_generations \ --save_generations_path generations_multi.json
Step 2: Evaluate in Docker container
bash# Pull the MultiPL-E Docker image docker pull ghcr.io/bigcode-project/evaluation-harness-multiple # Run evaluation inside container docker run -v $(pwd)/generations_multi.json:/app/generations.json:ro \ -it evaluation-harness-multiple python3 main.py \ --model bigcode/starcoder2-7b \ --tasks multiple-py,multiple-js,multiple-java,multiple-cpp \ --load_generations_path /app/generations.json \ --allow_code_execution \ --n_samples 50
Supported languages: Python, JavaScript, Java, C++, Go, Rust, TypeScript, C#, PHP, Ruby, Swift, Kotlin, Scala, Perl, Julia, Lua, R, Racket
Evaluate chat/instruction models with proper formatting.
Checklist:
Instruction Model Evaluation:
- [ ] Step 1: Use instruction-tuned tasks
- [ ] Step 2: Configure instruction tokens
- [ ] Step 3: Run evaluationStep 1: Choose instruction tasks
Step 2: Configure instruction tokens
bash# For models with chat templates (e.g., CodeLlama-Instruct) accelerate launch main.py \ --model codellama/CodeLlama-7b-Instruct-hf \ --tasks instruct-humaneval \ --instruction_tokens "<s>[INST],</s>,[/INST]" \ --max_length_generation 512 \ --allow_code_execution
Step 3: HumanEvalPack for instruction models
bash# Test code synthesis across 6 languages accelerate launch main.py \ --model codellama/CodeLlama-7b-Instruct-hf \ --tasks humanevalsynthesize-python,humanevalsynthesize-js \ --prompt instruct \ --max_length_generation 512 \ --allow_code_execution
Benchmark suite for model comparison.
Step 1: Create evaluation script
bash#!/bin/bash # eval_models.sh MODELS=( "bigcode/starcoder2-7b" "codellama/CodeLlama-7b-hf" "deepseek-ai/deepseek-coder-6.7b-base" ) TASKS="humaneval,mbpp" for model in "${MODELS[@]}"; do model_name=$(echo $model | tr '/' '-') echo "Evaluating $model" accelerate launch main.py \ --model $model \ --tasks $TASKS \ --temperature 0.2 \ --n_samples 20 \ --batch_size 20 \ --allow_code_execution \ --metric_output_path results/${model_name}.json done
Step 2: Generate comparison table
pythonimport json import pandas as pd models = ["bigcode-starcoder2-7b", "codellama-CodeLlama-7b-hf", "deepseek-ai-deepseek-coder-6.7b-base"] results = [] for model in models: with open(f"results/{model}.json") as f: data = json.load(f) results.append({ "Model": model, "HumanEval pass@1": f"{data['humaneval']['pass@1']:.3f}", "MBPP pass@1": f"{data['mbpp']['pass@1']:.3f}" }) df = pd.DataFrame(results) print(df.to_markdown(index=False))
Use BigCode Evaluation Harness when:
Use alternatives instead:
| Benchmark | Problems | Languages | Metric | Use Case | |-----------|----------|-----------|--------|----------| | HumanEval | 164 | Python | pass@k | Standard code completion | | HumanEval+ | 164 | Python | pass@k | Stricter evaluation (80× tests) | | MBPP | 500 | Python | pass@k | Entry-level problems | | MBPP+ | 399 | Python | pass@k | Stricter evaluation (35× tests) | | MultiPL-E | 164×18 | 18 languages | pass@k | Multi-language evaluation | | APPS | 10,000 | Python | pass@k | Competition-level | | DS-1000 | 1,000 | Python | pass@k | Data science (pandas, numpy, etc.) | | HumanEvalPack | 164×3×6 | 6 languages | pass@k | Synthesis/fix/explain | | Mercury | 1,889 | Python | Efficiency | Computational efficiency |
Issue: Different results than reported in papers
Check these factors:
bash# 1. Verify n_samples (need 200 for accurate pass@k) --n_samples 200 # 2. Check temperature (0.2 for greedy-ish, 0.8 for sampling) --temperature 0.8 # 3. Verify task name matches exactly --tasks humaneval # Not "human_eval" or "HumanEval" # 4. Check max_length_generation --max_length_generation 512 # Increase for longer problems
Issue: CUDA out of memory
bash# Use quantization --load_in_8bit # OR --load_in_4bit # Reduce batch size --batch_size 1 # Set memory limit --max_memory_per_gpu "20GiB"
Issue: Code execution hangs or times out
Use Docker for safe execution:
bash# Generate on host (no execution) --generation_only --save_generations # Evaluate in Docker docker run ... --allow_code_execution --load_generations_path ...
Issue: Low scores on instruction models
Ensure proper instruction formatting:
bash# Use instruction-specific tasks --tasks instruct-humaneval # Set instruction tokens for your model --instruction_tokens "<s>[INST],</s>,[/INST]"
Issue: MultiPL-E language failures
Use the dedicated Docker image:
bashdocker pull ghcr.io/bigcode-project/evaluation-harness-multiple
| Argument | Default | Description | |----------|---------|-------------| | --model | - | HuggingFace model ID or local path | | --tasks | - | Comma-separated task names | | --n_samples | 1 | Samples per problem (200 for pass@k) | | --temperature | 0.2 | Sampling temperature | | --max_length_generation | 512 | Max tokens (prompt + generation) | | --batch_size | 1 | Batch size per GPU | | --allow_code_execution | False | Enable code execution (required) | | --generation_only | False | Generate without evaluation | | --load_generations_path | - | Load pre-generated solutions | | --save_generations | False | Save generated code | | --metric_output_path | results.json | Output file for metrics | | --load_in_8bit | False | 8-bit quantization | | --load_in_4bit | False | 4-bit quantization | | --trust_remote_code | False | Allow custom model code | | --precision | fp32 | Model precision (fp32/fp16/bf16) |
| Model Size | VRAM (fp16) | VRAM (4-bit) | Time (HumanEval, n=200) | |------------|-------------|--------------|-------------------------| | 7B | 14GB | 6GB | ~30 min (A100) | | 13B | 26GB | 10GB | ~1 hour (A100) | | 34B | 68GB | 20GB | ~2 hours (A100) |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 15,275 | 10,175 | -33% | 1 | 1 | 0% | 3,074 | 5,695 | +85% | 0 | 0 | — |
case-02 | fail→pass | 10,925 | 6,090 | -44% | 1 | 1 | 0% | 2,337 | 4,868 | +108% | 0 | 0 | — |
case-03 | fail→pass | 15,127 | 9,482 | -37% | 1 | 1 | 0% | 2,878 | 5,412 | +88% | 0 | 0 | — |
case-04 | pass→pass | 10,398 | 7,342 | -29% | 1 | 1 | 0% | 2,078 | 5,063 | +144% | 0 | 0 | — |
case-05 | pass→pass | 8,069 | 5,067 | -37% | 1 | 1 | 0% | 1,376 | 4,452 | +224% | 0 | 0 | — |
case-06 | pass→pass | 6,717 | 5,302 | -21% | 1 | 1 | 0% | 1,160 | 4,503 | +288% | 0 | 0 | — |
case-07 | fail→pass | 10,481 | 7,491 | -29% | 1 | 1 | 0% | 2,373 | 5,139 | +117% | 0 | 0 | — |
case-08 | pass→pass | 4,205 | 2,613 | -38% | 1 | 1 | 0% | 900 | 4,076 | +353% | 0 | 0 | — |
case-09 | pass→pass | 9,061 | 6,129 | -32% | 1 | 1 | 0% | 1,664 | 4,851 | +192% | 0 | 0 | — |
case-10 | pass→pass | 4,081 | 2,056 | -50% | 1 | 1 | 0% | 762 | 3,921 | +415% | 0 | 0 | — |
case-11 | pass→pass | 6,733 | 5,433 | -19% | 1 | 1 | 0% | 1,427 | 4,775 | +235% | 0 | 0 | — |
case-12 | pass→pass | 7,025 | 3,459 | -51% | 1 | 1 | 0% | 1,439 | 4,248 | +195% | 0 | 0 | — |
case-13 | pass→pass | 4,044 | 3,392 | -16% | 1 | 1 | 0% | 794 | 4,246 | +435% | 0 | 0 | — |
case-14 | pass→pass | 10,377 | 3,269 | -68% | 1 | 1 | 0% | 1,777 | 4,205 | +137% | 0 | 0 | — |
case-15 | fail→pass | 5,441 | 3,181 | -42% | 1 | 1 | 0% | 1,134 | 4,223 | +272% | 0 | 0 | — |
case-16 | fail→pass | 12,004 | 6,356 | -47% | 1 | 1 | 0% | 2,591 | 4,854 | +87% | 0 | 0 | — |
case-17 | pass→pass | 3,277 | 1,479 | -55% | 1 | 1 | 0% | 561 | 3,832 | +583% | 0 | 0 | — |
case-18 | fail→pass | 8,908 | 2,610 | -71% | 1 | 1 | 0% | 751 | 4,130 | +450% | 0 | 0 | — |
case-19 | pass→pass | 6,917 | 1,874 | -73% | 1 | 1 | 0% | 1,285 | 3,922 | +205% | 0 | 0 | — |
case-20 | pass→pass | 2,932 | 1,718 | -41% | 1 | 1 | 0% | 582 | 3,879 | +566% | 0 | 0 | — |
case-21 | pass→pass | 7,164 | 3,310 | -54% | 1 | 1 | 0% | 1,381 | 4,246 | +207% | 0 | 0 | — |
case-22 | pass→pass | 5,580 | 1,911 | -66% | 1 | 1 | 0% | 1,238 | 3,934 | +218% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.