Skip to main content

An evaluation harness for benchmarking LLM-generated Luau code.

Project description

Luau Bench

An evaluation harness for benchmarking LLM-generated Luau code. Highly-inspired from EleutherAI/lm-evaluation-harness.

Installation

git clone https://github.com/imezx/luau-bench.git
cd luau-bench

# With all optional providers & datasets
pip install -e ".[all]"

# For specific providers
pip install -e ".[anthropic]"  # Claude models
pip install -e ".[datasets]"   # HuggingFace dataset loader
pip install -e ".[progress]"   # tqdm progress bars for long runs

Runtime Setup

Luau Bench requires a Luau runtime for executing generated code. Install one or more with the bundled script:

# Install everything (Luau CLI + Zune + StyLua)
./tools/install-runtime.sh --all

# Install Zune only (recommended runtime)
./tools/install-runtime.sh --zune

# Install the Luau CLI (also installs luau-analyze for static diagnostics)
./tools/install-runtime.sh --luau

# verify the environment
luau-bench info

Supported runtimes in priority order: luau, zune. The LUAU_RUNTIME environment variable can pin a specific binary path.

Quick Start

mkdir my_tasks
cp templates/task_basic.yaml my_tasks/

luau-bench validate --include-path ./my_tasks

luau-bench selftest --include-path ./my_tasks

# Run a benchmark - results printed to terminal only
luau-bench run --provider ollama --model codellama \
    --include-path ./my_tasks

# Run & export results (all formats)
luau-bench run --provider ollama --model codellama \
    --include-path ./my_tasks --export

# Run & export specific formats
luau-bench run --provider ollama --model codellama \
    --include-path ./my_tasks --export html,json

CLI Reference

luau-bench run          Evaluate a model against tasks
luau-bench ls           List available tasks & groups
luau-bench validate     Check task YAML files for errors
luau-bench selftest     Run reference solutions against test harnesses
luau-bench compare      Compare two or more result JSON files
luau-bench cache        Manage the generation result cache
luau-bench info         Show environment info

run

luau-bench run \
    --provider ollama \
    --model codellama \
    --include-path ./my_tasks \
    --tasks task1,task2 \
    --num-samples 5 \
    --parallel 4 \
    --task-parallel 4 \
    --export html,json,md \
    --output ./results \
    --log-samples --show-samples \
    --temperature 0.0 \
    --max-tokens 4096 \
    -v

Results are printed to the terminal by default. Pass --export to write files. Use --export alone to export all formats (json, md, html), or --export html,json to select specific ones. The --output directory is only used when --export is active.

Supported Providers

Provider --provider value Notes
vLLM vllm Full support including loglikelihood
OpenAI openai Set OPENAI_API_KEY
Anthropic Claude anthropic Set ANTHROPIC_API_KEY; no loglikelihood support
Ollama ollama Local models via ollama serve
TGI tgi HuggingFace Text Generation Inference
LM Studio lmstudio Local via LM Studio server

Loglikelihood scoring (output_type: loglikelihood) requires a backend that exposes the /v1/completions endpoint with echo=True & logprobs=1. This includes vLLM, TGI, & llama.cpp. It is not supported by the Anthropic adapter.

Contributing

We accept any well-formed task that has a clear purpose, correct reference solution, & sufficient test coverage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

luau_bench-0.0.2.tar.gz (53.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

luau_bench-0.0.2-py3-none-any.whl (54.5 kB view details)

Uploaded Python 3

File details

Details for the file luau_bench-0.0.2.tar.gz.

File metadata

  • Download URL: luau_bench-0.0.2.tar.gz
  • Upload date:
  • Size: 53.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for luau_bench-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e4438f88e8d3d5a1f020c36271dd358a8a0a624280355cb435aff13e06745241
MD5 59cc8121a3dd7f603777ac533114f444
BLAKE2b-256 7355fee9e87b69fbcce6b2216342dcd40ef1154ac45ba6ab5dd9012a26c6e0df

See more details on using hashes here.

File details

Details for the file luau_bench-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: luau_bench-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 54.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for luau_bench-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 07453edd57242ae89240620a04ca416287a02bc399445ae0d2894fa2b6401900
MD5 6082ee0ab6dc4e99bb421b25f6efbe83
BLAKE2b-256 143385d9b624de4882ead861c10fc467c5a4f543ffb750df3083611c0800bba4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page