LLM Selection and Evaluation: Assessing Engineering Capabilities and Deployment Costs
This article explores how to evaluate large language models (LLMs) for specific engineering tasks rather than relying on general benchmark scores. It breaks down evaluation into four key agent capabilities, explains how to interpret benchmark scores accurately, and provides a framework for estimating both cloud API and local deployment costs. By following a structured approach, development teams can identify the most suitable model for their unique business scenarios while balancing quality, performance, and cost.
I. Why You Should Evaluate Models by Capability Dimensions
Model leaderboards typically provide a single comprehensive score, but developers care more about whether a model can accomplish specific tasks: fixing a production bug, building a service from scratch, or reliably calling external tools to complete a business workflow. A general score blends these capabilities together, often masking a model’s specific strengths and weaknesses.
Therefore, evaluations should first break down requirements into several capability dimensions, and then examine the model’s performance on corresponding tasks. Common dimensions fall into four categories: the ability to work within existing codebases, the ability to generate complete projects from requirements, the ability to correctly call tools and handle errors, and the ability to execute long-horizon, cross-industry tasks.
II. What the Four Agent Evaluation Tasks Measure
2.1 Engineering Capability in Existing Codebases
These tasks require the model to read real code repositories, understand the relationships between modules, locate the root cause of an issue, make cross-file modifications, and verify the effectiveness of the changes through tests or execution results.
The core of this evaluation is information retrieval and consistency maintenance within long contexts. The model must remember that a specific function is called in three different files and synchronize all call sites when the interface changes. In actual engineering, much time is spent reading and locating code rather than writing new code, making this capability particularly crucial for teams maintaining legacy projects.
When assessing this capability, focus on the following points:
- Can the model first reproduce the problem before modifying the code?
- Is the scope of modifications controllable, without inadvertently altering unrelated code?
- Does the model actually run tests after modifications, rather than merely claiming the issue is fixed?
2.2 Ability to Generate Complete Projects from Requirements
In these tasks, the input is a natural language requirement, and the output is a runnable, complete project. The evaluation focuses on whether the directory structure is reasonable, whether module divisions are clear, whether interfaces across multiple files align correctly, and whether the project includes a runnable entry point, dependency declarations, and basic documentation.
This evaluates planning capability. The model must first decompose the requirements into modules, decide on the file organization, and finally implement them one by one while maintaining interface consistency. If errors occur during the planning phase, significant import errors or interface mismatches will emerge later.
For rapid prototyping and scaffolding scenarios, this capability directly impacts development efficiency. However, generated projects still require manual review for security, error handling, and performance before they can be put into production.
2.3 Tool Calling and Workflow Integration Capability
Tool-calling evaluations require the model to select the appropriate tool from a set of available options, call them sequentially in the correct order, and adjust its strategy when a step fails. For example, if an order status query fails, the model should first check the parameter format, then decide whether to retry, switch to a fallback interface, or explain the situation to the user.
The key aspects of this capability are threefold: accurate tool selection, parameters matching the interface definition, and the ability to recover from errors. Many models perform well on single-step calls but struggle in multi-step chains; if the return value of an earlier step differs from expectations, they easily lose context or repeatedly execute completed operations.
When building agent applications, you can use a structure like the following to record each step, facilitating post-mortem analysis of failures:
from dataclasses import dataclass, fieldfrom typing import Any@dataclassclass ToolCallRecord:step: inttool_name: strarguments: dict[str, Any]status: str # "success" | "error" | "retry"error_message: str | None = None@dataclassclass TaskTrace:task_id: strrecords: list[ToolCallRecord] = field(default_factory=list)def failure_rate(self) -> float:if not self.records:return 0.0failed = sum(1 for r in self.records if r.status == "error")return failed / len(self.records)
By tracking failure rates, retry counts, and recovery success rates, you can transform “tool calling capability” from a vague impression into comparable metrics.
2.4 Cross-Industry Professional Tasks and Computer Operation
These tasks simulate real workplace scenarios, such as organizing data and generating reports, completing multi-step operations in graphical interfaces, or writing and delivering documents based on business rules. Tasks usually span a longer duration, requiring the model to plan steps autonomously and ensure the final deliverable is usable.
It evaluates three aspects: long-term planning (the ability to break large goals into executable sub-tasks and advance them in order), environment interaction (the ability to correctly understand interface states and operation results), and delivery reliability (whether the output is complete, formatted correctly, and self-checked).
When evaluating this capability, look beyond the final result to whether the intermediate process is explainable. A model that frequently goes off-track but accidentally completes a task poses a higher risk in production environments.
III. Considerations for Interpreting Evaluation Scores
Comparing scores across different evaluation reports is often more unreliable than expected. Even if two reports use the same task names, the actual conditions may vary significantly.
Evaluation results are typically influenced by the following factors:
- Agent Framework: The same model may perform noticeably differently under different schedulers and prompt templates.
- Context Length and Truncation Strategy: Whether long repositories are fully inputted or processed via summarization or retrieval directly alters the results.
- Reasoning Intensity Settings: Some models support adjustable thinking depth. Enabling deeper reasoning usually increases the success rate but also adds latency and cost.
- Number of Runs and Statistical Methods: Single-run results have high variance; taking averages or reporting confidence intervals is more reliable.
- Anti-Cheat Rules: Whether access to answers is blocked and whether network requests are restricted affects the credibility of the results.
Therefore, a reasonable approach is to write these conditions into the evaluation configuration and test candidate models under the exact same set of conditions:
evaluation:harness: fixed-internal-framework # All candidate models use the same schedulercontext_window_tokens: 128000reasoning_level: mediumruns_per_task: 5report: mean_and_stdanti_cheat:block_answer_lookup: truenetwork_access: restricted
If conditions cannot be unified, clearly annotate the differences in the report to avoid directly ranking scores generated under different conditions.
IV. Cost Evaluation: Cloud Pricing vs. Local Deployment
4.1 Cloud API Costs
Cloud pay-as-you-go billing is usually calculated based on the number of input and output tokens. When selecting a model, you need to monitor three factors: unit price, the average token consumption per task, and the retry cost after task failure. A model with a lower unit price that requires repeated retries may not result in a lower total cost.
Cost estimation can be calculated using the following formula:
Cost per task = (Input tokens × Input unit price + Output tokens × Output unit price) × Average calls / (1 − Failure rate)
The average calls and failure rate should come from your own business testing data, rather than numbers directly adopted from public reports.
4.2 VRAM and Storage for Local Deployment
Local deployment is primarily limited by VRAM and RAM capacity. The space occupied by model weights can be roughly estimated using the parameter count and quantization bit width, plus the cache and runtime overhead during inference.
def estimate_weight_memory_gb(params_billion: float, bits_per_weight: int) -> float:"""Estimate the memory occupied by model weights (GiB), excluding KV cache and runtime overhead."""total_bytes = params_billion * 1e9 * bits_per_weight / 8return total_bytes / (1024 ** 3)# Example: 30B parameter model, 4-bit quantizationprint(round(estimate_weight_memory_gb(30, 4), 1)) # Approximately 14.0
During actual deployment, you must also reserve space for the KV cache. The longer the context and the more concurrent requests, the larger the KV cache footprint. As a rule of thumb, it is recommended to reserve a 20% to 50% margin on top of the weight memory, depending on the inference framework and business load.
For storage, the size of the quantized weight file is basically consistent with the memory it occupies, but when multiple versions or quantization levels coexist, disk usage will multiply.
V. Steps for Model Selection by Business Scenario
- Clarify primary task types: Is it maintaining legacy code, generating new projects, handling tool calls, or executing long-horizon office tasks?
- Prepare an in-house test set: Extract 50 to 200 samples from real tickets or historical requirements, covering both common and edge cases.
- Fix evaluation conditions: Unify context length, reasoning intensity, scheduling framework, and number of runs.
- Record quality and cost simultaneously: In addition to the success rate, record average token consumption, latency, failure types, and manual correction time.
- Evaluate deployment constraints: Based on available GPUs, memory, and whether data is allowed to leave the local environment, determine whether cloud API or local deployment is more appropriate.
- Pilot before scaling: Run it in one team or module for a period before deciding on a full rollout.
VI. Conclusion
There is no one-size-fits-all ranking for model selection. General scores can only serve as an initial filter; the real basis should be the model’s performance on your specific business tasks, combined with the overall outcome under cost, latency, and deployment constraints.
Developers should separately focus on the four capabilities: engineering maintenance, project generation, tool calling, and long-horizon tasks, and compare results only after unifying evaluation conditions. For cost estimation, it is essential to simultaneously consider unit price, failure retries, and the hardware resources required for deployment. By following this methodology, teams can find the solution that fits them best with minimal trial-and-error costs.
