Selecting Chinese-Developed LLMs and Deploying Inference Microservices: A Practical Guide

    A practical workflow for evaluating Chinese-developed large language models and bringing inference microservices into production. Learn how to build a weighted scorecard, create private evaluation datasets, test long-context reliability, standardize performance measurements, and verify integration, container deployment, rollout, and rollback readiness.

    Public model leaderboards measure performance on general-purpose tasks. They cannot replace your team’s own evaluation.

    Before selecting a model, answer three questions:

    • What types of tasks must it handle?
    • How long are the typical input and output for each request?
    • What are the expected daily request volume and peak traffic?

    These answers determine how you weight evaluation criteria—and whether the selected model can meet production requirements.

    1. Build a Model Selection Scorecard

    A scorecard turns subjective discussions into measurable, reviewable results. The following table provides a starting point.

    Evaluation dimension Suggested weight Measurement method Notes
    Business-task accuracy 35% Scoring on a private evaluation dataset Report results separately by task type
    Instruction following and output-format stability 15% Output validation pass rate For example, whether generated JSON parses correctly
    Long-context reliability 15% Fact-retrieval tests near the target context capacity See Section 3
    Response latency 15% Time to first token and P95 latency See Section 4
    Unit cost 10% Cost per 1,000 tokens Include actual consumption from retries and long outputs
    Integration and operational overhead 10% Integration effort and operational incident count Include regression-testing effort for version upgrades

    Do not adopt these weights unchanged. For customer-support question answering, waiting time directly affects user experience. You might raise the latency weight to 20% and reduce business-task accuracy to 30%, keeping the overall scorecard total at 100%.

    For offline batch processing, latency may have little effect on the user experience, so more weight can go to cost and accuracy.

    Business stakeholders and technical leads should agree on the weights. Minimum acceptance thresholds must also reflect business risk. Tasks involving financial amounts or medical information, for example, need a higher accuracy threshold than general question answering.

    Set a minimum threshold for each dimension before scoring. Eliminate any model that fails even one threshold, then compare the weighted totals of the remaining candidates. This prevents a strong result in one area from masking a critical weakness elsewhere.

    2. Create a Private Evaluation Dataset

    General-purpose benchmarks do not represent your business data. As a starting point, prepare at least 200 samples for each core use case.

    Draw samples from real business logs and de-identify them. Include:

    • Common questions, to measure everyday performance.
    • Edge cases, to expose model weaknesses.
    • Known failure cases, to check whether previously fixed issues have regressed.

    At approximately 90% accuracy, a dataset of 200 samples gives an approximate 95% confidence interval of ±4.2 percentage points. A difference smaller than this margin is not sufficient on its own to establish that one model is better. For critical use cases, increasing the dataset to 400 samples narrows the interval to approximately ±3 percentage points.

    Define Clear Annotation Rules

    The annotation guidelines should specify what counts as a correct answer for each question type. Examples include:

    • “The answer must cite the support ticket ID.”
    • “The generated code must pass the unit tests.”

    Have two annotators assess each sample independently, with a third person resolving disagreements.

    After annotation, calculate inter-annotator agreement. Cohen’s kappa is a commonly used metric. A kappa below 0.6 indicates that the guidelines may be unclear. Revise the guidelines and re-annotate the data before using the results to compare models.

    Keep the Dataset Current

    Add new samples from production every month. Otherwise, the evaluation dataset can drift away from actual traffic and produce misleadingly high scores.

    Retain evaluation results for older dataset versions after each update so that model performance can be compared across periods.

    3. Validate Long-Context Reliability

    A model’s advertised context window does not establish how reliably it uses that context. Support for 128K tokens does not guarantee accurate retrieval of a fact located around the 100K-token mark.

    Use the following procedure.

    Step 1: Construct the Test Samples

    Each sample should contain a long background document, such as a collection of support tickets, meeting notes, or product manuals.

    Insert a key fact into the material: a ticket ID, parameter value, or exception to a policy. Use fictional or de-identified facts to avoid answers that the model may have memorized during training.

    Step 2: Set the Target Context Lengths

    Prepare background text at target lengths such as 8K, 32K, and 128K tokens. For each tier, the actual input should reach at least 90% of the target length.

    Count tokens using the target model’s own tokenizer. Do not estimate token counts from character counts.

    Step 3: Design Retrieval Questions

    Systematically vary the location of the key fact. Suggested positions are:

    • The beginning
    • 25% of the way through
    • 50% of the way through
    • 75% of the way through
    • The end

    Include enough samples for every combination of position and context-length tier.

    Ask only for the key fact—for example, “What is the ticket ID associated with this complaint?” Do not hint at its location in the document.

    Step 4: Define Pass and Fail Criteria

    An answer passes if it includes the correct ID without inventing additional IDs.

    Mark the answer as a failure if it:

    • Omits the required information.
    • Provides incorrect information.
    • Claims the information cannot be found when it is present.

    Automate validation wherever possible. For answers that are difficult to assess programmatically, use two annotators working from the same guidelines.

    Step 5: Record the Results

    Record at least the following fields for each test:

    • Sample ID
    • Model name and version
    • Context-length tier
    • Insertion position of the key fact
    • Actual input token count
    • Whether truncation occurred
    • Model output
    • Pass or fail result
    • End-to-end latency

    For failed cases, retain a hash of the complete input and the original output text to support reproduction and analysis.

    Test Boundary Conditions Separately

    Test three additional conditions:

    1. Input beyond the context window. Determine whether the service returns an error, silently truncates the input, or returns a partial result. Silent truncation is the most dangerous behavior and must be detected and logged at the integration layer.
    2. Distracting content. Add text similar to the key fact and check whether the model selects the wrong information.
    3. Multiple key facts. Include several required facts and check whether the model retrieves all of them.

    4. Standardize Performance Metrics

    Latency and throughput figures are not comparable unless their measurement definitions are consistent. Agree on the following definitions before reviewing results.

    Latency

    Time to first token (TTFT) is the elapsed time from sending a request to receiving the first output token. It applies only to streaming responses.

    End-to-end latency is the elapsed time from sending a request to receiving the complete response.

    P95 latency is the latency value at or below which 95% of requests fall. Exclude warm-up requests from the statistics.

    Throughput

    Two common throughput measures are:

    • Output tokens per second, which reflects generation speed.
    • Completed requests per second, which reflects service capacity.

    For both metrics, state the typical input and output lengths. Long inputs can substantially increase prefill time.

    Concurrency Testing

    Document the conditions for every concurrency test:

    • Number of concurrent requests
    • Input and output lengths per request
    • Whether streaming is enabled
    • Batching parameters
    • Inference framework version

    Repeat each configuration at least three times. Use the median result and report the range of variation in P95 latency.

    A benchmark that reports only the best result from a single run should not be used for model selection.

    5. Verify Inference Microservice Integration

    After a model passes evaluation, it still needs to be integrated into the business system as a microservice. Verify each item below before integration, with inspectable evidence for every requirement.

    Version the API Contract

    Document request and response fields, data types, and required fields, and assign a protocol version.

    If the service uses a protocol compatible with a widely used API, verify field mappings and the streaming response format. Compatibility assumptions can otherwise cause upstream clients to fail during parsing.

    Configure Authentication and Secret Handling

    Use API keys or mutual TLS for authentication.

    Do not embed secrets in source code or container images. Inject them through environment variables or a secret management service, and support regular rotation. Logs must never contain complete keys.

    Apply Rate Limits

    Set limits per tenant or caller. Cover both requests per second and a per-minute token quota.

    When a limit is exceeded, return HTTP 429 with a Retry-After response header so the caller knows when to retry.

    Configure Separate Timeouts

    Configure connection timeout, time to the first response data, and total request timeout separately.

    For long outputs, estimate the total timeout from the maximum output length multiplied by the time required per token, rather than choosing an arbitrary fixed value.

    Restrict Retries to Safe Cases

    Retry only errors for which repeating the request is safe, such as network interruptions or HTTP 503 responses.

    Use exponential backoff and a maximum retry count. Do not automatically retry non-idempotent operations, which may cause duplicate charges or duplicate writes.

    Define Logging Requirements

    Log:

    • Request ID
    • Model version
    • Input and output token counts
    • Latency for each processing stage
    • Error codes

    Do not persist raw request or response content by default. If retention is necessary, de-identify the content and define a retention period.

    Establish Monitoring Ownership

    Monitor at least:

    • Requests per second
    • Error rate
    • TTFT
    • P95 latency
    • Queue length
    • GPU utilization
    • GPU memory usage

    Every metric should have a dashboard and an assigned owner.

    Prepare and Rehearse Rollback

    Retain the previous container image and model weights. Routing must be switchable back to the previous version within five minutes.

    Document the rollback procedure and rehearse it in a staging environment. Record the elapsed time and any issues encountered.

    6. Check Container Deployment Prerequisites

    Missing deployment prerequisites can lead to production failures that are difficult to diagnose. Verify each of the following before deployment.

    Standardize Container Images

    Use a fixed version tag for the base image, not latest.

    Scan images for vulnerabilities before release. Run containers as a non-root user, and do not package model weights or secrets inside the image.

    Define Resource Allocations

    Set CPU and memory requests and limits.

    Estimate GPU memory requirements from the model’s parameter count, numerical precision, and KV cache size, with additional headroom. Compare the estimate with actual GPU memory usage during load testing.

    Verify GPU Driver and CUDA Compatibility

    The GPU driver and CUDA versions must be compatible with the inference framework.

    Each framework version has specific CUDA requirements, and each CUDA version has minimum driver requirements. Check the official compatibility matrices before deployment and record the validated version combination in the deployment documentation.

    Mount Model Weights Read-Only

    Verify the SHA256 hashes of the weight files before mounting them. The weights must match those used during evaluation.

    Manage model-weight versions separately from container-image versions so either can be rolled back independently.

    Minimize Network and Storage Permissions

    Expose only necessary service ports and restrict outbound network access through an allowlist.

    Mount storage volumes read-only for the inference container. Use a separate mount for the log directory and set a capacity limit.

    Separate Liveness and Readiness Checks

    A liveness check should confirm that the process is running. A readiness check should confirm that the model has finished loading and can process requests.

    If model loading takes several minutes, do not route traffic to the service until it passes readiness checks. Sending traffic earlier can cause large numbers of request timeouts.

    7. Use a Production Launch Checklist

    On launch day, verify every item below before increasing traffic.

    Confirm Load-Test Acceptance

    The tested concurrency, request lengths, and test duration should match production estimates.

    P95 latency and error rate must meet the acceptance criteria. The load test must show no GPU out-of-memory errors or unbounded queue growth.

    Roll Out in Stages

    Use a staged rollout—for example, 5% of traffic, then 20%, then 100% after observation.

    Choose each observation period according to the business traffic cycle. It should cover at least one traffic peak.

    Set Alert Thresholds in Advance

    Define alert thresholds for:

    • Error rate
    • P95 latency
    • Queue backlog
    • GPU memory usage

    Route alerts to specific owners. Base thresholds on load-test data rather than intuition alone.

    Recheck Capacity and Cost

    Estimate daily cost and the required instance count using peak request volume and average token counts, then compare the results with the budget.

    Leave headroom: actual outputs are often longer than estimated, and retries add consumption.

    Validate Fallback Behavior

    If the model service becomes unavailable, the system should be able to switch to a backup model, return cached results, or use a rule-based fallback.

    Test fallback behavior during the staged rollout. It must work in practice, not merely exist in a design document.

    Execute a Full Rollback Drill

    Before launch, perform a complete rollback. Record the steps, elapsed time, and any problems, then update the rollback documentation with the results.

    Maintain a Regression-Testing Schedule

    After completing the launch checks, define an ongoing regression-testing schedule.

    Every model or inference-framework upgrade should trigger another run of the private evaluation dataset and long-context tests, along with renewed performance verification.

    Also confirm that production data used for evaluation and annotation has the necessary usage authorization.