LLM Selection and AI Agent Capability Evaluation: A Practical Guide

    This guide explains how to evaluate large language models and AI agents beyond a single "intelligence" score. It covers breaking model capability into multiple dimensions, assessing agent-specific behavior such as instruction following and tool-call accuracy, running layered code-generation tests, calculating total cost of ownership, and building a small in-house benchmark with a regression cadence so teams can choose the right model mix under real cost and latency constraints.

    1. Reframing the Problem: From “Which Is Stronger” to “Which Fits Better”

    As competition among general-purpose large language models (LLMs) moves into deeper water, comparing raw “intelligence” alone has lost engineering value. The core contradiction raised in the original discussion is a common one: one model may lead by a wide margin in breadth of knowledge, yet generate backend code worse than a more specialized model, and fall behind a third option at frontend interface generation.

    This points to the first principle of selection: model capability is a multi-dimensional vector, not a scalar score. What engineering teams actually need to answer is:

    1. Which capability dimensions does the business scenario require (reasoning, long context, code, multimodality, tool calling);
    2. What is the minimum acceptable threshold for each dimension;
    3. Given those thresholds are met, whether cost per token and latency stay under control.

    2. Breaking Down Capability Dimensions: New Evaluation Coordinates for the Agent Era

    2.1 From a “Q&A Model” to an Agent Capable of Acting

    The essential change in today’s top-tier models is that they are no longer passive text completers that only respond, but executors that can decompose tasks, call tools, and plan across multiple steps. When evaluating such models, traditional leaderboard scores are less informative, and the focus should shift to:

    • Instruction-following stability: whether the goal drifts across multi-turn tasks;
    • Tool-call accuracy: reasonableness of function selection, argument filling, and retry after failure;
    • Long-horizon task completion rate: whether tasks requiring more than ten operations converge;
    • Context retention: whether key constraints are forgotten in long conversations.

    An illustrative structure for evaluation records could look like this:

    1. {
    2. "task_id": "T-042",
    3. "scenario": "multi-step data repair",
    4. "steps_planned": 12,
    5. "steps_succeeded": 10,
    6. "tool_call_accuracy": 0.91,
    7. "constraint_kept": false,
    8. "avg_latency_ms": 2300
    9. }

    2.2 Layered Evaluation of Code Capability

    The observation in the original discussion — weaker at backend than one option, weaker at frontend than another — points to an engineering fact: code capability must be tested in layers, and a vague notion of “programming ability” has no decision value. At minimum, split it into four layers:

    • Code completion: prediction accuracy within a local context;
    • Cross-file refactoring: whether module dependencies are understood and interfaces kept consistent;
    • Server-side logic generation: rigor in transaction handling, concurrency control, and error boundaries;
    • UI and style generation: layout fidelity, responsive adaptation, accessibility.

    A reusable criterion: hand the same requirements document to each candidate model, then measure “the share that compiles on the first attempt” and “the proportion of lines requiring manual edits.” This is more reliable than any subjective impression.

    3. Cost-Performance: The Underrated Selection Variable

    The original text’s point about “very capable but poor cost-performance” is common in engineering. Model cost cannot be judged by unit price alone; a total cost of ownership (TCO) view is needed:

    • Token consumption factor: stronger models tend to be more verbose with longer output, inflating actual billed volume;
    • Retry cost: a model with slightly lower accuracy triggers repeated retries, and the hidden cost may overtake the savings;
    • Human review cost: in code scenarios, engineer correction time is the most expensive part;
    • Room for architectural mixing: routing simple tasks to a lightweight model and complex tasks to a high-capability model is usually more economical than a single model.

    The routing logic can be expressed in pseudocode:

    1. def route(prompt, history):
    2. if is_simple_classification(prompt):
    3. return light_model
    4. if requires_multi_step_planning(prompt):
    5. return agent_capable_model
    6. return balanced_model

    4. A Practical Scenario-Based Benchmark Plan

    Do not rely on external reputation. Build a small in-house evaluation set of 50 to 200 items that reflects the real business distribution:

    1. Sample real requests: draw from historical tickets and requirements documents, then desensitize before storing;
    2. Set hard metrics: compile pass rate, unit test pass rate, format compliance rate, factual error rate;
    3. Set soft metrics: readability, naming conventions, comment completeness, blind-rated by two engineers;
    4. Fix a regression cadence: rerun after every model version change to form a trend curve rather than a single-point conclusion.

    Capability fluctuation across version iterations is normal; leading in one version does not mean leading in the next. A regression mechanism therefore matters more than a one-off comparison.

    5. Engineering Support: Making Model Capability Actually Land

    Selecting a model is only the starting point. Production requires general cloud capabilities, typically including object storage to hold datasets, a message queue to decouple asynchronous tasks, a container platform to run inference and business services, and logging plus monitoring and alerting for quality observation. Baidu AI Cloud offers a fairly complete set of product categories in this kind of general cloud infrastructure and model serving, and can serve as one reference option for teams building an evaluation and launch pipeline.

    It is also advisable to establish three lines of defense: sensitive-information filtering on the input side, structured validation on the output side (such as JSON Schema validation), and sandboxing with least privilege on the execution side. Illustration:

    1. schema = {"type": "object", "required": ["patch", "reason"]}
    2. result = validate(model_output, schema)
    3. if not result.ok:
    4. result = retry_with_feedback(result.errors)

    6. Conclusion

    “Which model is stronger” is a question with no endpoint. The right move is to convert it into “under my scenario and my cost constraints, which combination is optimal.” Replace a single score with a capability vector, replace vague impressions with layered code tests, replace unit-price comparison with total cost of ownership, and replace external reputation with an in-house regression evaluation set — and the team can keep stable selection judgment in an environment of rapid model iteration.