How to Make LLM Evaluations Reproducible: A Practical Guide to a Unified Framework

    This guide explains how to run a fair, reproducible comparison of large language models with a unified evaluation framework. It covers defining the evaluation goal, fixing the toolchain, prompts, and inference parameters, preparing test sets for code generation, math reasoning, long-document question answering, and tool calling, running repeated tests, and reporting results with confidence intervals. It also covers API key security and the limits of what the results can show.

    Define what the evaluation should answer

    Before you start, write down the evaluation goal. “Which model is better?” is too broad to measure directly. A more specific question works better: “For my code review scenario, which model has the higher pass rate, and what does a single call cost?” The more specific the question, the easier it is to decide the test set, metrics, and parameters.

    Official figures published by vendors have three typical limitations. First, the vendor chooses the test set, which often favors its own model. Second, prompt templates and inference parameters are not fully published, so outsiders cannot reproduce the results. Third, some test sets may already be in the training data, which inflates the scores. Official figures are therefore useful as leads, but they should not be used directly as the basis for model selection.

    To make the comparison fair, at least five conditions must hold:

    • Same toolchain: All models are called through the same evaluation framework and the same configuration file.
    • Same prompts: Each task uses a prompt that is identical word for word. No prompt is adjusted for an individual model.
    • Same inference parameters: Temperature, top_p, maximum output length, and random seed are set to the same values for all models.
    • Same external conditions: Run on the same machine, in the same network environment, and within the same time period.
    • No manual generation: Humans design the test questions and verify the scoring only. They do not write or edit model outputs.

    Environment checklist

    The table below is the baseline configuration for this guide. Adjust it to fit your environment, but record the actual versions you use.

    Item Recommended setup Notes
    Operating system Ubuntu 22.04 or macOS 14 Compatible with the dependencies of the code execution sandbox
    Node.js 20.x LTS Required to run promptfoo
    Python 3.11 Used for scoring scripts and data processing
    Docker 24.x or later Isolates code generated by models
    Evaluation framework promptfoo, pinned to the version you test with The examples below are based on its configuration structure
    Network Fixed egress, record latency Avoids network fluctuations affecting timing comparisons

    Do not depend on latest for long-term installs. Confirm the version number first, then pin it:

    1. node -v # Check the Node.js version
    2. npm install -g promptfoo@<the version you tested with>
    3. promptfoo --version

    Create a separate project directory. Keep all configurations, data, and results in it, and track changes with git:

    1. mkdir llm-eval-2026 && cd llm-eval-2026
    2. git init
    3. mkdir -p prompts tests data results scripts

    Step 1: Install and verify framework features

    After installation, run promptfoo --help and promptfoo eval --help to confirm that your version supports the parameters used below, such as the output file path, concurrency, and number of repetitions. Parameter names can differ between versions, so rely on the help output on your own machine.

    The framework usually ships with sample configurations. These help you get familiar with the interface, but do not use them for formal evaluation. Their questions and prompts are not designed for your scenario.

    Step 2: Connect