How to Choose a Chinese LLM and Optimize Inference Costs
This article presents a practical framework for selecting a Chinese large language model and reducing inference costs. It explains how to build a reproducible evaluation baseline with fixed prompts, which metrics to track, how to break down latency into time-to-first-token and generation time, and how credit-based pricing with multipliers and caching affects cost. It also covers scenario-based model selection, routing tiers, and an engineering checklist for reliable deployment.
1. Why Model Selection Cannot Rely on Intuition
In real engineering projects, teams often face a familiar situation: the business side wants to add large language model capabilities, but the market offers many model sizes, from lightweight small-parameter models to flagship models with massive parameter counts, with clear differences in price and response speed. Making a decision based on a single subjective trial often leads to three pitfalls: first, latency becomes unacceptable under high concurrency after launch; second, the bill grows far beyond budget; third, quality looks strong on a demo set but degrades noticeably on the real business distribution.
Model selection is therefore an engineering decision under multiple constraints. You need to quantify and compare quality, latency, throughput, cost, stability, and compliance in a single evaluation table, rather than searching for a “strongest model.”
2. Building a Quantifiable Evaluation Baseline
2.1 Fixed Prompts and Fixed Scoring Criteria
Reproducibility is the prerequisite for evaluation. Prepare a set of fixed prompts for each business scenario, covering typical tasks such as creative generation, structured extraction, long-document summarization, code completion, and multi-turn conversation. For creative generation, you can design a constrained task like the following:
Setup: Humans can move objects instantly but cannot cross space.Requirement: Write the opening of a flash fiction story set in a modern city, about 200 words, keeping the suspense.
The value of fixed prompts is that different models receive exactly the same input, which makes output length, elapsed time, and token consumption comparable.
2.2 Which Metrics to Record
A minimal usable evaluation table should include at least:
- End-to-end latency (milliseconds)
- Input tokens, output tokens, and total tokens
- Output speed (tokens/s), that is, output tokens divided by generation time
- Billed credits or cost (if the platform bills by credits/multipliers)
- Unit cost efficiency, such as “credits per total token”
- Quality score (manual or rule-based automatic scoring)
“Credits per total token” is a very useful normalized metric. It compresses the billing multiplier differences across models into the same unit, making it easy to compare cost-effectiveness side by side.
3. Understanding Inference Latency: Where the Time Goes
End-to-end latency can usually be split into two parts:
Total time ≈ time to first token (TTFT) + output generation timeOutput generation time ≈ output tokens / generation speed (tokens/s)
- Time to first token is mainly affected by input length, model size, service queuing, and cold starts.
- Generation speed is mainly affected by model architecture, batching strategy, GPU memory bandwidth, and concurrency pressure.
This explains a common phenomenon: small-parameter models “feel fast” under light load, but their advantage shrinks under high concurrency or long inputs; large-parameter models may have a decent generation speed, but input-side and queuing overhead can significantly raise total latency. In engineering, track both P50 and P95/P99 latency. Looking only at the average hides long-tail problems.
4. Understanding Billing Logic: Multipliers, Caching, and Credits
Many platforms use a billing model of “credits = various tokens × corresponding multiplier,” typically in the form:
credits = input tokens × input multiplier+ cache creation tokens × cache creation multiplier+ cache hit tokens × cache read multiplier+ output tokens × output multiplier
This leads to three important conclusions:
- Output is usually more expensive than input, so controlling output length is often more effective than compressing input.
- Cache hits can significantly reduce cost. Putting stable system prompts and long document prefixes in the cacheable portion lets repeated requests be billed only at the lower read multiplier.
- Rate limits (such as RPM limits) affect architecture design, requiring queues, backoff retries, and fallback strategies.
A simplified cost estimation function can be written as:
def estimate_cost(in_tok, out_tok, cached_read_tok, cached_create_tok,r_in, r_out, r_cache_read, r_cache_create):return (in_tok * r_in+ out_tok * r_out+ cached_read_tok * r_cache_read+ cached_create_tok * r_cache_create)
5. Scenario-Based Selection Strategy
- High-concurrency online services: prioritize small-parameter or lightweight models, combined with caching and rate-limit governance, and focus on P99 latency.
- Complex reasoning and long-document tasks: choose a more capable larger model, but strictly limit output length and enable caching.
- Intelligent coding and structured extraction: focus on instruction following and format stability, with rule-based validation as a fallback.
- Offline batch processing: prioritize throughput, allow higher latency, and focus on optimizing cost per token.
A recommended approach is tiered routing: use a lightweight model for most requests first, then escalate to a larger model for low-confidence or complex requests, achieving an optimal balance of cost and quality.
6. Engineering Implementation Checklist
- Build a unified model access abstraction layer to hide differences between providers.
- Instrument the full pipeline to collect latency, tokens, cache hits, and failure rates.
- Set timeouts, retries, and circuit breakers to prevent long-tail issues from dragging down overall availability.
- Track cost trends and latency percentiles with monitoring and alerting dashboards.
- Run regular regression evaluations to prevent quality drift caused by model or prompt changes.
7. Conclusion
There is no single answer to “which Chinese LLM should I choose.” What is truly reusable is a methodology of evaluate, attribute, optimize: build a baseline with fixed prompts, locate bottlenecks by breaking down latency, calculate costs with the multiplier and caching model, and then
