█

AI/TLDR

Buy me a coffee
Buy me a coffee

BigCode Evaluation Harness

Reproducible benchmarking for code-generation models across 15+ tasks

Benchmark HarnessesOpen source
Language
Python
License
Apache-2.0
IN SHORT

What is BigCode Evaluation Harness?

BigCode Evaluation Harness is a framework for evaluating code-generation models on a shared set of benchmarks. It runs any autoregressive model from the Hugging Face Hub and is tuned for code models such as SantaCoder, InCoder, and CodeGen. It sits in the Benchmark Harnesses category of the Evaluation & Production Ops tools and is open-source, written in Python and licensed Apache-2.0.

Overview

BigCode Evaluation Harness is a framework for evaluating code-generation models on a shared set of benchmarks. It runs any autoregressive model from the Hugging Face Hub and is tuned for code models such as SantaCoder, InCoder, and CodeGen. The project was inspired by EleutherAI's lm-evaluation-harness and applies the same idea to code tasks.

It is aimed at researchers and engineers who want to measure how well a model writes or completes code, and who need numbers they can compare and reproduce. It ships more than 15 tasks, including HumanEval, HumanEval+, MBPP, APPS, DS-1000, MultiPL-E (HumanEval in 18 languages), and HumanEvalPack, covering both completion and fill-in-the-middle modes.

As a benchmark harness, it standardizes how prompts are built, how samples are generated, and how results are scored. It supports multi-GPU generation through Hugging Face accelerate and provides Dockerfiles so that code execution and scoring run in a contained, repeatable environment.

What it does

  • Runs any autoregressive Hugging Face model, with a focus on code models like SantaCoder, InCoder, and CodeGen
  • More than 15 tasks: HumanEval, HumanEval+, InstructHumanEval, APPS, MBPP, MBPP+, DS-1000, MultiPL-E, HumanEvalPack, and more
  • Covers completion (left-to-right) and fill-in-the-middle (FIM) generation modes
  • MultiPL-E translates HumanEval into 18 programming languages for multilingual evaluation
  • Multi-GPU text generation via accelerate, plus Dockerfiles for contained, reproducible runs
  • Memory-saving options including --precision, --load_in_8bit, and --load_in_4bit

Getting started

Clone the repo, install it as an editable package, log in to the Hub, then launch a benchmark with accelerate.

Clone and install

Get the source, install torch for your device, then install the harness in editable mode.

bashbash
git clone https://github.com/bigcode-project/bigcode-evaluation-harness.git
cd bigcode-evaluation-harness
pip install -e .

Log in and configure accelerate

Make sure git-lfs is installed, log in to the Hugging Face Hub, and configure accelerate for your GPU setup.

bashbash
huggingface-cli login
accelerate config

Run an evaluation

Launch generation and scoring with accelerate launch main.py, choosing a model and task. Pass --allow_code_execution to score tasks that run unit tests.

bashbash
accelerate launch main.py \
  --model <MODEL_NAME> \
  --tasks <TASK_NAME> \
  --max_length_generation <MAX_LENGTH> \
  --temperature <TEMPERATURE> \
  --do_sample True \
  --n_samples 100 \
  --batch_size 10 \
  --precision <PRECISION> \
  --allow_code_execution \
  --save_generations

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Benchmark a newly trained code model on HumanEval and MBPP to compare it against published baselines
  • Measure multilingual code performance by running MultiPL-E across 18 languages
  • Reproduce reported scores in a Docker container so code execution and grading stay contained
  • Evaluate fill-in-the-middle (FIM) quality for editor-style code completion models

How BigCode Evaluation Harness compares

BigCode Evaluation Harness alongside other open-source benchmark harnesses tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
LM Evaluation Harness★ 14.6kEleutherAI's framework for few-shot evaluation of language models across 60+ academic benchmarks, used as the backend for many leaderboards.
OpenCompass★ 7.7kAn LLM evaluation platform that runs models against 100+ datasets covering reasoning, knowledge, coding, and domain tasks, with leaderboards and multi-model support.
SWE-bench★ 6.3kA benchmark and containerized harness that tests whether language models can resolve real GitHub issues by generating patches that pass a repository's tests.
simple-evals★ 4.7kOpenAI's lightweight library for running standard zero-shot, chain-of-thought benchmarks like MMLU, MATH, and GPQA to measure model accuracy.
lmms-eval★ 4.5kAn evaluation suite for large multimodal models that runs image, video, and audio benchmarks across many tasks with a unified, reproducible interface.
AgentBench★ 3.8kA benchmark that evaluates LLMs as agents across diverse interactive environments such as operating systems, databases, web browsing, and games.
EvalScope★ 3.8kModelScope evaluation framework that runs standard benchmarks against local or OpenAI-compatible models, with agent-loop evaluation, inference stress testing and a comparison dashboard.
BigCode Evaluation Harness★ 1.1kReproducible benchmarking for code-generation models across 15+ tasks