LLM Selection Guide: Pricing, Capabilities, and Agent Workflow Testing
Choosing a large language model for agent workflows requires more than comparing per-token prices. This guide explains why the same task can vary in cost by two orders of magnitude, how to evaluate input modalities, context limits, output budgets, and reasoning modes, and how to run a repeatable benchmark that measures first-pass success rate, average turns, cost per task, and human review time. It includes a four-dimension selection framework, a suggested trial order, and common pitfalls to avoid.
1. The Problem: Why the Same Task Can Cost Two Orders of Magnitude More
In real engineering work, a single loop of an agent that reads files, writes code, and calls tools can cost anywhere from a few cents to several dollars, depending on the model. Many teams instinctively pick the cheapest option, but the real bill often comes from somewhere else: a cheap model fails once and triggers multiple retries, while a more expensive model passes on the first attempt and ends up costing less overall.
So the first principle of model selection is not to compare unit prices, but to break the problem into two layers:
- Capability layer: whether the input modalities are covered, whether the context is large enough, whether the single-response output budget is enough to finish the work, and whether tool calling and structured output are reliable.
- Cost layer: how billing works (how input, output, cached, and reasoning tokens are priced), the retry rate, and the cost of human acceptance.
Comparison only makes sense when both layers sit in the same table.
2. Align on Inputs and Acceptance Criteria Before Discussing Cost
2.1 Input Side: Modality and Context Are Hard Requirements
Most mainstream LLMs today support text and image understanding, and some also accept video input directly. Context lengths have generally reached the million-token range, but a “nominal context” is not the same as “usable input”: some implementations reserve room for output and system overhead, pushing the maximum input down to roughly 90% of the advertised value.
Engineering recommendations:
- Measure the P95 input length using real samples, not the average.
- For very long documents, combine chunking, summarization, and retrieval instead of stuffing the entire context at once.
- For video tasks, prioritize models with native video input to avoid the information loss and extra compute caused by extracting frames into images.
2.2 Output Side: The Single-Response Budget Determines the Task Shape
The maximum output per response is a seriously underestimated metric. It determines whether a model can “write an entire module in one pass” or whether the work must be split into multiple continuations. Common differences include: a lower output limit in non-reasoning mode and a doubled limit in reasoning mode; a large default output that is constrained by the remaining context; and a mid-range output budget that requires chunked assembly.
Illustrative decision logic:
def can_finish_in_one_shot(task, model):need = estimate_output_tokens(task) # estimated output lengthbudget = model.max_output_tokens # single-response output budgetctx_left = model.context - task.input_tokensreturn need <= min(budget, ctx_left)
If this returns False, switch to a pipeline of “chunked generation + validation + merging” rather than repeatedly retrying the same prompt.
2.3 Reasoning Mode: Trading Quality for Latency and Cost
Whether the “thinking” or reasoning mode is enabled raises output length, latency, and cost across the board. The pattern is that structured extraction, format conversion, and simple classification do not need reasoning, while multi-step reasoning, code refactoring, and complex tool orchestration do. Making reasoning mode a configurable switch rather than a global default is key to controlling cost.
3. A Four-Dimension Selection Framework
| Dimension | Question to confirm | Consequence of misjudgment |
|---|---|---|
| Input modality | Is native video/image input required? | Information loss, extra preprocessing cost |
| Context | Does the nominal value match the maximum input? | Long documents get truncated |
| Output budget | Can the target artifact be finished in one pass? | Multiple continuations, doubled bill |
| Billing model | How are input/output/reasoning tokens priced? | Low unit price but high total cost |
It is worth stressing that names like “Max”, “Flash”, and “Pro” are only product-tier labels. Neither context length nor suffixes can prove agent success rates. Spec sheets are only for filtering candidates, not for ranking effectiveness.
4. A Practical Trial Order and Re-Testing Method
4.1 Suggested Order
- High-frequency image/text and structured tasks: start with a low-cost model that takes image and text input and has a mid-range output to establish a cost baseline.
- Budget-sensitive work that needs a larger generation budget: add a model with a generous output budget for comparison.
- Tasks involving native video input: keep only candidates that support video understanding for the next round.
- Complex agents: use the same task set for the final decision.
4.2 Designing the Re-Test Task Set
Prepare 30–50 real business samples covering: short input and short output, long-document Q&A, code generation, multi-tool chaining, and failure retries. Record four metrics consistently:
first-pass rate = number of samples accepted without human edits / total samplesaverage turns = total interaction turns / number of samplescost per task = Σ(input tokens × input price + output tokens × output price)human time = minutes spent on acceptance and fixes
4.3 How to Interpret the Results
- If the first-pass rate differs by within 5%, treat it as no significant difference and choose the cheaper one.
- The cost per task must be multiplied by the average number of turns to reflect real spending.
- Folding human time into the total cost often reverses the “unit price ranking”.
5. Common Pitfalls
- Treating the nominal context as usable input.
- Looking only at the output unit price while ignoring reasoning tokens and retries.
- Using public leaderboards instead of business re-testing.
- Enabling reasoning mode globally.
- Force-converting video tasks by extracting frames.
6. Conclusion
The essence of selection is “achieving the acceptance criteria at the lowest total cost”. Align on inputs and acceptance first, filter candidates with the four-dimension framework, and finally re-test with a unified task set. That is a reusable engineering method. If your team already uses the relevant model services from Baidu AI Cloud, it is also recommended to run a side-by-side validation using the re-testing approach in this article, letting data rather than spec sheets make the decision.
