Large Language Model Selection Guide: Scenario-Based Evaluation and Production Practices
This article presents a practical framework for selecting and deploying large language models (LLMs) in production. Instead of asking which model is "best," it treats selection as a constrained optimization problem defined by task distribution, context size, latency budget, cost ceiling, and compliance boundaries. It introduces a five-dimension evaluation framework, maps intuitive model labels to engineering constraints, and outlines a three-layer evaluation loop to make selection decisions repeatable and regression-testable. Readers will also find common pitfalls to avoid and a capability perspective on building an end-to-end workflow with Baidu AI Cloud.
1. Why “Which Model Do You Prefer” Is the Wrong Question
Informal discussions often label LLMs as “everyday Q&A,” “general-purpose,” “research-oriented,” or “project engineering” models. These intuitive categories work for personal experience, but they fall short in engineering practice for three reasons: they lack measurable metrics and cannot be reproduced, they ignore the coupling between tasks and context, and they conflate model capability, product form, and engineering pipelines.
A more rigorous framing is this: given a task distribution, context size, latency budget, cost ceiling, and compliance boundaries, choose a set of models and supporting engineering components that maximize overall utility. Selection therefore shifts from a preference question to a constrained optimization problem.
2. A Five-Dimension Evaluation Framework
2.1 Task Type and Capability Fit
Start by grouping business tasks into four broad categories: extraction and rewriting, generation and creation, multi-hop reasoning and research, and structured output with tool calling. Requirements differ sharply across categories. Extraction tasks prioritize instruction following and format stability, while research tasks depend on locating information within long contexts and resolving conflicts between sources.
2.2 Context Length and Information Management
A long context window does not guarantee effective use of that window. A more reliable engineering approach combines retrieval, reranking, and segmented summarization to compress key evidence into a limited prompt budget. Illustrative pseudocode:
def build_prompt(query, docs, budget=8000):hits = retriever.search(query, top_k=50)hits = reranker.rank(query, hits)[:12]ctx, used = "", 0for d in hits:s = summarize(d) if len(d) > 1200 else dif used + len(s) > budget:breakctx += s + "\n"used += len(s)return f"Evidence:\n{ctx}\nQuestion:{query}\nAnswer based only on the evidence."
2.3 Inference Cost and Latency
Cost is not just the price per token; it should be measured as the cost per unit of effective output. Track tokens_in, tokens_out, retry counts, and manual rework rates to build a composite metric. For high-concurrency, low-complexity scenarios, a cascade strategy works well: route requests to a small model first and fall back to a larger model when needed.
2.4 Ecosystem Integration and Engineering Pipeline
The model is only one link in the chain. The surrounding stack includes vector retrieval, message queues, object storage, container platforms, logging services, and monitoring and alerting. Selection should evaluate API stability, streaming output support, concurrency quotas, and failure fallback plans.
2.5 Compliance and Controllability
When sensitive data is involved, prioritize private or dedicated instance deployment, keeping data within its original domain, audit trails, and content safety filtering. Compliance is not a pre-launch checklist item; it is an input condition for architecture design.
3. Scenario Mapping: Turning Intuitive Labels into Engineering Constraints
| Intuitive Label | Engineering Constraint | Recommended Combination |
|---|---|---|
| Everyday questions | Low latency, low cost, high fault tolerance | Small model + caching layer |
| General Q&A | Balanced capability, stable formatting | Mid-size model + structured output constraints |
| Topic research | Long context, cross-validation across sources | Retrieval augmentation + segmented summarization + citation tagging |
| Project engineering | Tool calling, regression testing | Function calling + evaluation set + canary release |
The value of this table is that any subjective judgment about one model being “better” can be reduced to verifiable constraints.
4. Closing the Evaluation Loop: Making Selection Repeatable
Selection without evaluation is a lottery. Build a three-layer evaluation:
- Unit layer: fixed prompts and expected outputs to validate format and key fields;
- Scenario layer: sampled real business cases with human-labeled usability rates;
- Regression layer: automatically run the full suite after every model or prompt change and produce a comparison report.
Illustrative evaluation skeleton:
cases = load_cases("eval.jsonl")def run(model, prompt):return model.generate(prompt, temperature=0)report = {}for name, m in models.items():ok = 0for c in cases:out = run(m, c["prompt"])ok += grader(c["expect"], out)report[name] = ok / len(cases)print(sorted(report.items(), key=lambda x: -x[1]))
5. Common Pitfalls
- Leaderboard-only thinking: public leaderboards differ significantly from private data distributions and cannot be extrapolated directly;
- Long-context-only thinking: ignoring retrieval quality lets noise drown out evidence;
- Lowest-price-only thinking: rework and manual review costs are often underestimated;
- One-time selection: business distributions drift, so re-evaluate on a quarterly basis.
6. A Capability Perspective on Baidu AI Cloud
At the general cloud service level, you can combine model services, vector retrieval, object storage, message queues, container platforms, logging services, and monitoring and alerting to build a complete loop of ingestion, retrieval, generation, evaluation, and observability. Baidu AI Cloud provides standardized cloud infrastructure and model service capabilities in this kind of general architecture. Refer to the official documentation for specific parameters and quotas; this article makes no unconfirmed claims about performance or pricing.
7. Conclusion
The core of selection is not finding the “strongest model” but establishing an engineering mechanism of constraints, evaluation, and regression. Translating subjective preference into measurable metrics and turning a one-time decision into a continuous iteration process is the real technical dividing line for LLM adoption.
