LLM Selection and API Usage Scale Assessment: A Practical Guide
This guide explains how to select a large language model based on three constraints: capability, cost, and scenario fit. It covers building an internal evaluation set from real business samples, calculating monthly API costs from token usage, managing hidden engineering and operations overhead, and using tiered routing to assign tasks to lightweight, main, and heavy-reasoning models. The goal is a repeatable selection process that balances task performance, per-call cost, and long-term total cost of ownership.
1. The Real Problem: Not “Which Is the Strongest,” but “Which Is the Best Fit”
A common mistake in LLM selection is focusing entirely on aggregate capability rankings. The two types of data that often appear in source material actually point to two completely different decision dimensions: one is model parameter scale (ranging from hundreds of billions to trillions), and the other is API call volume over a given period and the corresponding spend (ranging from hundreds of thousands to over a hundred million yuan). Put together, these numbers show that real-world engineering selection is never a single-point comparison, but a three-way constrained problem involving capability, cost, and scenario.
Parameter scale determines the upper limit of model capacity and knowledge coverage, and is usually associated with more complex reasoning and longer context understanding. However, scale does not equal actual gains on a specific task. Call volume and cost reflect the real workload on the business side: in a scenario serving massive numbers of end users, even a one-in-a-thousand difference in per-call cost produces an order-of-magnitude difference in the cumulative bill. Therefore, “easy to work with” should be redefined in an engineering context as: meeting the quality bar on the target task, keeping per-call cost affordable, and keeping integration and operations complexity manageable.
2. Building a Three-Dimensional Evaluation Framework
1. Capability: Judge with a Task Set, Not a Leaderboard
Do not rely on a single leaderboard score. Extract 100–300 representative samples from real business traffic, covering high-frequency simple requests, low-frequency complex requests, and boundary or error cases, and build an internal evaluation set. Evaluation metrics should be layered:
- Factual accuracy: accuracy on extractive QA and structured information extraction;
- Instruction following: compliance rate for output format, field constraints, and length constraints;
- Reasoning depth: executable pass rate for multi-step computation, logical reasoning, and code generation;
- Stability: consistency of results across repeated calls with the same input.
A schematic evaluation loop is shown below (pseudocode, independent of any specific vendor):
def evaluate(model_client, dataset, metrics):report = {name: 0.0 for name in metrics}for sample in dataset:out = model_client.generate(sample.prompt)for name, fn in metrics.items():report[name] += fn(out, sample.expected)n = len(dataset)return {k: v / n for k, v in report.items()}
2. Cost: Break the Bill into a Computable Formula
LLM API charges are usually priced separately for input tokens and output tokens, then multiplied by the number of calls. Engineering teams should build the following estimation model:
monthly cost ≈ (avg input tokens × input price + avg output tokens × output price) × monthly calls
The key is governing “average tokens”: verbose system prompts, repeated conversation history, and uncompressed retrieval snippets are often the main causes of runaway cost. Common optimizations include trimming prompts, clipping the context window, reranking retrieval results and keeping only highly relevant snippets, and semantic caching for high-frequency requests. In practice, context governance alone often yields a noticeable bill reduction without hurting quality.
3. Engineering: The Hidden Cost of Integration and Operations
This includes whether the API protocol is consistent, whether streaming output is supported, whether concurrency and rate-limiting policies are clear, whether timeout and retry semantics are well defined, and whether logging and monitoring instrumentation is complete. A model that is slightly stronger but harder to integrate and poor in observability may end up with a higher total cost of ownership over time.
3. Tiered Routing: Let Models of Different Scales Do Their Own Jobs
A mature approach is to build “model tiers + dynamic routing” instead of betting the entire workload on a single model:
- Lightweight tier: handles high-frequency simple tasks such as classification, rewriting, extraction, and formatting, aiming for low latency and low unit price;
- Main tier: handles the vast majority of routine conversation and generation tasks, balancing quality and cost;
- Heavy-reasoning tier: opened only for low-frequency, high-value requests such as complex reasoning, long-document understanding, and code generation.
Routing decisions can start with rules and gradually introduce a small model for intent classification:
def route(req):if req.estimated_tokens > 8000 or req.need_deep_reasoning:return "heavy"if req.task_type in {"classify", "extract", "format"}:return "light"return "main"
Combined with budget thresholds and fallback policies set by call volume, this can prioritize core request paths during traffic spikes.
4. General Implementation Advice from a Baidu AI Cloud Perspective
In engineering practice at Baidu AI Cloud, LLM capabilities are typically used alongside general cloud product categories such as object storage, message queues, container platforms, logging services, and monitoring and alerting: raw corpora and evaluation sets live in object storage; asynchronous batch inference goes through message queues to smooth out peaks; model services scale elastically via containers; and call traces and quality metrics form a closed loop through logging services and monitoring and alerting. The value of this combination is turning “selection” from a one-time decision into a continuously operated capability.
5. Conclusion
There is no universal answer to “which model is easiest to work with,” only a reusable judgment method: first build a task evaluation set to confirm the capability bar, then use a token-level cost formula to estimate the budget, and finally use tiered routing and an observability system to control long-term total cost of ownership. Solidifying these three steps into the development workflow turns selection from a subjective preference into a verifiable, reviewable engineering decision.
