LLM Model Selection and Scenario-Based Deployment: A Practical Guide
This guide presents a practical methodology for selecting large language models based on scenario requirements and quantitative evaluation. It breaks model capability into four independent dimensions—reasoning depth, latency, unit cost, and context/tool compatibility—and shows how to build a small, reproducible evaluation set. It also covers scenario-based model placement, the economics of self-hosted inference throughput, common selection pitfalls, and how to close the loop with evaluation, canary rollout, and rollback. The key takeaway is that no model fits every use case; the right combination is the one matched to the scenario.
When integrating large language models into an application layer, a common and awkward situation arises: the model you are required to use performs reasonably well on some tasks, yet you struggle to find a reason why it is the only viable choice. The problem usually lies not in the model itself, but in the lack of clear scenario segmentation and quantitative evaluation. This article abstracts such selection problems into a general methodology.
1. The Core Problem: Model Capability Is Not a Single Dimension
Many teams treat “model strength” as a scalar value, when in reality it should be broken down into at least four independent dimensions:
- Reasoning depth: accuracy and self-correction ability on multi-step deduction, formal proofs, and long-chain code refactoring.
- Response latency: time to first token and output tokens per second, which directly determine the interactive experience.
- Unit cost: input/output price per million tokens, plus the hidden overhead introduced by retries.
- Context and tool compatibility: long-document throughput, stability of structured output, and the integration cost with existing toolchains.
A model that leads in “depth” may lag several times behind in the “latency–cost” combination. If the workload consists of high-frequency, short-chain execution tasks, this combined disadvantage is amplified by traffic, ultimately making it hard for an expensive model to enter the production pipeline.
2. A Reproducible Evaluation Framework
The key to avoiding “selection by gut feeling” is to build a small and stable evaluation set:
# Minimal offline evaluation skeletoncases = load_cases("eval_set.jsonl") # each entry has prompt, expected points, task typedef run(model_client, case, repeat=3):scores = []for _ in range(repeat):resp = model_client(case["prompt"])scores.append({"quality": rubric_score(resp, case["rubric"]), # point coverage + factual consistency"latency_ms": resp.latency_ms,"tokens": resp.usage.total_tokens,})return aggregate(scores) # take the median to reduce sampling variancereport = {name: [run(c, case) for case in cases] for name, c in clients.items()}
The evaluation set should cover three types of tasks: open-ended brainstorming, complex problems that require rigorous reasoning, and batch execution tasks that can be automatically verified. For the third type, always integrate automated checks (unit tests, schema validation, answer comparison) to minimize subjective judgment.
3. Scenario Segmentation: Putting Models in the Right Place
- Brainstorming and solution exploration: focus on diversity of ideas and quality of expression; higher latency is acceptable. Such needs can also be delegated to specialized AI coding tools or cross-validation across multiple models, using a “second opinion” to reduce single-point bias.
- Complex reasoning and formal tasks: focus on long-chain correctness and verifiability. The more robust engineering approach is “decompose + verify”: break a large proposition into sub-lemmas and verify them step by step, rather than generating a long conclusion in one shot.
- High-frequency execution tasks: for example, batch text rewriting, structured extraction, and routine code completion, where latency and cost take priority. Here, a mid- or low-tier model combined with good prompts and validation often delivers better cost-performance.
4. The Economics of Inference Throughput and Deployment
When a model’s open-source weights can be self-hosted, the cost structure changes fundamentally. In public industry discussions, a single rack of high-end accelerator cards, through tensor parallelism, continuous batching, and quantization, can push throughput to the order of hundreds of tokens/s; specific numbers vary significantly with hardware, batch size, and sequence length, so self-testing is essential.
This means that revenue from offering an API externally may be only a small part of the overall value, with the real gains coming from internal cost reduction. During selection, evaluate “whether it can be self-hosted, whether it can be quantized and compressed, and whether it can scale elastically,” rather than looking only at the official list price.
5. Common Pitfalls
- Using a single leaderboard ranking instead of scenario-based evaluation, ignoring latency and cost constraints.
- Testing only the first output round, without testing multi-turn correction and long-context stability.
- Ignoring sampling randomness and drawing conclusions from a single run.
- Underinvesting in prompt engineering and misdiagnosing a model capability issue as a selection problem.
6. Implementation Recommendations
On cloud platforms such as Baidu AI Cloud, model services can be combined with general capabilities like object storage, message queues, container platforms, logging services, and monitoring/alerting: use queues for peak shaving and retries, use monitoring to collect latency and failure rates, and use logs to accumulate evaluation samples, forming a closed loop of “evaluation–canary–rollback.” During the canary stage, roll out traffic by percentage, and let automated metrics rather than subjective impressions decide the final selection.
The conclusion is not complicated: there is no all-around model, only combinations matched to scenarios. Making evaluation an engineering capability is what keeps the architecture stable as capabilities iterate rapidly, avoiding lock-in to a single model.
