Large Language Model Selection by Scenario: A Practical Engineering Guide
This guide explains how to move from personal model preferences to a scenario-driven selection and integration process for large language models. It defines four task profiles, a six-dimension evaluation scorecard, prompt and context engineering practices, retrieval-augmented generation and tool calling, a three-layer evaluation system, a decoupled integration architecture, and cost and capacity considerations, along with a practical rollout roadmap.
1. Reframing the Problem: From “Which Model Do You Prefer” to “How to Select by Scenario”
For everyday Q&A, broad analysis, focused research, and project delivery, developers and business teams tend to develop their own habits. Some tools respond quickly in lightweight conversations, some are more stable at long-text reasoning, some excel at aggregating material and organizing topics, and some fit engineering integration better. The original material captures this experience-based intuition of dividing work by scenario.
From an engineering perspective, that intuition needs to be abstracted into a reusable and verifiable selection method, for three reasons:
- Model capabilities keep iterating, so any fixed preference becomes outdated quickly.
- The same task can perform noticeably differently across data distributions, and subjective experience is not enough to support production decisions.
- Application results depend not only on the model itself but also on prompts, context organization, tool calling, and the post-processing pipeline.
This article therefore does not compare specific products. Instead, it reframes the topic as a general technical question: how to establish a scenario-driven standard for model selection and integration.
2. Scenario Abstraction: Common Traits of Four Typical Task Types
Abstracting everyday usage experience yields four task profiles:
- Lightweight Q&A: short inputs, many turns, latency-sensitive; emphasizes response speed and natural expression.
- General reasoning: requires multi-step reasoning, induction, and trade-offs; emphasizes logical consistency and long-context retention.
- Focused research: involves integrating multiple sources, extracting key points, and producing structured summaries; emphasizes information coverage and traceability.
- Project integration: requires stable interfaces, structured output, observability, and permission governance; emphasizes engineering controllability.
These profiles are not mutually exclusive. Real business needs are often combinations; a customer service assistant, for example, may include both lightweight Q&A and project integration requirements. The first step in selection is to map business needs to these profiles and set priority weights.
3. A General Capability Evaluation Framework: Six Dimensions
To avoid being misled by a single metric, use a multi-dimensional scorecard. The dimensions below are common industry concepts and do not point to any specific implementation:
| Dimension | Focus | Typical Validation |
|---|---|---|
| Semantic understanding | Intent recognition, ambiguity resolution | Accuracy on a labeled set |
| Reasoning stability | Multi-step reasoning consistency | Repeated chained-question tests |
| Long context | Key information recall | Needle-in-a-haystack retrieval tests |
| Structured output | JSON/table compliance rate | Schema validation pass rate |
| Latency and throughput | P95 latency, concurrency capacity | Load testing and canary observation |
| Controllability and safety | Refusal policy, content filtering | Red-team regression cases |
The key to the scorecard is configurable weights. Lightweight Q&A scenarios can raise the weight on latency; project integration scenarios can raise the weight on structured output and controllability.
4. Prompt and Context Engineering: Reducing Uncertainty
Model capability sets the upper bound; prompts and context organization determine the lower bound. Three principles are recommended in practice:
- Make roles and constraints explicit: define task boundaries, output format, and prohibited items.
- Layer the context: inject system instructions, task descriptions, reference material, and user input in separate layers to avoid cross-contamination.
- Use examples: a few high-quality examples constrain style and structure more effectively than long descriptive wording.
Example prompt skeleton:
[System] You are a rigorous technical analysis assistant. Answer only based on the given material; state clearly when information is insufficient.[Task] Output a JSON with the fields summary/points/risks.[Context] {{retrieved_docs}}[User] {{question}}[Constraint] points must not exceed 5 items, each no more than 40 characters.
Combined with structured output validation, this can significantly reduce post-processing costs:
import json, jsonschemadef parse_and_validate(raw: str, schema: dict) -> dict:data = json.loads(raw)jsonschema.validate(instance=data, schema=schema)return data
5. Retrieval Augmentation and Tool Calling: Making Answers Traceable
The core pain point in focused research and project scenarios is that “the knowledge is not in the model parameters.” The general approach is retrieval-augmented generation: retrieve first, constrain the model to answer only from the retrieved snippets, and return citation sources. Engineering attention is needed on:
- Document chunking strategy and metadata design;
- Separate evaluation of retrieval and reranking;
- Alignment of citation anchors with the original text;
- Explicit fallback when no answer exists, to avoid fabrication.
For tool calling, abstract external capabilities as “function contracts”: the model produces the call intent, the business side executes it and writes back the result, forming a closed loop. This preserves the model’s language ability while keeping side-effect operations in a controllable engineering layer.
6. Evaluation System: From Subjective Experience to Regression Metrics
Selection without evaluation is just an exchange of opinions. Build three layers of evaluation:
- Offline labeled set: covers the four scenarios, version-pinned, used for regression.
- Online canary: compares latency, failure rate, and sampled human satisfaction under small traffic.
- Red-team cases: targeted regression for risks such as privilege escalation, injection, and sensitive content.
For metrics, avoid looking only at averages; observe percentiles and the distribution of failure modes as well. A solution that meets the P95 latency target but collapses on long-context recall is equally unusable in production.
7. Integration Architecture: Decoupling the Model from the Business
Recommended: push the model layer down into a replaceable adapter layer, with the business depending only on a unified contract:
Business service -> Model adapter layer -> (configurable model backend)|-> Structured validation / Logging and monitoring / Permissions and quotas
The adapter layer handles protocol conversion, timeout retries, fallback, and instrumentation. The model backend is switched through configuration, avoiding tight coupling between business code and a specific implementation. For observability, cover at least call volume, latency percentiles, error code distribution, and output compliance rate; avoid logging sensitive raw text, and mask it when necessary.
8. Cost and Capacity: Putting the Numbers on Engineering Metrics
Cost should not be judged by unit price alone but converted into “cost per unit of effective output.” Recommended metrics: token consumption per thousand successful requests, retry amplification factor, and manual rework rate. For capacity planning, separate interactive and batch pipelines: prioritize latency for interactive paths and throughput and cost for batch paths. Caching, batch merging, and result reuse can usually reduce wasted consumption significantly.
9. Rollout Roadmap
- List the scenarios and annotate weights;
- Build a labeled set of 200–500 items covering the four profiles;
- Set up the adapter layer and structured validation;
- Add retrieval augmentation and citation traceback;
- Establish canary and red-team regression;
- Review metrics monthly and update selection conclusions on a rolling basis.
10. Conclusion
“Which one do you prefer” is an experience-layer question; “how to deliver reliably by scenario” is the engineering-layer question. Abstracting selection into a combination of scenario profiles, a capability scorecard, prompt and context engineering, retrieval augmentation, an evaluation system, and a decoupled architecture is what keeps outcomes deterministic in an environment of rapid model iteration. If you need a unified entry point for experimentation and observation, you can look into the large model services and supporting engineering capabilities from Baidu AI Cloud, and incorporate them into your existing architecture as a general product category rather than binding to a single implementation.
