How to Evaluate and Select LLM Agents: A Controlled-Variable Testing Method and Engineering Practices

    Choosing the right large language model (LLM) for an AI agent is harder than picking a top score on a public benchmark. This article introduces a controlled-variable evaluation method that keeps the agent framework, memory, skills, tools, prompts, and reasoning settings fixed so that only the model changes. It then defines a five-stage task suite covering skill packaging, page development, document and presentation generation, knowledge base management, and browser automation with cost control. Finally, it explains how to interpret results in terms of capability versus cost, build tiered model routing with fallback strategies, and apply engineering practices such as offline evaluation sets, token and failure logging, high-risk tool confirmation, and regression testing for skill quality.

    1. Why Model Selection Gets Harder in the Agent Era

    In the past, evaluating an LLM usually meant looking at a few public leaderboard scores. In agent scenarios, however, a model does more than answer questions. It continuously reads context, calls tools, maintains memory, executes multi-step tasks, and self-corrects when something fails. Single-turn question answering is no longer enough to represent real performance.

    Common pain points in real engineering include:

    • A model can write code but cannot reliably identify local skill files.
    • It can generate a page but ignores existing design specifications.
    • It forgets the goal midway through a long task.
    • High-risk operations lack a confirmation mechanism.
    • Context consumption varies dramatically for the same task, causing budgets to spiral out of control.

    This article therefore does not focus on any specific vendor product. Instead, it abstracts a controlled-variable evaluation method that helps developers decide, within a limited budget, which class of model is better suited as the primary agent model.

    2. Evaluation Design: Change the Variable, Not the Environment

    For results to be credible, everything except the model must stay identical. It is recommended to fix the following elements:

    1. The same agent framework version.
    2. The same memory store content and retrieval strategy.
    3. The same skill directory and permission declarations.
    4. The same system prompt and output format constraints.
    5. The same tool set and timeout values.
    6. Reasoning effort uniformly set to the highest supported level.

    An illustrative evaluation configuration looks like this:

    1. agent:
    2. memory: fixed_snapshot_v1
    3. skills: [packager, browser, slides, kb_search]
    4. tools:
    5. - file_read
    6. - file_write
    7. - shell_limited
    8. - http_request
    9. policy:
    10. high_risk_action: confirm
    11. max_steps: 40
    12. model:
    13. reasoning: high
    14. temperature: 0.2

    Only in such a controlled environment are differences between models comparable.

    3. Five-Stage Task Design: Observing the Full Chain from Capability to Cost

    Stage 1: Skill Packaging Capability

    The model is asked to turn a long system prompt into a publishable, installable, and reusable capability package, and to self-check potential failure points. Key observations:

    • Whether it understands “packaging” rather than “copying”.
    • Whether it produces clear metadata and usage instructions.
    • Whether it proactively points out boundary conditions and exception paths.

    This stage quickly filters out models with unstable instruction following.

    Stage 2: Page Development Capability

    Given design constraints and component specifications, the model must generate a runnable page. Evaluation dimensions include:

    • Whether the structure is reasonably semantic.
    • Whether the styling follows existing design tokens.
    • Whether empty, loading, and error states are handled.
    • Whether undeclared dependencies are avoided.

    Stage 3: Document and Presentation Content Generation

    The model must produce structured documents and a presentation outline from raw material. Focus areas:

    • Whether the information hierarchy is clear.
    • Whether there is any factual over-extension.
    • Whether output follows the specified template consistently.

    Stage 4: Knowledge Base Management

    The model completes chunking, tagging, deduplication, and retrieval strategy design. Observe whether it has:

    • Awareness of data governance.
    • A basic understanding of recall and reranking.
    • Consideration of permissions and isolation.

    Stage 5: Browser Automation and Cost Control

    This is the most context-consuming stage. The task involves multi-step clicking, form filling, and result verification. Record:

    • Completion rate.
    • Average number of steps.
    • Context growth curve.
    • Whether repeated, ineffective operations occur.
    • Whether confirmation is requested before risky actions.

    4. Interpreting Results: Look at the Cost, Not Just Whether It Can Be Done

    Three typical conclusions often emerge from the evaluation:

    • Capability-oriented: high task completion but heavy context consumption, suitable for short tasks or offline batch processing.
    • Balanced: a reasonable trade-off between completion and cost, suitable as the default primary model.
    • Economy-oriented: stable on simple tasks, but complex multi-step tasks require stronger orchestration and verification.

    A more reasonable approach is therefore not to pick a single “strongest model”, but to build tiered routing:

    1. Simple Q&A and summarization -> economy model
    2. Routine coding and documentation -> balanced model
    3. Complex planning and debugging -> capability model + human confirmation

    This should be paired with a fallback strategy: when the step limit is exceeded or context approaches a threshold, automatically switch models or hand over to a human.

    5. Engineering Implementation Recommendations

    1. Build an offline evaluation set to avoid trial and error in production.
    2. Log token consumption and failure reasons for every run.
    3. Set whitelists and secondary confirmation for high-risk tools.
    4. Include skill packaging quality in regression tests.
    5. Periodically review how model version changes affect stability.

    6. Conclusion

    The core of agent selection is not chasing a single score, but validating the balance of stability, controllability, and cost in a unified environment. Mastering the controlled-variable evaluation method and tiered routing is what makes it possible to build a long-term usable agent system under a limited budget.