AI Model Selection Guide: From Evaluation to Production Deployment

    This article explains how to select large language models for business use by decomposing requirements into measurable tasks, defining evaluation dimensions, building an internal benchmark, estimating latency and cost, and routing requests across models. It covers task quality, language and domain fit, reasoning, multimodal support, latency, throughput, cost, deployment options, common pitfalls, and an implementation checklist.

    1. Why Model Selection Has Become Harder

    The number of models is growing quickly, and versions are updated frequently. It is difficult to judge which model fits a business simply by looking at public leaderboards. Most leaderboards are based on general-purpose question sets or human votes, so they reflect average performance. What enterprises actually care about is stable performance on specific task types, per-call cost, response latency, and data compliance requirements. Model selection should therefore start from business requirements and use leaderboards as a reference, not the other way around.

    2. Define the Tasks First

    The first step in model selection is to break business requirements into measurable task units. Common task types include:

    • Text generation: copywriting, content summarization, style rewriting
    • Knowledge question answering: retrieval-augmented QA over enterprise documents
    • Code-related tasks: code completion, defect localization, unit test generation
    • Structured extraction: extracting fields from contracts or tickets and outputting JSON
    • Multimodal understanding: understanding and transcribing images, video, and audio
    • Agent tasks: automated workflows that require multi-step tool calls and data reads and writes

    Different tasks emphasize different model capabilities. Structured extraction values format adherence and output stability, knowledge QA values factual consistency and context length, and agent tasks value multi-step planning and reliable tool calling. After decomposition, record the input and output length distribution, peak request rate (QPS), and acceptable response time for each task type. These data points directly affect later cost and architecture decisions.

    3. Six Core Evaluation Dimensions

    3.1 Task Quality

    Quality is the primary selection criterion, but it must be defined for the specific task. For extraction tasks, use field-level accuracy and recall. For QA tasks, use human-labeled answer correctness and citation accuracy. For code tasks, use unit test pass rate. Avoid using subjective impressions such as “whether the answer is fluent” as the only standard.

    3.2 Language and Domain Fit

    Chinese-language scenarios require separate assessment, including terminology understanding, colloquial expression, classical Chinese and dialect handling, and recognition of industry abbreviations. Domain fit can be validated through prompt tuning with a small number of examples or through fine-tuning on domain corpora. The cost and effect of these two approaches differ significantly, so they should be recorded separately during evaluation.

    3.3 Reasoning and Multi-Step Task Capability

    Mathematical reasoning, logical inference, and long-chain tasks are key differentiators of model capability. During evaluation, design questions that require step-by-step derivation and check whether intermediate steps are correct, not just the final answer. For agent-based applications, also test whether the model can correctly retry or fall back when a tool call fails.

    3.4 Multimodal Capability

    If the business involves images or video, test recognition accuracy, detail capture, and understanding of temporal information separately. Token billing for multimodal input is usually higher than for plain text, so it must be calculated separately in cost evaluation.

    3.5 Latency and Throughput

    Latency usually consists of two parts: time to first token (TTFT) and generation rate. End-to-end latency can be approximated with the following formula:

    End-to-end latency ≈ time to first token + output tokens ÷ generation rate

    For example, if time to first token is 0.8 seconds, the output is 500 tokens, and the generation rate is 50 tokens per second, the end-to-end latency is approximately 0.8 + 500 ÷ 50 = 10.8 seconds. Real-time interactive scenarios usually require time to first token to stay within 1 second, while batch offline tasks focus more on throughput.

    3.6 Cost and Deployment Model

    For token-billed services, the cost of a single request is calculated as follows:

    Single-request cost = input tokens ÷ 1,000,000 × input unit price + output tokens ÷ 1,000,000 × output unit price

    Suppose the input unit price is CNY 2 per million tokens and the output unit price is CNY 8 per million tokens. If each request has 2,000 input tokens and 500 output tokens, the cost of 1,000 requests is: input part 2,000,000 ÷ 1,000,000 × 2 = CNY 4; output part 500,000 ÷ 1,000,000 × 8 = CNY 4; total CNY 8.

    The deployment model also affects total cost. Calling a cloud API is quick to start and requires no maintenance, but it carries risks related to data leaving the premises and vendor dependency. Private deployment keeps data controllable, but it requires bearing the cost of GPU purchase or rental, operations, and model updates. There are also hybrid approaches in which sensitive data goes to a local model and general requests go to a cloud service.

    4. Build Your Own Evaluation Set

    Public leaderboards cannot replace internal evaluation. A reliable evaluation set should meet the following requirements:

    1. Samples come from real business logs and are anonymized.
    2. Sampling is stratified by task type and difficulty, with enough samples in each stratum to support statistical judgment.
    3. Two or more annotators independently provide reference answers, and disagreements are adjudicated by a third party.
    4. The set is updated regularly to prevent models from overfitting to old samples.

    The following is an illustrative evaluation workflow for consistently recording quality and latency metrics:

    1. import time
    2. from statistics import mean
    3. def run_eval(model_client, dataset, judge):
    4. records = []
    5. for item in dataset:
    6. start = time.perf_counter()
    7. output = model_client.generate(item["prompt"])
    8. latency = time.perf_counter() - start
    9. score = judge(item["expected"], output) # returns a score between 0 and 1
    10. records.append({"score": score, "latency": latency})
    11. return {
    12. "avg_score": round(mean(r["score"] for r in records), 4),
    13. "avg_latency_s": round(mean(r["latency"] for r in records), 3),
    14. "sample_count": len(records),
    15. }

    During evaluation, fix the random seed and temperature parameters to ensure that comparisons across models are reproducible. For open-ended outputs, a judge model or rule-based validation can be introduced, but the scoring results should be spot-checked regularly to prevent bias in the scoring standard itself.

    5. Route by Task Instead of Betting on a Single Model

    In practice, few teams use only one model. A more common approach is layered routing based on task difficulty and cost sensitivity: simple extraction goes to a smaller, lower-cost model; complex reasoning goes to a more capable model; and a fallback path is retained for service timeouts or rate limiting.

    1. ROUTES = {
    2. "extract": "small_model",
    3. "qa": "medium_model",
    4. "code": "medium_model",
    5. "agent": "large_model",
    6. }
    7. FALLBACK = {
    8. "large_model": "medium_model",
    9. "medium_model": "small_model",
    10. }
    11. def pick_model(task_type: str) -> str:
    12. return ROUTES.get(task_type, "medium_model")
    13. def fallback_model(model_name: str) -> str | None:
    14. return FALLBACK.get(model_name)

    The routing table itself should be maintained based on evaluation results. After each model version change, rerun the evaluation set and update the routing rules.

    6. Common Pitfalls

    • Looking only at overall leaderboards and not at scores on business-relevant subtasks.
    • Drawing conclusions from a small number of samples and ignoring statistical variance.
    • Comparing only unit prices without calculating the full cost of each task, including retries, long context, and output length overhead.
    • Ignoring data compliance and sending data containing personal information directly to external services that have not been evaluated.
    • Selecting a model once and never retesting it, ignoring behavior changes caused by version updates.

    7. Implementation Checklist

    1. Map out business tasks and list the input and output characteristics and peak traffic for each task type.
    2. Build a stratified evaluation set from real logs and complete annotation.
    3. Record quality, latency, and per-request cost for each candidate model.
    4. Determine the deployment model based on data compliance requirements, using a hybrid approach when necessary.
    5. Design routing and fallback rules based on evaluation results, and validate them through a canary release.
    6. Set a regular retesting cycle and re-evaluate when model versions are updated or business requirements change.

    There is no one-time answer to model selection. The long-term stable approach is to rely on reproducible evaluation data and continuously iterate on routing strategies.