Setting Up a Unified Environment for Comparing Large Language Models
This article describes a repeatable way to compare large language models under the same conditions. It covers fixing test variables, choosing realistic development tasks, connecting third-party models to an agent runtime, verifying the setup, recording results, and analyzing performance across several dimensions. The approach does not depend on any specific product.
1. Background: Why Models Need a Unified Environment for Comparison
Large language models are being released and updated faster than before. Developers choosing a model often run into the same problem. Evaluation results for different models usually mix together toolchains, prompts, runtime parameters, and other factors. It is hard to tell whether a difference comes from the model itself or from differences in the test environment.
If the evaluation environment stays the same and only the model changes, the results become much easier to compare. This article describes how to build such an evaluation workflow with an agent runtime framework that supports multiple model providers. The method does not depend on a specific product. It applies to any runtime that supports third-party models and can load a shared set of tools.
2. Evaluation Design
2.1 Fix Variables and Change Only the Model
A fair comparison depends on controlling variables. An evaluation usually fixes the following:
- The version and run mode of the agent runtime. All models use the same configuration.
- The full prompt text, word for word. Do not adjust the wording for any single model.
- The set of available tools and skills. Every model should have access to exactly the same capabilities.
- The reasoning level. Either use each model’s default level or set all models to the same level. Choose one approach and state it in the report.
- The manual intervention rule. Preferably, do not intervene at all. Provide the prompt and let the model complete the task on its own, which reduces subjective influence.
If a variable cannot be kept identical, for example because models differ in how well they support a given tool, state this in the report. Do not treat it as part of the models’ capability differences, and do not ignore it.
2.2 Choose Tasks That Reflect Real Work
Task selection determines how broadly the results apply. Cover common stages of development work, such as:
- Generating a small feature module from a requirement description.
- Reading existing code, then locating and fixing a logic defect.
- Looking up the documentation for a dependency library and writing a usage example based on it.
- Turning an API description into a structured table or configuration file.
Define acceptance criteria for each task type in advance. Examples include passing predefined test cases, matching a required output format, following reasonable steps, and not omitting key constraints. The more specific the criteria, the less the judgment depends on subjective impressions.
2.3 Configure Tools and Skills
Many agent runtimes automatically scan a local skills directory and expose those capabilities to the model. For example, web search skills and documentation lookup skills may both be invoked. During evaluation, first inventory the skills directory. Confirm that every model under test can access the same set of skills, and save the configuration to a file so the run can be reproduced.
The following is an illustrative evaluation configuration. The field names only show the idea. Follow the documentation for your framework for the exact syntax.
eval_profile:run_mode: standardprompt_file: prompts/task_01.mdskills:- web_search- docs_lookupmodel_settings:reasoning_level: defaultmanual_intervention: false
3. Connecting Model Providers
Connecting a third-party model usually takes three steps: add a provider, register the model identifier, and verify the connection. The steps below use a common graphical interface as an example.
3.1 Add a Model Provider
In the settings page of the agent runtime, find the model configuration section and add a provider. Select the matching provider type, then enter the API key from that platform. API keys are sensitive credentials. Inject them through environment variables or a secrets management service. Do not write them into configuration files, commit them to a code repository, or print them in logs.
export PROVIDER_API_KEY="your-api-key"
Set this variable before starting the agent runtime. The runtime reads the key when it loads the configuration, so the configuration file only needs to contain the variable name.
3.2 Register a New Model Manually
After a model is released, the provider’s model list endpoint may not return it right away. In that case, try fetching the available models from the custom settings. If the target model is still missing from the list, add the model identifier manually and save.
The model identifier must match the name in the provider’s documentation exactly. Differences in capitalization, version suffixes, or hyphens can cause requests to fail or route to the wrong model version. Copy the identifier from the official documentation instead of typing it from memory.
3.3 Verify the Connection
After saving the configuration, do not start the formal evaluation right away. First, select the target model in the chat interface and send a simple request, such as asking it to repeat a fixed phrase exactly. Confirm that the response comes back normally. Then check the runtime logs and compare the model identifier actually called with the one in your configuration. This step looks minor, but it catches a wrong model call before the formal evaluation starts. Discovering that problem midway would invalidate the data.
4. Execution and Recording
4.1 Execution Rules
Follow these rules during the formal run:
- Start a new session for each model so that context does not carry over between them.
- Save the complete model output, tool call records, elapsed time, and error messages.
- Do not correct the model mid-run. Record errors as they occur, and explain them in the conclusions.
- Randomize the execution order of tasks to reduce systematic bias from timing or caching.
4.2 Structured Records
Store each run result as structured data so it is easy to analyze later. Example code:
import jsonfrom dataclasses import dataclass, asdict@dataclassclass RunRecord:model_id: strtask_id: strpassed: boolelapsed_seconds: floattool_calls: intnotes: strdef save_records(records, path="results.json"):with open(path, "w", encoding="utf-8") as f:json.dump([asdict(r) for r in records], f, ensure_ascii=False, indent=2)
Structured records let you calculate results by model, by task, or by failure type from one dataset. You do not need to go back through the raw conversations.
5. Analysis Methods
5.1 Compare Across Dimensions
A single overall score can hide differences between models. One model might perform well on code correctness but make noticeably more tool calls. Track at least the following dimensions separately:
- Task completion: whether all acceptance criteria are met.
- Correctness of code or output: whether the test cases pass.
- Process quality: whether the steps are clear and whether the model takes unnecessary detours.
- Tool efficiency: the number and necessity of tool calls.
- Latency: the time from submitting the task to receiving the final result.
5.2 Separate Chance from Consistency
Model outputs are somewhat random, so the same model may vary on the same task. For key tasks, run each one several times and report the pass rate instead of drawing conclusions from a single run. Choose the number of repetitions based on budget and task cost, and state it in the report.
5.3 Classify Failure Causes
Not all failures are the same. Group failure causes into categories, such as misunderstanding the requirement, tool call errors, code logic errors, and output format violations. Classification shows where a model is weak, which is more useful than the pass rate alone.
6. Considerations
- Evaluation results apply only to the selected tasks, settings, and tested versions. Do not generalize them to all development scenarios.
- Model versions keep changing. Include the test date and model version number in the report so readers can judge how current the results are.
- Web search results change over time. Record the search time and sources so others can reproduce the work.
- Third-party APIs charge fees and enforce quotas. Estimate costs before the evaluation so the run is not interrupted by insufficient quota.
- Keep evaluation scripts and configuration files under version control. Tie each evaluation to a traceable version record.
7. Summary
A unified toolchain, a fixed prompt, multi-dimensional records, and repeated runs form the basis for reliable model comparisons. Once this workflow is in place, the same method can be reused to evaluate new models, so selection decisions rest on reproducible data.
