Choosing Domestic LLMs: A Practical Guide to Performance, Cost, and Use-Case Evaluation

    This guide explains why LLM selection should not rely on leaderboards alone. It covers end-to-end latency, throughput, context size, effective task cost, quality, stability, and engineering governance; how to evaluate models by scenario; a reusable load-test process; weighted scoring; and layered routing for production systems.

    Why LLM selection cannot stop at leaderboards

    In real development, “which model is best” cannot be answered without a use case. Output quality, time to first token, long-context handling, concurrency stability, and cost per task all change with task type, prompt design, input length, and calling pattern.

    The same model may show low latency on short Q&A, then slow down sharply when the input includes long history, retrieved documents, or structured files. A model that writes generic text quickly may still fail at complex code refactoring, multi-step reasoning, or strict structured output.

    Teams should treat selection as an engineering decision, not a search for a single “strongest” model:

    • Meet a quality bar at the lowest viable cost for each task.
    • Keep wait time acceptable in interactive products.
    • Build stable, observable, degradable call paths for high concurrency.
    • Add content safety, access control, audit, and data governance for sensitive work.
    • Keep architecture replaceable as model capabilities change.

    What matters is the fit among model capability, task requirements, and system cost.

    Build a unified evaluation metric set

    Recording a single call’s latency or comparing input/output unit prices is not enough. Network jitter, prompt luck, cache hits, and load distort those numbers.

    A production-ready evaluation should cover at least six areas.

    1. End-to-end latency

    End-to-end latency is the time from the application sending a request to receiving a complete result. It typically includes request construction, network transfer, server queueing, preprocessing and inference, streaming transfer, and application post-processing:

    1. Total latency = request prep + network RTT + queue wait + model generation + result handling

    Offline jobs can tolerate higher totals. Customer service, live assistants, interactive creation, and coding help are sensitive to wait time. Users usually care more about when the answer starts than when it finishes. Split latency into:

    • Time to first token (TTFT): request sent until the first useful output.
    • Time to completion: request sent until the full answer is done.

    TTFT drives perceived stall; completion time drives task throughput. Do not mix them.

    2. Output throughput

    Throughput is useful text generated per unit of actual generation time:

    1. Output speed = output text units / actual generation time

    Faster is not always better. If the model short-circuits reasoning, drops constraints, or emits filler, high throughput has little value. Pair throughput tests with quality checks—especially for code, complex Q&A, and structured extraction (completeness, format, constraints).

    3. Input, output, and total context size

    Cost and performance track input/output size. Record at least:

    • input size
    • output size
    • total context size
    • conversation turns
    • RAG/retrieved attachment length
    • presence of long documents, tables, logs, or source files

    Inputs inflate easily: system instructions, user question, history, retrieved chunks, tool results, and safety rules can dwarf what the user typed. Test short- and long-context conditions separately. Strong short-text results do not imply the same speed, cost, or stability on long materials.

    4. Cost per successful task

    Unit token price is not enough; models differ in how much text they need to finish the same job. Some answers are short but incomplete; others are longer but succeed on the first try. Use effective cost:

    1. Cost per successful task =
    2. (input cost + output cost + retry cost + post-processing cost)
    3. / number of successfully completed tasks

    Define “success” clearly, for example:

    • code passes preset checks
    • extraction meets field completeness
    • answers include required facts
    • summaries cover core information
    • ticket classification hits target accuracy
    • formatted output parses in downstream systems

    A cheap model that needs retries, human edits, or second calls can cost more than a pricier model with a higher first-pass rate.

    5. Quality and stability

    Turn quality into repeatable criteria and task-specific test sets.

    Knowledge Q&A: question understanding, missed conditions, unsupported claims, distinction among fact/speculation/advice, handling of uncertainty.

    Code: existing context, API compatibility, errors and edge cases, maintainable structure, security risks, required output format.

    Content generation: audience fit, length/tone/structure, repetition or template language, multi-constraint compliance.

    Stability is consistency across repeats: same input should not randomly change core conclusions, drop required fields, or vary format.

    6. Engineering usability and governance

    Beyond answer quality, check whether the model can be integrated safely and stably:

    • standard calling patterns
    • streaming
    • timeouts, retries, and circuit breaking
    • logs and key metrics
    • content review, permission isolation, audit trails
    • object storage, queues, containers, logging, and alerting
    • quotas by business line, user, app, or environment
    • clear data-handling and security practices

    If you already run on Baidu AI Cloud or other cloud infrastructure, also weigh integration with existing network, security, identity, logging, and monitoring. Lower ops cost is part of the selection return.

    Choose by scenario, not a single total score

    Weight capabilities by task. Split work into at least four classes.

    1. Real-time interaction: TTFT and stable throughput first

    Examples: online Q&A, agent assist, form fill, meeting notes, light rewrite.

    Focus on first-token speed, steady streaming, reliable simple instructions, latency under load, and controllable per-call cost. Extra reasoning power is often unnecessary once quality is “good enough.” Faster, more stable, cheaper is usually better.

    2. Complex reasoning: accuracy and constraint following first

    Examples: analysis, rule derivation, solution design, long-chain decisions, multi-condition review.

    Test whether constraints are fully recognized, reasoning is consistent, implicit premises are not dropped, conflicts are handled, uncertainty is bounded, and conclusions are reviewable. Low quality here drives rework; slightly slower but much higher first-pass rate can still win.

    3. Software development: context understanding and verifiable output first

    Production coding help is not generic completion. Models must handle directory structure, dependencies, API contracts, exceptions, tests, and security.

    Split tasks: small functions, defect localization, single-file edits, multi-file refactor, tests, docs/comments, config checks, log/incident summaries.

    Avoid toy prompts like “write a sort.” Use desensitized real tasks plus automated checks: compile, format, unit tests, contract checks, static rules.

    4. Long documents and knowledge bases: context utilization first

    For policy Q&A, R&D docs, project summaries, or long reports, nominal context length matters less than whether the model actually uses the input.

    Check: locating key facts, wrongly stitching passages, old vs new versions, ignoring limits at the end, citing verifiable evidence, and how speed/quality change as documents grow.

    Long-doc work usually needs retrieval, chunking, reranking, summarization, and context trimming. Do not dump all material into context even with a strong model.

    Design a reusable stress-test process

    Reduce chance.

    Step 1: Task sets. Cover real work, not only public toy items. Include basic, routine, boundary (ambiguous, conflicting, malformed), high-load (long I/O or concurrency), and safety (sensitive data, overreach, disallowed content) layers. Desensitize; do not send production data, PII, secret source, or internal docs to external test environments.

    Step 2: Unify prompts and parameters. Same system instructions, user inputs, format requirements, similar length limits, timeouts, retry policy, and concurrency. Otherwise you are testing the prompt, not the model.

    Step 3: Log raw calls. At least:

    1. request id
    2. task category
    3. input size
    4. output size
    5. TTFT
    6. completion latency
    7. success
    8. error type
    9. retry count
    10. format check result
    11. quality score
    12. cost per task

    Do not store sensitive content in plaintext. For review, keep desensitized summaries, hashes, or access-controlled audit records.

    Step 4: Repeat over time. Record mean, median, high-percentile latency, max, failure rate, timeout rate, and degradation under concurrency. Low averages can hide a bad tail; online UX is often driven by p95/p99.

    Step 5: Human review. Automation covers format, fields, test pass rate, and rule hits. Sample high-value, complex, or disputed items with a rubric: accuracy, completeness, actionability, readability, risk.

    Weighted scores, not a mechanical ranking

    Example:

    1. Overall score =
    2. quality × 40%
    3. stability × 20%
    4. latency × 15%
    5. cost per successful task × 15%
    6. engineering/governance × 10%

    Adjust weights: support may raise latency and cost; code review or compliance Q&A should raise correctness, stability, and auditability; internal dev tools may emphasize context, format, and tool use.

    The score is not a single champion. It maps fit: one option for low-risk, high-frequency short text; another for strict structured pipelines; another for high-value analysis with human assist; another as peak-load or failure fallback.

    Prefer layered routing

    Sending every request to one model is rarely cost-optimal. Route by complexity:

    1. User request
    2. ↓
    3. Classify request and risk
    4. ↓
    5. Simple → efficient model
    6. Routine → balanced model
    7. Complex → higher-capability model
    8. High-risk → extra checks, human review, or refuse
    9. ↓
    10. Format validation and safety checks
    11. ↓
    12. Return to user or downstream

    Signals can include input length; code/tables/long docs; strict format; high-risk domains; multi-step analysis; high-value users or critical flows; current load; historical success rate.

    Reserve strong models for tasks that need them; send frequent simple work to cheaper options. Keep measuring classifier accuracy so complex work is not misrouted. Log routing decision, final quality, and human feedback, and retune.

    Common mistakes and fixes

    Only short prompts. You miss context limits, long-text localization, and cost blow-up. Test short, medium, and long inputs, including real history and RAG concatenation.

    Only unit price. Include retries, failures, human review, and downstream fixes.

    Only mean latency. Watch high percentiles, timeouts, and concurrency.

    Ignore structured-output failures. Missing fields, extra prose, or invalid JSON breaks pipelines. Add strict parse, auto-retry, and hard output constraints in the prompt.

    No fallback. Production needs timeouts, bounded retries, circuit breaking and degrade, backup models or rules, cache, human takeover, monitoring, and call audit.

    Closing: choose a model mix that fits the task

    Selecting domestic LLMs is ongoing optimization, not a one-time purchase or test. Capabilities, volume, prompts, and architecture change.

    Start from real tasks. Record quality, latency, throughput, context size, success rate, and cost per successful task. Add safety, observability, and integration cost into scenario scores. For mixed workloads, layered routing and swappable architecture are usually more robust than betting on one model.

    A mature system does not only answer “which model,” but continuously: given this task, load, budget, and risk, which class of capability to call—and how to keep results usable, controllable, and traceable.