How to Run a Fair LLM Evaluation: Setting Up a Unified Environment for Multiple Models
Web chat interfaces add their own system prompts, default inference settings, and tool policies, so their answers reflect product behavior more than model capability. This guide explains how to build one evaluation environment with the same client, identical prompts, equal tool access, and fixed inference parameters. It also covers API setup, task design, scoring rubrics, metrics, and how to interpret the results.
1. Why Web Chat Interfaces Cannot Compare Models Fairly
Each model provider’s web interface comes with its own system prompt, default inference parameters, and tool policies. Even when two models answer the same question, they run under different conditions. As a result, web chat results mainly show the product experience. They cannot show the actual capability gap between the models.
A fair comparison requires every model to run in the same environment: the same client, the same prompt, the same tool permissions, and explicitly fixed, adjustable inference parameters. The sections below explain how to build this environment and how to design the scoring criteria.
2. Design Principles for a Unified Evaluation Environment
Consistent runtime environment: All models are called through the same client. Context management, history truncation, and streaming output handling use the same logic. Switching clients adds differences from the client itself into the results.
Explicitly fixed inference parameters: Do not rely on default values to align parameters. A default setting does not mean the parameters match. Default temperature, top-p, and maximum output length can differ widely between providers. Write parameters such as
temperature,top_p, andmax_tokensin the configuration, and use the same values for every model. If a model’s reasoning depth can only be changed through a provider-specific tier, record the selected tier in the test report and note whether it is comparable with the other models.Identical prompts: Use the same prompt for the same task, and do not tune it for individual models. No manual intervention is allowed during a test. The model receives the initial instructions and then plans, executes, and corrects its own work. Humans only record the results.
Equal tool access: All models receive the same tool list and permission scope. Store the tool list in a configuration file under version control so that the test can be reproduced.
3. Steps to Connect Multiple Models
The following steps use an agent orchestration tool that supports OpenAI-compatible APIs as an example. Menu names vary between tools, but the configuration fields are largely the same.
1. Create a provider configuration
In the tool’s settings, find “Models” or “LLM providers.” Add a new provider of the type “Custom / OpenAI-compatible,” then fill in the following fields:
- Base URL: Refer to the provider’s documentation. The format is
https://<provider-domain>/v1. - Authentication: Bearer token.
- Timeout: At least 120 seconds is recommended. Set it to 600 seconds for long reasoning tasks.
- Retries: 2 attempts with exponential backoff, using intervals of 2 seconds and then 4 seconds.
- Concurrency: No higher than the provider’s rate limit for your account. For the first test, set it to 2.
- Streaming: Enabled, so that you can measure time to first token.
2. Configure keys
Create an API key in the provider’s developer platform, and follow these requirements:
- Create a separate sub-account or project-level key for evaluation. Grant only the permissions needed to call the models.
- Do not write keys into configuration files or commit them to a code repository. Store them in environment variables, such as
MODEL_API_KEY_A, and reference only the variable name in the configuration. - Do not publish screenshots that show a key.
- Set a monthly usage cap or budget alert so that automated jobs cannot generate unexpectedly high costs.
- Rotate keys regularly. When team members change, revoke the old keys immediately.
- If test data contains real user information, anonymize it first.
3. Get model identifiers and register them
Click “Fetch available models” to sync the list of models your account can use. If a new model does not appear in the list, enter its model identifier manually in the advanced settings. The identifier must match the provider’s documentation exactly, including capitalization and version suffixes, for example model-name-v5-3. After saving, the model appears in the model dropdown of the chat interface.
4. Verify connectivity
Before running the formal test, confirm that the API responds from the command line. Set the BASE_URL and key environment variables first:
curl -s "$BASE_URL/chat/completions" \-H "Authorization: Bearer $MODEL_API_KEY_A" \-H "Content-Type: application/json" \-d '{"model":"model-name-v5-3","messages":[{"role":"user","content":"ping"}],"max_tokens":16,"temperature":0}'
A normal JSON response means the connection works. A 401 response means you should check that the key is valid. A 404 response means you should check the model identifier. A 429 response means you should lower the concurrency or wait for the rate limit window to reset.
4. Evaluation Tasks and Scoring Criteria
1. Deploy tools and plugins
In the skill extension area, install the following two types of tools in advance. Record their version numbers and permission scopes:
- Web search: Configure the search API key, set a per-minute request limit, and restrict the domains that can be accessed.
- Document lookup: Connect a read-only retrieval interface to a local knowledge base or a specified code repository. This prevents the model from modifying documents.
Also set a maximum number of tool calls per task, for example 30, to stop the model from getting stuck in repeated calls.
2. Task design and scoring criteria
The test set should include at least two task types:
- Information gathering and summarization: The model looks up the latest features of a given technology and writes a comparison report.
- Complex engineering coding: The model receives a requirement with several modules. It must create files, write code, run tests, and fix defects.
Use at least 10 tasks per type, for a total of 20 or more. For engineering coding tasks, the scoring rubric totals 100 points:
| Dimension | Points | Assessment method |
|---|---|---|
| Functional correctness | 40 | Check each item against the acceptance checklist |
| Test pass rate | 25 | Pass rate of automated tests |
| Self-correction | 15 | Whether the model can locate and fix errors after a failure. Count the number of repair rounds. |
| Delivery completeness | 10 | Whether files, documentation, and run commands are all provided |
| Process compliance | 10 | Whether the model exceeded its permissions or deleted unrelated files |
Score information-gathering tasks on three items: factual accuracy, source reliability, and structural completeness.
3. Metric definitions
In addition to task scores, track the following metrics:
- Task success rate: The share of tasks that pass all acceptance test cases.
- Tool call accuracy: The share of valid tool calls out of all tool calls.
- Repeated call rate: The share of total tool calls that repeat the same tool with the same parameters in a row.
- Token usage: Count input and output tokens separately, then convert them into cost.
- Time to first token: The time from sending the request to receiving the first streamed token. Record the median and the P90 value.
- Long-context instruction following: Check the model’s output against a list of constraints defined in advance, such as format, word count, and banned words, one item at a time.
Use blind human review as a supplement. Remove the model names, then have two reviewers score each output independently on a 1 to 5 scale for each item. If the two scores differ by more than 2 points, a third reviewer re-scores the output.
5. Interpreting the Results
A single run is affected by sampling randomness, variation in tool responses, and network conditions, so it should not be treated as a conclusion. Run each task with each model at least 5 times. Report the mean and standard deviation, or calculate a 95% confidence interval. If the gap between two models is smaller than the margin of error, describe them as “roughly equal” rather than “clearly stronger.”
Evaluation results only hold for the same task set, the same parameters, and the same tool environment. Changing the tasks or tool versions may change the conclusions. The report should fully record the test date, model identifiers, parameter values, tool versions, and the task list so that others can reproduce the test.
6. Troubleshooting Checklist
- All requests fail: Check the Base URL and network proxy settings first, then test the connectivity command on its own.
- Some tasks time out: Increase the timeout, or check whether the task triggered an overly long chain of tool calls.
- Results differ noticeably from the last run: Check whether a tool overrode the parameters, and confirm that the prompt version is the same.
- Search results are empty: Check the search API quota and domain allowlist.
- Costs exceed expectations: Check whether any task is stuck in a call loop, and confirm that the usage cap is in effect.
7. Local Runs vs. Cloud Deployment
Local evaluation suits individual developers and small-scale model selection. The setup is simple, data stays on your machine, and costs are easy to control. When you need to test multiple
