[INDEX] // ALL_DOCS ›
[TOC] // ON_THIS_PAGE ›
LLM evaluations can run alongside your tests in GitHub Actions. Use a small sample to check the evaluation path on each change, then run the full dataset before you choose a model or ship a release.
Start with a smoke test
Complete the quickstart and install the Machine GitHub App on your repository. Start with $10 of free GPU time. No charge, no commitment. Unpaid teams get one concurrent runner and a 30-minute job limit.
This workflow evaluates a small Qwen model on ten HellaSwag examples using
lm-evaluation-harness.
Save it as .github/workflows/eval.yml, then run it from the Actions tab.
name: LLM evaluation smoke test
on: workflow_dispatch
permissions:
contents: read
jobs:
evaluate:
runs-on: machine/id=${{ github.run_id }}-${{ github.run_attempt }}/gpu=l4/tenancy=spot
timeout-minutes: 25
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install evaluation tools
run: |
python -m venv .venv
.venv/bin/python -m pip install torch==2.7.1 --index-url https://download.pytorch.org/whl/cu128
.venv/bin/python -m pip install 'lm_eval[hf]==0.4.9' transformers==4.55.2 peft==0.17.1
- name: Run a small evaluation
run: |
nvidia-smi
.venv/bin/python -m lm_eval \
--model hf \
--model_args pretrained=Qwen/Qwen2.5-0.5B-Instruct,dtype=float16 \
--tasks hellaswag \
--device cuda:0 \
--batch_size 1 \
--limit 10 \
--output_path results
- uses: actions/upload-artifact@v4
with:
name: evaluation-results
path: results/
if-no-files-found: error
The dependency pins keep this harness version on the model APIs it expects. Upgrade them together when you change the evaluation environment.
Ten examples prove the evaluation runs. They don’t establish model quality. The first run also downloads the model and dataset, which counts towards the job’s timeout.
Turn it into a regression check
Choose tasks that represent what your application does. Keep the task settings
and sample size fixed between the baseline and candidate. Set revision in
--model_args to the model commit you’re testing and record the dataset revision
with the results. A moving model revision is a fairly efficient way to make a
comparison mean nothing.
Download the evaluation-results artifact to inspect the scores. The workflow
above fails on execution errors, but it doesn’t fail when accuracy drops. Add a
step that reads the result JSON and compares the chosen metric against your
baseline and tolerance. Decide those thresholds from repeated runs, not from a
single score that happens to look good.
For head-to-head comparisons and plotting, the Language Model Arena repository contains a larger example. Check its dependency pins and runtime limits before using it for your own models.
Run it on pull requests
Start with manual runs on trusted revisions. When you add a PR trigger, decide
who can submit code to it and review fork PRs before allowing execution. Don’t
use pull_request_target to check out and execute untrusted PR code.
Keep PR evaluations small. Paid compute or a plan removes the free-tier 30-minute limit, but it doesn’t make an eight-benchmark suite a quick check. Use a separate release workflow for the full run, with an explicit timeout.
If you’re testing a serving path rather than model quality, start with the vLLM smoke test. For ordinary tensor code, use the PyTorch GPU test.