LLM Selection Guide: Evaluation Methods for Agent-Centric Scenarios
This article provides a practical framework for selecting large language models (LLMs) in agent-based applications. It clarifies core LLM concepts, reviews technology evolution, compares deployment options (cloud API, local open-source, hybrid), and defines evaluation dimensions such as task quality, instruction following, tool-calling reliability, latency, cost, and compliance. A lightweight Python benchmark script is included to run task-specific evaluations, emphasizing that reusable selection methods matter more than one-time rankings.
1. Clarifying the Basics: What Is a Large Language Model
A large language model (LLM) is a deep-learning-based AI system trained on massive text corpora to learn statistical patterns and semantic structures of language. It can understand natural language input and generate coherent text. Common capabilities include text generation, knowledge Q&A, code writing, logical reasoning, and summarization/rewriting.
To approach model selection, you first need to understand several core characteristics:
- Large parameter scale: Parameter counts typically range from billions to hundreds of billions. Parameter size correlates with capability, but not linearly—models of similar scale can differ significantly across tasks.
- Pretraining plus fine-tuning: Models first learn general language skills from broad corpora, then adapt to specific tasks via instruction tuning or domain fine-tuning.
- Emergent abilities: Beyond a certain scale threshold, models show marked improvements in multi-step reasoning, code generation, and similar tasks. The universality of “emergence” is still debated, but in engineering practice it means that the capability boundary between small and large models must be confirmed through actual testing.
- Multimodal capabilities: Some models process image, audio, or even video input, which is useful for document parsing, chart understanding, and similar scenarios.
- Tool-calling ability: Models can output structured invocation requests based on predefined function descriptions, allowing external programs to execute file I/O, database queries, message sending, etc. This is a key foundation for building agent applications.
2. A Brief Technology Evolution
- 2017: The Transformer architecture was introduced. Its self-attention mechanism replaced recurrent structures, enabling parallel training and long-range dependency modeling. Nearly all mainstream LLMs since then have used it as their backbone.
- Around 2018: Pretrained language models gained traction. The “pretrain then fine-tune” paradigm began to replace heavy task-specific feature engineering.
- 2019–2020: Model parameter sizes expanded rapidly. Researchers systematically observed scaling effects, and few-shot prompting became an important usage pattern.
- 2022–2023: Conversational interfaces significantly lowered the usage barrier, moving LLMs from research into general consumer and enterprise products.
- 2024–2025: Multimodal input, long context, and tool-calling capabilities strengthened noticeably. Agents became a hot application area. For engineering teams, the value of a model now hinges more on its reliable completion of multi-step tasks than on single-turn Q&A performance.
This evolution shows that model iteration is fast and specific selection conclusions have a short shelf life. Therefore, a reusable selection methodology is more valuable than a one-time ranking.
3. Deployment Categorization
3.1 Cloud API Models
Cloud API models are hosted by the service provider, and your application calls them over the network.
- Advantages: No need to maintain GPU resources; access to new capabilities quickly; typically pay-per-use; low startup cost.
- Risks: Data must leave your environment; dependency on network and service availability; pricing and rate limits are controlled by the provider.
3.2 Open-Source Locally Deployable Models
Model weights can be downloaded and deployed on your own servers or terminals.
- Advantages: Data stays within your domain; easier to customize; controllable long-term cost; suitable for offline inference.
- Risks: You must handle inference hardware, GPU memory planning, model quantization, service monitoring, and other operations. The quality of single-run inference often requires dedicated tuning to approach the level of closed-source models.
3.3 Hybrid Deployment
Hybrid deployment keeps sensitive data processing on-premises while sending complex tasks to cloud models. Another common pattern uses a small model for high-frequency, simple requests and forwards only a small number of difficult cases to a large model. This architecture requires clear routing rules and consistent output formats between the two ends—otherwise downstream programs will fail frequently.
4. Categorization by Application Scenario
- General-purpose LLMs suit open-ended tasks such as Q&A, writing, translation, and code assistance. They have broad coverage but may not achieve the highest accuracy in specialized domains.
- Vertical-domain models are optimized for terminology and regulations in fields like healthcare, law, and finance, delivering more stable performance on professional corpora. You still need to verify their knowledge freshness and capability boundaries before use.
- Tool-calling models focus on structured output and function selection. They are especially critical for agent systems, because a single incorrect parameter can break the entire workflow.
5. Why There Is No Single “Best” Model
“Best” depends on tasks, constraints, and team capabilities. The same model may perform very differently on customer-service summarization, code completion, and contract review. Common constraints include:
- Whether data can be sent externally.
- The maximum latency per request.
- Daily call volume and budget.
- Whether image or audio input is required.
- Whether the team can handle local operations.
By listing these constraints clearly, you can usually narrow the candidate set to two or three models.
6. Building an Evaluation Framework
Evaluate candidate models across the following nine dimensions:
- Task quality: Accuracy on real business samples, not just public benchmark scores.
- Instruction following: Whether the model strictly adheres to output format requirements—for example, whether the JSON structure is complete.
- Tool-calling reliability: Whether function selection is correct, parameter types are valid, and state is maintained across multi-step calls.
- Context length: Whether the model can accommodate the required document size and whether information at the end of long texts is effectively used.
- Multimodal capabilities: Recognition quality for images, tables, scanned documents, etc.
- Latency and throughput: Time-to-first-token, tokens per second, and stability under concurrent peaks.
- Cost structure: Pay-per-call vs. resource-based billing; estimate monthly expenses for full traffic.
- Data compliance: Whether data retention, training usage terms, and access audits meet your requirements.
- Replaceability: Whether the interface uses a standard protocol and how much code must change when switching models.
In practice, task quality and data compliance are usually veto items; the other dimensions are weighted and scored.
7. Running Real Tests with a Small Evaluation Set
Public benchmarks reflect performance on generic test sets and cannot replace business-specific data. Below is a simplified evaluation scaffold. The idea is: prepare representative samples, use a uniform prompt, record outputs and timings, then score by keywords or custom rules.
import timefrom dataclasses import dataclass, field@dataclassclass EvalCase:prompt: strexpected_keywords: list[str] = field(default_factory=list)max_latency_s: float = 10.0def keyword_score(text: str, keywords: list[str]) -> float:if not keywords:return 0.0hits = sum(1 for k in keywords if k in text)return hits / len(keywords)def run_benchmark(generate, cases: list[EvalCase]) -> dict:"""generate: a callable that takes a prompt string and returns text; connect each candidate accordingly."""scores, latencies = [], []for case in cases:start = time.perf_counter()output = generate(case.prompt)elapsed = time.perf_counter() - startlatencies.append(elapsed)score = keyword_score(output, case.expected_keywords)if elapsed > case.max_latency_s:score *= 0.5 # penalize timeouts to balance quality and latencyscores.append(score)return {"avg_score": sum(scores) / len(scores),"avg_latency_s": sum(latencies) / len(latencies),"max_latency_s": max(latencies),}
To use it, implement a unified generate function for each candidate model and run the same batch of samples across all candidates. Keyword scoring is only suitable for structured tasks with clear answers. For open-ended writing, you need human ratings or a separate judge model—and that judge model itself must be validated.
The evaluation set does not need to be large. 50 to 200 well-chosen samples that cover the main business scenarios are usually sufficient to identify meaningful differences. Avoid overfitting to a tiny set; instead, iterate with a few batches that reflect real traffic patterns. Record not only the final score but also failure modes—for example, whether a model consistently mishandles a certain function call or produces malformed JSON. These findings often lead to more actionable decisions than aggregated numbers.
Conclusion
Selecting an LLM for agent scenarios is not about chasing the highest public benchmark score. It requires clarifying your data boundaries, latency and budget constraints, expected task types, and the team’s operational capacity. Use a structured evaluation framework, test with real or near-real business samples, and verify tool-calling reliability and output consistency. Because the model landscape changes quickly, the ability to re-run a lightweight evaluation—and to swap models with minimal code changes—becomes a lasting competitive advantage.
