Choosing an Open-Weight Model: Concepts, Costs, and Deployment Steps

    This guide explains what open-weight models are and how they differ from fully open-source models. It covers how to check license terms, estimate per-token costs and GPU memory, verify downloaded weights, and follow a structured process for selecting and deploying a model.

    1. Concepts and License Boundaries

    An open-weight model is a model whose provider publicly releases the trained parameter files, known as the weights. Users can download these files, run them on their own servers or private cloud, and fine-tune, quantize, or distill them within the terms of the license.

    Open weights and full open source are different things. Full open source usually also includes the training code, data filtering rules, and a description of the training pipeline, so outsiders can reproduce the model to a large extent. Open weights only guarantee that you can use and modify the model you received. They do not let outsiders reproduce the full process from data to finished model.

    Common release methods fall into three categories based on how much is public:

    Release type What you can access Self-hostable Training process auditable
    API only Call results No No
    Open weights Parameter files, inference code, license terms Yes Usually not fully auditable
    Fully open source Parameters, training code, data and process documentation Yes Largely reproducible

    The “open weights” label does not by itself tell you what you are allowed to do. Permissions depend on the license of each specific model. Before selecting a model, check the following items one by one:

    • Commercial use: Whether the license allows companies to use the model in paid products or internal production systems.
    • Modification and derivatives: Whether fine-tuning is allowed, and whether fine-tuned models can be published.
    • Redistribution: Whether you can package the weights into your own software or devices and deliver them to customers.
    • Output ownership: Who owns the generated content, and which uses are prohibited by the license or usage policy.
    • Patents and trademarks: Whether the license includes patent grants or restrictions, and whether you can use the model’s brand in your product names.
    • Additional conditions: For example, user-count thresholds, attribution requirements, or geographic restrictions.

    Source note: Check these terms against the model’s official release page and the original license text. Common licenses such as Apache License 2.0 and MIT have standard texts. Custom community licenses from vendors should be read clause by clause and reviewed by legal counsel before production launch.

    2. Cost, Dependency, and Compliance Value

    2.1 Recalculating the Cost Structure

    With a pay-per-call API, the cost per request is fixed, so total spending rises with call volume. The main costs of self-hosting are hardware depreciation, electricity, and operations staff. Once the workload grows to a certain scale, the marginal cost of each additional call drops.

    You can estimate the cost per token with this formula:

    Cost per token = (Hardware depreciation + Electricity cost + Operations cost) ÷ Number of valid tokens processed in the period

    The variables are as follows. Hardware depreciation is the server purchase price spread over its useful life and allocated to each period. Electricity cost is power consumption multiplied by electricity price and runtime. Operations cost covers staff and maintenance expenses. Valid tokens processed are the output actually completed, after subtracting failed requests, timeouts, and retries.

    The following is an illustrative example with hypothetical numbers, used only to demonstrate the calculation. A server costs CNY 100,000 and is depreciated over 36 months, which is about CNY 2,778 per month. Electricity and data center fees are about CNY 3,000 per month, and operations cost is about CNY 2,000 per month, for a total of about CNY 7,778 per month. If the server processes 500 million valid tokens per month, the unit cost is about CNY 15.6 per million tokens. If utilization drops to 10%, valid tokens fall to 50 million. The same fixed spending then raises the unit cost to about CNY 155.6 per million tokens.

    Utilization is the most sensitive variable in this formula. When a dedicated server sits idle for long periods, the unit cost rises quickly. Workloads with stable demand and manageable peaks and troughs, such as internal knowledge base Q&A or fixed-process document handling, are better suited to self-hosting. Workloads with large swings and hard-to-predict peaks may be better served by elastic calls to an external API.

    2.2 Reducing Dependence on a Single Vendor

    When a business depends entirely on one API provider, price changes, service term updates, and model version retirements directly affect business continuity. A team that owns the weight files can keep running a model version it has already validated and keep the decision about when to switch in its own hands.

    Actual migration costs are often higher than expected. Replacing a model usually involves adjusting prompts, adapting output formats, rerunning evaluations, and performing regression testing on business workflows. For this reason, teams should prepare the following from the start:

    • Version pinning: Record the model’s repository address, version number, and file hashes so the same version can be deployed again.
    • Rollback mechanism: Keep the previous version that passed evaluation, so you can switch back quickly if a new version causes problems.
    • Evaluation regression: Rerun a fixed evaluation set every time you change versions, and compare quality, latency, and cost.

    2.3 Data Compliance

    For scenarios involving personal information, trade secrets, or regulated data, the data flow must be tightly controlled. Open-weight models can be deployed on an internal network or in a controlled private cloud, so that requests and intermediate results stay within the organization’s boundary. This provides a technical basis for meeting data localization requirements, audit requirements, and confidentiality policies.

    Deployment location is only part of compliance. Access control, log redaction, and data retention periods must be designed at the same time. If an inference service writes complete prompts to logs, the data can still leak through logs or debugging output. Personal information handling should be checked against the regulations that apply where you operate, such as China’s Personal Information Protection Law, clause by clause.

    3. GPU Memory Estimation and Weight Verification

    3.1 GPU Memory Estimation

    You can roughly estimate the GPU memory used by the weights with this method:

    Weight memory ≈ Number of parameters × Bytes per parameter

    Bytes per parameter for common precisions:

    Precision Bytes per parameter Notes
    FP16 / BF16 2 Common full-precision inference formats
    INT8 1 Usually small quality loss, but test it on your own workload
    INT4 About 0.5 Also count the overhead of quantization metadata

    For example, a 7-billion-parameter model in FP16 takes about 14 GB for its weights. The same model in INT4 takes about 3.5 GB for its weights, and it usually needs more space once overhead is added. A 70-billion-parameter model in FP16 takes about 140 GB for its weights and typically requires several accelerator cards working together.

    Actual memory use also includes the KV cache, activations, and framework overhead. The KV cache grows with context length and the number of concurrent requests. You can estimate it from the number of layers, KV heads, and head dimension in the model’s configuration file. As a rule of thumb, reserve at least 20% headroom in production, and reserve more for long-context or high-concurrency workloads. These ratios are empirical. Use measured peak usage as the final reference.

    Quantization reduces memory use but can change quality and latency. Re-evaluate a quantized model on your own tasks. Do not decide whether it is usable based only on a parameter table.

    GPU memory estimation checklist:

    • Record the model’s parameter count and the precision you plan to use.
    • Read the number of layers, hidden size, and KV heads from the model configuration file.
    • Estimate the KV cache based on your maximum target context length and maximum concurrency.
    • Reserve at least 20% GPU memory headroom.
    • Load test with your actual inference framework and record peak memory usage.
    • Test behavior when GPU memory runs out, and confirm the service returns a clear error instead of crashing or waiting indefinitely.

    3.2 Weight Verification

    Weight files can be corrupted or replaced during download or transfer, so verify them before deployment.

    • Record the source: Save the official download URL, version number, or commit hash.
    • Check hashes: Compute the file hash with sha256sum (Linux) or Get-FileHash (Windows PowerShell), and compare it with the value published by the provider.
    • Prefer the safetensors format: It does not execute arbitrary code when loading. Source note: safetensors is maintained by Hugging Face, and one of its design goals is to avoid the code execution that the pickle format allows during deserialization.
    • Check the file list: Confirm that all shard files are present and match the description on the model card.
    • Verify signatures: If the provider publishes a digital signature, verify it before use.
    • Run a benchmark: After the first load, run a fixed test set and compare the results with the benchmark figures the provider publishes. Investigate if the deviation is too large.
    • Archive: Store the weights, checksums, and version information together in your model repository.

    4. Selection Evaluation and Deployment Steps

    4.1 Selection Evaluation

    Base model selection on your own tasks, not on public leaderboards. The recommended steps are:

    1. Define the tasks: List 3 to 5 real business tasks, with sample inputs and expected outputs.
    2. Build an evaluation set: Prepare enough labeled samples for each task type, including edge cases and failure cases.
    3. Set thresholds: Decide in advance the minimum requirements for accuracy, response time, cost per request, and refusal rate.
    4. Filter by license: Remove candidate models whose licenses do not allow commercial use or redistribution as your business requires.
    5. Compare candidates: Compare at least two open-weight models, using one hosted API as a baseline.
    6. Compute a composite score: Weight quality, cost, and latency according to business priority