Selecting and Deploying LLMs by Scenario: A Practical Guide to Model Routing, Evaluation, and Inference Optimization

    Choosing the right large language model (LLM) is rarely about picking a single "best" model. Different tasks—from brainstorming to high-frequency production execution to mathematical reasoning—demand different trade-offs between intelligence, speed, cost, and stability. This article presents a scenario-based framework for LLM selection and deployment, covering task-layer classification, five core evaluation dimensions, and engineering practices such as cascaded routing, quality gatekeeping, and inference throughput optimization. The goal is to help teams move beyond leaderboard comparisons and build a sustainable model pool that aligns with real business requirements.

    The Problem: No Single Model Fits Every Scenario

    In real-world R&D, teams often hope a single “strongest model” can handle everything: brainstorming, code generation, complex math reasoning, and high-frequency execution tasks—all at a low inference cost. From an engineering perspective, this expectation is rarely realistic. Different tasks impose different requirements on model capabilities:

    • Exploratory tasks benefit from divergent thinking, interactivity, and strong context understanding.
    • Production execution tasks prioritize instruction following, output stability, response speed, and unit cost.
    • Math and proof-heavy tasks demand long-chain reasoning, rigor, and self-verification.
    • Large-scale deployment requires attention to throughput, concurrency, GPU memory utilization, and canary release capabilities.

    Therefore, model selection should not be reduced to a single leaderboard comparison. It must be driven by the business scenario itself. A model that excels in one category may not be irreplaceable in another. A common pattern: Model A performs well in brainstorming but lacks speed in high-frequency execution; Model B has comparable intelligence but significantly faster response times, making it a better fit for production pipelines. The final decision should answer three questions:

    1. Is the task high-frequency?
    2. Is the quality gap acceptable?
    3. Do speed and cost meet service-level objectives (SLOs)?

    Layer by Task Type Before Comparing Models

    A practical approach is to divide LLM applications into four layers.

    Layer 1: Exploratory tasks — such as solution brainstorming, requirement clarification, ideation, and technology roadmap comparison. These tasks tolerate ambiguity, value conversational experience and breadth of thinking, and can rely on human filtering. Stronger models with longer context windows are appropriate here.

    Layer 2: Production execution tasks — such as format conversion, code completion, log analysis, ticket summarization, and rule-based text generation. These require stability, speed, and monitorability. Models with low latency, high throughput, and consistent output formatting should be prioritized.

    Layer 3: High-risk reasoning tasks — such as mathematical proofs, complex fault diagnosis, and architecture trade-off analysis. These require long reasoning chains, step verification, and result review. A single-turn answer is not sufficient.

    Layer 4: Batch offline tasks — such as data cleaning, corpus annotation, and offline evaluation. The focus here is minimizing cost per token.

    After this stratification, the model becomes not a monolith but a pool routed by task. Exploratory tasks can invoke stronger models; execution tasks use fast models; high-risk tasks use reasoning models with verification; offline tasks use low-cost models. This preserves the value of high-quality models while avoiding unnecessary cost across all traffic.

    Evaluation Dimensions: Quality, Speed, Cost, Stability, and Controllability

    An evaluation set for model selection should cover at least five dimensions:

    • Quality: correctness, completeness, format adherence, factual consistency
    • Speed: time-to-first-token, end-to-end latency, throughput
    • Cost: cost per request, cache hit rate, retry cost
    • Stability: long-context degradation, output variance under concurrency, failure rate
    • Controllability: system prompt adherence, structured output capability, sensitive-content control, observability

    The evaluation set should come from real business data, not just public benchmarks. It is advisable to sample dozens to hundreds of examples per task type to form a regression set, with both human ratings and automated metrics recorded. For execution tasks, format accuracy and one-pass rate often matter more than “how polished the answer looks.” For math reasoning, intermediate steps and final conclusions must both be inspected—a correct-looking final answer by chance is not sufficient. For exploratory tasks, blind evaluation and multiple raters help reduce individual bias.

    Brainstorming: The Strongest Model Isn’t Always Required

    Brainstorming tasks are open-ended, error-tolerant, and interaction-heavy. High-quality models can provide richer perspectives, but not every step needs the most expensive model. A practical pattern is: use a strong model to set the framework, and a fast model to expand. The stronger model generates problem decomposition and candidate directions; the fast model then expands, categorizes, and tags at scale. Human review handles the final selection.

    The value of brainstorming is not equal to parameter count or benchmark score. If the task is simply to generate candidate lists, rewrite phrasing, or summarize meeting notes, a fast model is often sufficient. Stronger models are only justified when the task involves complex constraints, cross-domain knowledge integration, or multi-round rebuttal. Traffic should be layered even in brainstorming scenarios to avoid routing all open-ended queries to high-cost models.

    Production Execution: Speed and Stability Take Priority

    Production execution tasks are latency-sensitive. In online code assistants, customer support, log summarization, and ticket classification, longer wait times degrade user experience. In batch tasks, throughput directly impacts infrastructure cost and queue backlog. A model that is slightly less capable but several times faster may be more suitable than the “strongest model.” The key observation can be summarized as follows: when two models show comparable quality on a target task, the one with an order-of-magnitude advantage in speed and throughput often becomes the default choice.

    However, this does not mean speed should unconditionally override quality. Execution tasks must have explicit quality gates, such as structured-output parsing success rate, field completeness, code runnability, and manual sampling pass rate. Only after these thresholds are met should speed and cost become the primary ranking criteria. Engineering-wise, a cascaded strategy works well: a fast model handles the request first; if confidence is low or format validation fails, the request escalates to a stronger model. This reduces average latency and cost while maintaining quality.

    Math Reasoning: Capability Layering and Review Mechanisms

    Math proofs, complex logical derivation, and open-ended problem exploration place the highest demands on model capability. These tasks cannot be judged by a single answer. Instead, evaluators must observe whether the model can maintain long-chain consistency, correctly interpret problem conditions, and produce inspectable intermediate steps. For propositions without published proofs, the model must demonstrate the derivation, not merely restate known conclusions. For open problems, the model should clearly state assumptions, boundaries, and uncertainties.

    A robust approach for math reasoning is: reasoning model for draft generation + fast model for formatting and consistency checks + domain expert review. The reasoning model generates proof drafts and key steps; the fast model handles typesetting, rewriting, symbol checks, and consistency verification; and human experts conduct final review. Evaluation should examine proof structure, lemma usage, and counterexample checks—not just the final answer. For high-risk conclusions, human confirmation must remain mandatory; model output cannot be treated as final.

    Inference Deployment: Throughput Determines Commercial Viability

    Beyond model capability, inference efficiency directly affects unit economics. Through batching, continuous batching, quantization, caching, parallelism, and specialized inference hardware, throughput per rack or cluster can be significantly improved. Higher throughput reduces per-request cost and determines peak concurrency capacity and offline task completion time. For self-hosted models, teams must monitor GPU memory utilization, scheduling strategy, and fault recovery. For external model APIs, they must track rate limits, retries, and cost ceilings.

    In practice, cloud service providers such as Baidu AI Cloud offer a foundation of model services, container platforms, object storage, log services, and monitoring/alerting capabilities that can support a unified evaluation, routing, and canary-release system. The goal is not to lock into one model, but to make the model pool replaceable, observable, and rollback-capable. Log services should record request type, latency, cost, and failure reasons; monitoring alerts should detect quality degradation; and container platforms should enable elastic scaling.

    Engineering Practice: Routing and Evaluation Loops Over Subjective Judgment

    A task-routing pseudocode at the application layer can be structured as follows:

    1. function route(task):
    2. if task.type == "explore":
    3. return strong_model_pool
    4. if task.type == "production_exec":
    5. return fast_model_pool_with_fallback
    6. if task.type == "math_proof":
    7. return reasoning_model_pool_with_review
    8. if task.type == "offline_batch":
    9. return low_cost_model_pool
    10. return default_pool

    An evaluation loop should run continuously: run the regression set before any model switch; observe latency, cost, and failure rate during canary releases; validate fast-model outputs through format checks with escalation to a stronger model on failure; and enforce intermediate-step logging and human review for high-risk tasks. Only by turning model selection from a one-time subjective comparison into an ongoing process of evaluation and routing governance can teams achieve a stable balance between quality, speed, and cost.

    Conclusion

    LLM selection is not about finding one absolutely strongest model—it is about building a combination of models aligned with business scenarios. Exploratory tasks value divergent thinking; execution tasks value speed and stability; math reasoning values rigor and review; deployment values throughput and cost. Teams should establish scenario stratification, quantitative evaluation, cascaded routing, and observable governance mechanisms to avoid being misled by single experiences or leaderboard rankings. The end goal is to route every task to an appropriate model, achieving better response speed and unit cost while keeping quality acceptable.