Agent Capability Evaluation and LLM Model Selection: A Practical Guide
A practical framework for evaluating how well LLMs handle agentic work and for choosing models that fit your task mix and cost constraints. As competition shifts from single-turn answer quality to multi-step task completion, this article defines what "agent capability" actually means, breaks evaluation into six measurable dimensions, and shows why single-step success rates compound so dramatically over long horizons. It then covers how to build a reproducible evaluation suite from real business tasks, how to run isolated multi-sample benchmarks, and how to translate per-token pricing into true per-task cost once retries, prefix caching, and human fallback are counted. It closes with a comparison of the three main model tiers by scenario rather than by ranking, and with the engineering practices — tool design, tiered routing, canary rollout, regression testing, observability — that turn model selection into a repeatable process instead of a one-off swap.
1. Introduction: Why Model Selection Logic Is Changing
Since 2026, competition among large models has shifted away from “is the single answer accurate?” toward “does the multi-step task actually get done?” Public leaderboards built around agent scenarios have appeared one after another, and mainstream models have increasingly focused on understanding goals, calling tools, and executing over long horizons. Many vendors now ship a dual line-up — a flagship model plus a lightweight one — leaving developers to trade capability ceiling against invocation cost.
With frequent version updates and a range of pricing schemes, three selection mistakes come up repeatedly:
- Copying leaderboard rankings while ignoring differences in task distribution;
- Comparing “price per million tokens” while ignoring the hidden cost of retries;
- Swapping models in one shot, without regression validation or a canary mechanism.
This article walks through what agent capability means, which dimensions to measure, how to run the evaluation, how to account for cost, and how to wire all of it into engineering practice — so you end up with a model selection method that is reproducible and measurable.
2. Clearing Up the Concept: What Is a Model’s Agent Capability?
2.1 Definition and the Closed Loop
A model’s agent capability is its ability to complete the following loop autonomously, without a human intervening at every step:
Understand the goal → plan the steps → call tools → inspect results → correct errors
This is fundamentally different from conventional Q&A:
| Dimension | Traditional Q&A / Code Generation | Agent Tasks |
|---|---|---|
| Interaction shape | Single input, single output | Multi-turn loop, incremental progress |
| Cost of failure | Answer is not ideal, just ask again | Deleted files, corrupted data writes — consequences may be irreversible |
| Context behavior | Essentially fixed | Grows continuously, and is repeatedly compressed or trimmed |
| What matters in evaluation | Answer quality | Whether the task completed, whether the process was compliant, whether cost stayed under control |
2.2 Error Accumulation: Why Long-Horizon Tasks Are Harder
If the success rate of a single step is p, the steps fail independently, and no error can be corrected by later steps, then an n-step task succeeds with probability roughly pⁿ:
| Per-step success rate p | 20-step task | 100-step task | 200-step task |
|---|---|---|---|
| 95.0% | 35.8% | 0.6% | ~0.003% |
| 99.0% | 81.8% | 36.6% | 13.4% |
| 99.5% | 90.3% | 60.6% | 36.7% |
The figures above are illustrative estimates meant to show the trend; they are not measured results for any specific model. Two things stand out:
- A difference of just 0.5 percentage points in per-step success rate produces a several-fold difference in overall success on a 200-step task;
- In long-horizon work, differences in controllability between models get amplified sharply.
Real agent systems usually have three buffering mechanisms that dampen error accumulation:
- Error retry: when a tool returns an error, the model uses that information to correct itself;
- Result verification: objective signals such as tests and assertions are used to judge progress;
- Rollback: after a failure, return to the last stable state.
Each buffer has a price, though: retries burn tokens, verification needs an extra execution environment, and rollback adds implementation complexity. So evaluating agent capability means asking not only “can it finish?” but also “at what cost does it finish?”
2.3 A Common Mistake: Agent Scores Are Not Traditional Benchmark Scores
Most traditional code benchmarks are answered against static files or in offline environments, then compared with actual results. Agent evaluation happens inside a tool-calling loop instead. The same model can perform noticeably differently under different “scaffolds” — system prompts, how tools are defined, how readable error messages are, the context compression strategy, the execution sandbox, and the retry policy.
On top of that, many models offer adaptive thinking: they decide how deep to reason based on task complexity, keeping latency and consumption low on simple tasks while spending more inference on hard ones. This injects randomness into model behavior, which makes repeated sampling and explicit statistical conventions all the more necessary for evaluation.
Conclusion: model selection should be benchmarked against agent tasks that resemble your own business, not against external leaderboard rankings.
3. Evaluation Dimensions: What Exactly Should You Measure?
Build your metrics around six dimensions, and make the judging method for each one explicit:
| Dimension | What to observe | How to judge |
|---|---|---|
| Tool-call correctness | Are function names, parameter types, enum values, and required fields correct? Can it read an error message and fix the call? | Schema validation + comparison of execution results |
| Long-horizon planning and replanning | Is the task decomposition sensible? Can it recover after interruption? Are adjustments after failure effective? | Run outcomes + trajectory spot checks |
| Context handling and consistency | Does it forget constraints in long conversations? Are cross-file edits consistent? Is key information lost after compression? | Dedicated test cases + constraint checks |
| Instruction following and output controllability | Are format, length, and style requirements respected? Is structured output parseable? | Automated assertions + rule checks |
| Reliability and safety | Is the success rate stable across runs? Does it respect permission boundaries? Can it recognize dangerous operations? | Repeated sampling + red-team cases |
| Efficiency and cost | Average step count, token consumption, cache hit rate, cost per task, end-to-end latency | Runtime log statistics |
A few additional points:
- In long-horizon tasks, the cause of failure is often not “wrong reasoning” but “forgot the instruction” or “inconsistent edits across files.” That is why constraint retention and consistency deserve their own line items rather than being folded loosely into “reasoning ability.”
- Output controllability directly drives integration cost. Every percentage point added to the structured-output parse failure rate means more fallback logic required in downstream systems.
- Safety is best validated with a red-team case set, including scenarios that induce the model to run destructive commands or leak credentials. Safety is best treated as a precondition for agent usability: a single irreversible mistake can erase every advantage gained on the other dimensions.
4. Evaluation Method: Making Results Reproducible and Comparable
4.1 Build a Layered Task Set
Your evaluation set should come from real business work, not from public problem sets. Build it in three layers:
- L1 — Basic: a single tool call or a few, such as lookups, formatting, small single-file edits;
- L2 — Workflow: multi-step business processes with verification, such as “fetch data → clean → write → verify”;
- L3 — Complex: open-ended long-horizon tasks, such as cross-file refactoring, or locating and fixing a defect based on an error message.
Each case should include:
- An initial environment snapshot;
- A task description;
- Automated assertions (check the final state, do not compare prose);
- The list of permitted tools and the scope of permissions.
Also tag each case with expected difficulty and business weight, so weighted scores can be computed later.
4.2 Isolated Execution and Multi-Sample Statistics
- Isolate: run every case in its own sandbox and destroy the environment afterwards, so cases cannot contaminate each other.
- Repeat: run each case at least 5 times and record:
- pass@1 (the average success rate of a single run);
- the proportion of runs that succeeded at least once;
- the variance of the success rate, which measures stability.
- Fix the scaffold: keep everything outside the model under test — prompt templates, tool definitions, retry policy — identical, so you are comparing the models themselves.
Rule of thumb: the fewer repetitions and the closer the success rate sits to 50%, the larger the uncertainty in the estimate. With 100 cases and a success rate near 50%, the 95% confidence interval is roughly ±10 percentage points; separating two models that differ by about 3 percentage points typically requires several hundred effective runs.
4.3 Objective Judging First, Human Spot Checks Second
The judge should be as objective and repeatable as possible:
- Do the unit tests pass?
- Do the database or filesystem states match expectations?
- Do the API responses satisfy the assertions?
Human spot checks should focus on the things that are hard to judge automatically — whether the agent took unnecessary detours, whether it touched permission boundaries.
4.4 Sample Evaluation Code
import statisticsfrom concurrent.futures import ThreadPoolExecutordef run_case(client, tools, case, sandbox, model, repeat):"""Run one case `repeat` times, each in an isolated sandbox"""runs = []for i in range(repeat):env = sandbox.snapshot(case["env_id"]) # create isolated env from the initial snapshottry:traj = client.run( # wrapped agent executorinstruction=case["instruction"],tools=[t for t in tools if t["name"] in case["allowed_tools"]],env=env,model=model,max_steps=case.get("max_steps", 50),system_prompt=case.get("system_prompt", ""),seed=i,)runs.append({"passed": case["assert_success"](traj, env),"steps": traj.steps,"input_tokens": traj.usage.input_tokens,"output_tokens": traj.usage.output_tokens,"cached_input_tokens": traj.usage.cached_input_tokens,})finally:env.destroy()return {"model": model,"level": case["level"],"pass1": sum(r["passed"] for r in runs) / repeat,"avg_steps": statistics.mean(r["steps"] for r in runs),"avg_input_tokens": statistics.mean(r["input_tokens"] for r in runs),"avg_output_tokens": statistics.mean(r["output_tokens"] for r in runs),}def evaluate(client, tools, cases, sandbox, model, repeat=5, workers=8):with ThreadPoolExecutor(max_workers=workers) as pool:results = list(pool.map(lambda c: run_case(client, tools, c, sandbox, model, repeat), cases))summary = {}for level in ("L1", "L2", "L3"):subset = [r for r in results if r["level"] == level]if not subset:continuesummary[level] = {"pass1": statistics.mean(r["pass1"] for r in subset),"stability": 1 - statistics.pvariance(r["pass1"] for r in subset),"avg_steps": statistics.mean(r["avg_steps"] for r in subset),"avg_input_tokens": statistics.mean(r["avg_input_tokens"] for r in subset),"avg_output_tokens": statistics.mean(r["avg_output_tokens"] for r in subset),}return summary
Here, pass@1 is the probability that a run succeeds — the chance that a single delivery works first time. stability is 1 minus the variance of success rates across cases, and measures how evenly the model performs across different cases.
After each round, archive the raw trajectory, tool-call logs, and verdicts for every case to object storage. That becomes your baseline for comparing versions.
5. The Cost Perspective: Turning “Unit Price” into “Cost per Task”
5.1 The Asymmetry Between Capability and Price
Mainstream models fall into three broad groups:
- Flagship reasoning models: large context windows and high single-response output limits, leading on complex long-horizon tasks, with a high unit price;
- High value-for-money models: capability close to the flagship, unit price clearly lower, suitable for most business scenarios;
- Lightweight / self-hosted models: the lowest or most controllable unit price, competitive where cost sensitivity and data compliance requirements are high.
One asymmetry shows up consistently in practice: price spreads across model tiers often span several times or even an order of magnitude, while success rates on the same class of agent tasks are distributed far more tightly.
What this means directly:
- For most business scenarios, the core problem is usually not “the gap between the flagship and the runner-up” but “moving overall success rate from 60% to 80%”;
- Running a baseline with the flagship model first, then testing an equivalent swap to a runner-up, often cuts cost significantly with almost no loss of experience.
5.2 Full-Chain Cost Model
The cost of one agent task should not be judged by the model’s unit price alone:
Total task cost = model call cost + tool execution cost + system rework cost + human fallback cost
Model call cost breaks down further into:
- Input cost: system prompts, tool definitions, message history, tool results, plus long documents or code fed into the context;
- Output cost: the final reply, plus intermediate reasoning content when thinking mode is on;
- Retry cost: re-running an entire trajectory after a single failure;
- Context accumulation cost: history is re-sent on every step, so input volume grows with the number of steps.
Expected cost can be approximated as:
E[call cost] = cost per successful trajectory × (1 - success rate) / success rateE[total cost] = E[call cost] + (1 - success rate) × human fallback cost per incident
Given context accumulation, a typical 100-step agent task can consume input tokens numbering several hundred times the length of its final context; the fixed prefix (system prompts, tool definitions, and so on) often accounts for a substantial share of that.
When comparing options with different unit prices and different success rates, a small script helps:
PRICE_TABLE = {# Price per million tokens (illustrative values; use your own billing rates)"flagship": {"input": 10.0, "output": 30.0, "cached_input": 1.0},"mid_tier": {"input": 3.0, "output": 15.0, "cached_input": 0.3},"lightweight": {"input": 0.5, "output": 2.0, "cached_input": 0.05},}HUMAN_FALLBACK_COST = 5.0 # Human fallback cost per incident (illustrative)def expected_task_cost(model, success_rate, max_steps=50,tools_input=1500, per_step_input=2000, output=400):price = PRICE_TABLE[model]# Accumulated input tokens across a multi-step trajectory (trapezoidal series)steps = [tools_input + i * per_step_input for i in range(max_steps)]total_in = sum(steps)cached_in = sum(s * 0.8 for s in steps[:1]) * max_steps # fixed-prefix cache hit, illustrativecost_once = ((total_in - cached_in) * price["input"]+ cached_in * price["cached_input"]+ max_steps * output * price["output"]) / 1_000_000expected_calls = (1 - success_rate) / success_ratereturn cost_once * (1 + expected_calls) + expected_calls * HUMAN_FALLBACK_COST
Take illustrative parameters with max_steps=50 and an 80% cache hit rate:
- Flagship model (90% success rate): each failure costs roughly 1.11 extra calls;
- Mid-tier model (unit price about 1/3 of the flagship, 85% success rate): roughly 1.18 extra calls per failure, so part of its price advantage gets cancelled out;
- Lightweight model (unit price about 1/20 of the flagship, 70% success rate): roughly 1.43 extra calls per failure.
With a human fallback cost of 5 per incident, the lightweight model ends up with the lowest total cost — “double the failure rate, and total cost can still drop by an order of magnitude.”
These parameters exist only to demonstrate the method and do not represent the performance of any real model. For an actual decision, plug in your own business’s success rate, step-count distribution, and human fallback cost, and recompute.
5.3 Cost Optimization Checklist
- Prefix caching: put system prompts, tool definitions, and stable knowledge snippets at the very front of the context and keep them unchanged, so the repeated portion hits the cache and input cost drops sharply. Some services apply a substantial discount to cached input tokens.
- Asynchronous batching: route offline tasks that can tolerate latency through the batch API, which usually carries a discount.
- Context governance: truncate or summarize tool results and compress message history, so context does not grow without limit.
- Promotional price ≠ long-term price: some models offer a limited-time introductory price at launch and then move to the standard rate. Do the math at the long-term price, and run sensitivity analysis on things like promo expiry, changes in cache hit rate, and usage tiers.
6. Comparing Model Types: Group by Scenario, Not by Rank
The table below is a neutral summary of model types, included to explain the selection logic. It does not refer to any specific vendor or product.
| Dimension | Flagship reasoning | High value-for-money | Lightweight / self-hosted |
|---|---|---|---|
| Typical positioning | Complex agent coding and enterprise workloads | A balance of speed and capability | Cost-sensitive, high data compliance requirements |
| Capability profile | Leads on long-horizon tasks and controllability | Close to flagship on most tasks | Sufficient for simple tasks; complex tasks need verification |
| Cost profile | High unit price, few retries | Noticeably lower cost per task | Lowest unit price, or fixed resource cost |
| Typical scenarios | Cross-file refactoring, complex defect fixes, long workflow automation | Code assistants, ticket handling, batch data processing | Intent recognition, parameter extraction, local processing of sensitive data |
A typical model mix looks like this:
- Flagship reasoning models: good as the fallback for hard cases and as a baseline reference;
- High value-for-money models: good as the workhorse for most business scenarios;
- Open-source / privately deployable models: good for data-sensitive scenarios, and for cases that need your own fine-tuning and cost control.
Public leaderboards focused on agent scenarios usually report thinking and non-thinking modes separately. Such leaderboards are best used as a coarse filter rather than as the final decision input, for three reasons:
- Task distribution bias: the leaderboard’s problems may not cover your business distribution;
- Scaffold differences: the leaderboard’s prompts and tool setup may not match your system;
- Freshness: results change as versions are updated and evaluation methods are revised.
The more robust approach, then, is to use leaderboards to narrow the candidate list, and your own evaluation set to make the final call.
7. Engineering: Fitting Evaluation and Selection into the Development Process
7.1 Tool Design Sets the Capability Ceiling
- Give every tool a clear JSON Schema and a set of error codes, and validate parameters before execution;
- Put a second confirmation or a dry-run mode in front of dangerous operations (delete, overwrite, permission changes);
- Return tool results in a structured form containing status, data, and the error reason, so the model can correct itself;
- Follow least privilege in the execution environment, and never pass sensitive credentials into the model’s context.
7.2 Tiered Routing: Match Model Capability to Task Difficulty
import json# Illustrative rule-based routing: pick a model tier from task type and complexity.# In a real system, the classification signal can come from an intent-recognition# model, a task-size estimate, or human-authored rules.def select_model(request):tier = request.get("tier", "mid") # easy / mid / hardmode = request.get("mode", "sync") # sync / asyncif mode == "async":return {"tier": "light", "batch": True}return {"easy": "light", "mid": "mid", "hard": "flagship"}[tier]def build_messages(system_prompt, tools, history, user_input):# Put the fixed prefix first so it can hit the cache; put compressed history after itmessages = [{"role": "system", "content": system_prompt},{"role": "system", "content": json.dumps(tools, ensure_ascii=False)}]messages.extend(history)messages.append({"role": "user", "content": user_input})return messages
The value of tiered routing is that:
- Simple tasks are handled by lightweight models, lowering overall cost;
- Complex tasks go to flagship models, protecting the success rate;
- Offline tasks take the asynchronous path, compressing cost further.
7.3 Canary Release and Continuous Regression
- Establish a baseline: snapshot the evaluation results of the current production model as the baseline;
- Canary at low traffic: let the new model take 5%–10% of traffic first, and compare success rate, average step count, cost, P95 latency, and other metrics;
- Roll back on anomaly: automatically switch back to the old model when core metrics degrade significantly;
- Retest on a schedule: any change to prompts, tool definitions, or the model version triggers a regression evaluation, to prevent “silent degradation.”
7.4 Observability and Data Security
- For every agent run, record: the model and version, input and output token counts, cached token volume, the tool-call trajectory, error codes, and the final verdict;
- Build a metrics dashboard covering success rate, average step count, cost per task, and human intervention rate;
- Periodically attribute failures to root causes and feed those cases back into the evaluation set.
If you build this on Baidu AI Cloud, general-purpose cloud capabilities can support the evaluation and runtime stack:
- Model services: to host inference calls;
- Object storage: to keep datasets, trajectories, and evaluation baselines;
- Message queues: for task dispatch and asynchronous execution;
- Logging, monitoring, and alerting: to collect runtime metrics and fire alerts on anomalies.
Refer to the official documentation and pricing details for current availability, quotas, and billing.
8. Summary: An Actionable Selection Decision Process
- Define task tiers and success criteria: split business tasks into L1/L2/L3, and give each tier success criteria that can be asserted automatically;
- Build your own evaluation set: accumulate 100–300 cases from real scenarios, covering tool calling, long-horizon planning, context consistency, safety, and controllable output;
- Unify the scaffold and the judging method: fix prompts, tool definitions, and retry policy, and combine an objective judge with human spot checks;
- Sample multiple times: repeat at least 5 times, and report pass@1, stability, and average step count together;
- Account for cost end to end: compare on “cost per successful task” rather than “token unit price,” including retries, cache hits, and human fallback cost;
- Route in tiers and cache aggressively: match model capability to task difficulty, and cut cost with prefix caching and asynchronous batching;
- Canary and regress: validate a new model at low traffic before a full switch, and put continuous monitoring and scheduled retesting in place.
In the end, agent model selection is not about “finding the strongest model” but about “finding the optimal balance of success rate, latency, and cost within your own task distribution and cost constraints.” Once this evaluation process becomes an engineering capability, your team can decide on data rather than instinct — no matter how fast model versions keep changing.
