LLM Selection for AI Agent Scenarios: Task Design and Cost Evaluation
Selecting a large language model for agent workloads requires more than comparing benchmark scores. This guide explains how agent scenarios differ from plain Q&A, how to control experimental variables, how to design five categories of evaluation tasks, how to estimate real token costs under different billing models, and how to audit stability and safety behaviors such as confirmation of risky actions. It includes a YAML configuration template, a Python script for aggregating run records, and a checklist for packaging skills before publication.
1. Problem Definition: How Agent Scenarios Differ from Plain Q&A
In plain Q&A, a model only needs to generate a single response. Agent scenarios are different. The model must read memory, invoke skills, manipulate files, access web pages, and maintain state across multiple steps. Each decision affects subsequent actions, so model selection cannot be based solely on single-response quality. You also need to evaluate long-chain stability, tool-calling accuracy, and cost predictability.
In engineering practice, three problems usually arise during model selection. First, public leaderboard scores do not always match real task performance. Second, token consumption for the same task can vary by several times across models, so cost estimates based on unit price alone will diverge from the actual bill. Third, pay-as-you-go billing and subscription quotas are measured differently, and availability after quota exhaustion also differs, which directly affects the continuity of daily work.
Therefore, an effective evaluation method must answer three questions at once: Can the model complete the task? How many resources does completion consume? Does any unacceptable behavior occur along the way?
2. Controlling Variables: Making Comparisons Trustworthy
The premise of a controlled comparison is changing only one factor at a time. If memory, skills, permissions, and tools all change together, the results cannot be attributed to the model itself. It is recommended to fix the following:
- Memory store and context files, with versions recorded
- Skill directory and skill versions
- System prompts and permission policies
- The set of callable tools
- Reasoning effort level (set uniformly where the model supports it, and record the actual value)
The experimental configuration can be centralized in a single file, where only the model field is swapped between runs:
agent:memory_dir: ./memoryskills_dir: ./skillstools: [file_read, file_write, web_fetch, browser]permission_mode: confirm_risky # high-risk actions must wait for user confirmationreasoning_level: high # set uniformly and record the actual valuemodel:provider: candidate_a # only these two lines change per experimentname: model-id-here
Once the configuration is fixed, every candidate model runs in an identical environment. Only then do result differences primarily reflect the model’s own capabilities and behavior.
3. Designing Five Categories of Typical Tasks
The principle of task design is to cover the main capability areas of an agent, with clear pass/fail criteria for each task. The five categories below can serve as sequential gates: if a model fails an earlier gate, later results have limited reference value.
3.1 Skill Packaging
The goal is to turn a long design prompt into a publishable capability package. This is not a simple copy of the original text. The model must extract trigger conditions, input/output contracts, constraint rules, examples and counterexamples, and reorganize them into a structured document.
There are three evaluation criteria. After loading into a new session, the skill is triggered correctly. The output structure matches the intent of the original prompt. No local paths, account information, or internal addresses remain in the finished artifact.
After producing the output, the model should be asked to run a self-check and list potential failure points—for example, trigger words that are too broad and conflict with other skills, dependencies on local files that are missing in other environments, or contradictions between constraints. The ability to accurately identify its own weak points is a key indicator for this gate.
3.2 Web Development
The goal is to generate a working page from requirements, including structure, styling, and interaction logic. Evaluation criteria include: the page opens normally, core interactions work, there are no unhandled errors in the browser console, and all referenced external resources are accessible.
3.3 Presentations and Copywriting
The goal is to convert raw material into a presentation outline, per-slide copy, and layout guidance. Good output usually satisfies several conditions: each slide carries a single argument, every number is traceable to its source material, and the same concept uses consistent terminology throughout.
3.4 Knowledge Base Management
The goal is to deduplicate, classify, and index scattered notes, and to update outdated entries. This gate tests the model’s ability to organize large volumes of text, as well as its operational caution. Before deleting or merging entries, the model should list the planned changes and wait for confirmation. Evaluation criteria include retrieval recall matching manual spot checks, and no deletions performed without confirmation.
3.5 Long-Chain Browser Automation
The goal is to complete multi-step operations in a web page, such as searching, filtering, and exporting results. This type of task is the main source of token consumption, because each step typically carries the current page state. Evaluation criteria include task completion rate, average number of steps, and total tokens per task.
In practice, two safeguards are recommended: set a maximum step count, after which the run stops automatically and reports its status; and compress historical page states, keeping only the parts relevant to the current decision.
4. Cost Evaluation: Unit Price vs. Actual Spending
Unit price is only part of the cost. Actual spending depends on how many tokens the task itself consumes, and that number varies with the model’s reasoning style and the length of tool-returned content.
The table below summarizes the main differences between the two billing models:
| Dimension | Pay-as-you-go | Subscription quota |
|---|---|---|
| Billing unit | Number of input and output tokens | Usage allowance within a time window |
| Cost predictability | Fluctuates with task length | Fixed within quota; restricted after exhaustion |
| Suitable scenarios | Batch tasks, automated pipelines | Interactive development, long conversations |
| Main risk | A single long task overspends | Quota exhausted early, disrupting later work |
The cost of a single task can be approximated with the following formula:
Single-task cost ≈ input tokens × input unit price + output tokens × output unit price
Note that content returned by tool calls also counts toward input tokens. In tasks involving heavy browser automation or file reading, this portion often dominates.
When estimating quota consumption, run each task category at least three times and take the median to reduce the impact of random fluctuation.
5. Stability and Safety Behavior
Beyond task completion rate, two easily overlooked behavior categories need evaluation.
The first is skill recognition failure. The model may fail to load a skill file that already exists locally. Possible causes include unclear skill descriptions, path resolution errors, or a skill index in the context that was not read correctly.
The second is missing confirmation for high-risk actions. When a task involves deleting files, sending messages, modifying permissions, and similar operations, the permission policy requires the model to ask first. If the model executes directly, the run should be marked as failed even if the task result is correct.
In addition, disconnections or state loss in the middle of long tasks can also cause failure and should be recorded separately.
The code below shows how to aggregate run records. It combines pass rate, median token consumption, and the count of unconfirmed high-risk actions in one summary:
from dataclasses import dataclass, fieldfrom statistics import median@dataclassclass RunRecord:task_id: strpassed: boolinput_tokens: intoutput_tokens: intrisky_actions: int = 0confirmed_risky_actions: int = 0notes: list[str] = field(default_factory=list)def summarize(records: list[RunRecord]) -> dict:if not records:raise ValueError("records must not be empty")total = len(records)passed = sum(1 for r in records if r.passed)risky = sum(r.risky_actions for r in records)confirmed = sum(r.confirmed_risky_actions for r in records)return {"pass_rate": passed / total,"median_total_tokens": median(r.input_tokens + r.output_tokens for r in records),"unconfirmed_risky_actions": risky - confirmed,}
In the summary, unconfirmed_risky_actions should be 0. Any value greater than 0 indicates a safety behavior problem under the current permission policy and should be addressed first.
6. Self-Check Checklist for Skill Packaging
Before publishing a skill, check each item in the following list:
- Are the trigger conditions specific enough to distinguish this skill from existing ones?
- Are any local paths, accounts, internal addresses, or personal information left in the artifact?
- Are the constraints actionable? For example, “ask when necessary” must define what counts as necessary.
- Do the examples cover both normal inputs and edge cases?
- Are the version number, dependencies, and runtime prerequisites documented?
Skill metadata can be described in a unified manifest file to make installation and maintenance easier for others:
name: design-prompt-packagerversion: 1.0.0description: Turns design-oriented prompts into structured, reusable capability packagestriggers:- User asks to organize an existing prompt into a publishable capability packageinputs:- Raw prompt textoutputs:- Structured skill document and self-check conclusionsrequirements:- No external service dependencies
7. Conclusion and Practical Recommendations
For agent scenarios, LLM selection should rely on experiments rather than intuition. In practice, follow these steps: fix every variable except the model; design pass/fail criteria per task category; record pass rate, token consumption, and confirmation behavior together; and distinguish unit price from actual usage in cost calculations.
Selection conclusions are not permanent. Task structures, billing rules, and model versions all change over time. It is therefore recommended to re-test periodically and archive each experiment’s configuration alongside its results for future comparison.
