Open-Weight LLM Acquisition, Deployment, and Evaluation Practices

    This article outlines the practical work required to adopt open-weight LLMs: interpreting licenses, assessing output risk, obtaining and verifying model files, planning GPU memory and parallelism, deploying inference services, and understanding the limits of public benchmarks for business-specific evaluation.

    1. Background: What Open Weights Mean

    When model weights are released, users receive a set of parameter files that can be downloaded, stored, modified, and deployed. This differs from calling a cloud service through an API. With an API, the service provider handles inference resources, version upgrades, and stability. With weights, those responsibilities shift to the user.

    This shift brings three types of benefits. First, data can remain in the organization’s own environment to meet internal compliance requirements. Second, inference costs can be optimized through hardware selection and batching strategies. Third, model versions can be pinned to the business release cadence, reducing the risk that upstream changes directly affect production behavior.

    It also introduces new work. Model files are often tens of GB in size, the runtime environment is relatively complex, and tokenizer and configuration files can differ across versions. When mismatched, outputs may become abnormal, often without an explicit error.

    Before starting a project, teams should clarify three questions: Does the business truly require private deployment? Does the team have the ability to operate and maintain an inference service? Can evaluation criteria be established before launch? If any answer is no, the team should first evaluate the option of calling a hosted service.

    2. Compliance Preparation Before Release

    2.1 Read the License Agreement

    Open weights usually come with a license agreement. When reading it, focus on the following terms:

    • Commercial use scope: whether use in for-profit products is allowed, and whether there are thresholds for user scale or revenue.
    • Redistribution and derivative models: whether fine-tuned models can be released externally, and what conditions must be met for release.
    • Attribution and notice requirements: whether the model source must be stated in products or documentation.
    • Prohibited uses: restrictive scenarios listed in the agreement.

    License interpretation involves professional judgment. For formal commercial use, the terms should be confirmed by legal counsel.

    2.2 Assess Output Risk

    Open models can also generate inaccurate, biased, or inappropriate content. Before launch, teams need to define three things: which scenarios require human review, which outputs need filtering, and which role is responsible for handling incidents. These rules should be written into the operations manual rather than existing only as individual experience.

    3. Model File Acquisition and Integrity Verification

    3.1 Confirm the Source

    Prefer files obtained from official channels published by the model publisher. Non-official mirrors may be tampered with, or their versions may not match the stated release. Before downloading, record the version number, release date, and file manifest for later traceability.

    3.2 File Structure

    A complete model directory usually contains the following types of files:

    • Configuration files: describe structural information such as the number of network layers, hidden layer dimensions, and attention heads.
    • Tokenizer files: vocabulary and tokenization rules. The tokenizer and weights must come from the same version.
    • Weight shard files: parameter files split by a fixed size, which must be fully downloaded.
    • Generation configuration files: default settings such as generation length and stop tokens.

    If any type of file is missing, loading may fail with an error, or defaults may be used silently, causing results to deviate from expectations.

    3.3 Hash Verification

    SHA-256 checksums can confirm whether files were corrupted or replaced during transfer. The verification process is as follows:

    1. For each file in the model manifest:
    2. digest = compute SHA-256(file contents)
    3. expected = read the checksum for this file from the release record
    4. if digest != expected:
    5. mark the file as abnormal
    6. stop the loading process and download the file again
    7. After all files pass, proceed to deployment

    Verification results should be archived together with deployment records. This makes it possible to quickly determine whether an issue is caused by a file problem or a configuration problem.

    4. Runtime Environment Planning

    4.1 GPU Memory Estimation

    GPU memory requirements mainly consist of three parts: weights, KV cache, and runtime overhead.

    Weight memory can be estimated as follows:

    Weight memory ≈ parameter count × bytes per parameter

    The following example assumes a model with 7 billion parameters. It is used only to illustrate the calculation method and does not correspond to any specific model:

    Numerical precision Bytes per parameter Weight memory (example)
    32-bit float 4 about 28 GB
    16-bit float 2 about 14 GB
    8-bit integer 1 about 7 GB
    4-bit integer 0.5 about 3.5 GB

    Lower-precision formats can significantly reduce GPU memory usage, but they introduce some accuracy loss. After choosing a quantization scheme, performance must be revalidated on the business evaluation set.

    KV cache grows with context length and concurrency. It can be calculated as follows:

    KV cache ≈ 2 × layers × KV heads per layer × head dimension × context length × concurrency × bytes per element

    In long-text or high-concurrency scenarios, KV cache may exceed the memory used by the weights themselves. Hardware planning should account for both parts.

    4.2 Hardware and Parallelism Strategy

    When a single accelerator card has enough memory to hold the full weights, deployment is simplest. When memory is insufficient, multi-card parallelism is required. Common approaches include tensor parallelism, which splits the computation of the same layer across multiple cards, and pipeline parallelism, which assigns different layers to different devices. Multi-card setups introduce inter-card communication overhead, so stress testing is needed to confirm whether throughput and latency meet requirements.

    4.3 Environment Isolation

    It is recommended to package the inference service in containers. Dependencies should be pinned in the image, and model weights should be mounted as read-only to prevent runtime file modification. The deployment platform can use general container orchestration capabilities for scaling, health checks, and rolling updates.

    5. Inference Service Deployment

    5.1 Service Forms

    Inference services usually take three forms:

    • Online synchronous API: the user sends a request and the service returns the complete result immediately, suitable for question answering and form assistance.
    • Streaming output: generated content is returned segment by segment, suitable for chat interfaces and reducing perceived waiting time.
    • Offline batch processing: tasks are executed in batches from a task queue, suitable for document summarization, data labeling, and similar scenarios, improving hardware utilization.

    The three forms make different trade-offs among latency, throughput, and cost, and should be selected according to business metrics.

    5.2 Architecture Design

    A basic inference service architecture is as follows:

    1. Client -> Gateway (authentication, rate limiting, auditing) -> Inference service cluster -> Model weight storage (read-only mount)
    2. |
    3. Monitoring and logging

    The gateway handles identity verification and access control, preventing unauthorized calls from consuming GPU memory resources. The monitoring system needs to collect request volume, time to first token, generation speed, GPU memory usage, and error rate. These metrics are the primary basis for deciding when to scale and for locating failures.

    5.3 Request Handling Logic

    The core processing flow of an inference service can be described as follows:

    1. Receive request(user input, generation parameters)
    2. Validate input format and length
    3. if input exceeds context limit:
    4. return an explicit error code without entering inference
    5. Call inference engine to generate content(input, max generation length, sampling temperature)
    6. Apply content safety filtering to output
    7. Record latency, input/output token counts, and model version
    8. Return result

    The maximum length and sampling temperature in generation parameters directly affect output quality and cost. Default values should be set for each business scenario, and the range users can modify should be limited.

    6. Evaluation System

    6.1 Limitations of Public Leaderboards

    Public evaluation sets can provide a reference for horizontal comparison, but they usually differ in distribution from specific business scenarios. A high leaderboard score does not guarantee strong performance in scenarios such as customer support tickets, contract review, or code completion.