DeepSeek-V4 Deployment Guide: GPU Memory Planning and Migration Considerations

    This guide explains how to estimate GPU memory requirements for DeepSeek-V4, validate deployment parameters, evaluate Prefill-Decode separation, select reasoning modes, and migrate from V3. It covers weight precision, KV cache usage, GPU topology, parser compatibility, environment version checks, load testing, and rollback planning. All configuration values and compatibility conclusions should be verified against the official model card, deployment recipe, and compatibility matrix before production rollout.

    1. Estimate GPU Memory First: Weight Precision Determines Deployment Feasibility

    The DeepSeek-V4 series continues to use a Mixture-of-Experts (MoE) architecture. Sparse activation limits the amount of computation required for each inference request. The two reported configurations are a full model with approximately 1.6 trillion parameters and a smaller configuration with approximately 284 billion parameters.

    When planning GPU memory, start by estimating the size of the model weights. Memory consumption depends on numerical precision:

    • BF16 uses approximately 2 bytes per parameter.
    • FP8 uses approximately 1 byte per parameter.
    • FP4 uses approximately 0.5 bytes per parameter.

    For the 1.6T-parameter model, FP8 weights require approximately 1.6 TB. An eight-GPU node with 192 GB per GPU provides 1,536 GB in total. This is not enough to store even the weights alone, before accounting for the KV cache, activations, and inference framework overhead.

    Therefore, the statement that “the full model can be deployed on a single eight-GPU node” is valid only under lower weight precision or with GPUs that provide more memory. Before deployment, use the weight precision and recommended hardware configuration specified in the official model card.

    The smaller model has approximately 284B parameters. At FP8, its weights require roughly 284 GB. Four GPUs provide 768 GB in aggregate, leaving substantially more headroom than the full model. However, long contexts and high concurrency can consume significant KV cache memory. Peak memory usage should still be measured with production-like traffic.

    Official examples mention both B200 and B300 GPUs. Their memory bandwidth, interconnect topology, and driver support may differ. Mixing GPU types within the same parallel group can lead to unbalanced performance or even startup failures. Unless an official validation result is available, use the same GPU model within each parallel group.

    2. Review Deployment Parameters Individually

    The parameters in the official deployment command correspond to several model and serving design choices. The following is a structural example. Copy the exact values from the official Recipe and follow the documentation for the relevant version:

    1. vllm serve <model-path> \
    2. --data-parallel-size 4 \
    3. --enable-expert-parallel \
    4. --kv-cache-dtype fp8 \
    5. --block-size 256 \
    6. --tokenizer-mode deepseek_v4 \
    7. --tool-call-parser deepseek_v4 \
    8. --reasoning-parser deepseek_v4 \
    9. --port 8000

    After startup, first confirm that the service has registered successfully:

    1. curl http://localhost:8000/v1/models

    Then send a short request to verify that the output is generated correctly.

    1. --kv-cache-dtype fp8

    The KV cache is stored in 8-bit floating-point format, using approximately 1 byte per element. BF16 uses approximately 2 bytes, so FP8 can reduce cache consumption by roughly half. The trade-off is a possible change in output quality. Before production use, compare both formats on your own evaluation set.

    2. --block-size 256

    The official example uses a block size of 256. Whether this is merely an example value or a required constraint depends on the relevant version documentation. This guide does not infer the technical reason for the value. Test different settings and measure both GPU memory consumption and cache hit rate.

    3. --attention_config.use_fp4_indexer_cache=True

    The parameter name indicates that the index cache is stored in FP4 format, which may reduce memory usage. However, the precise definition of this mechanism, its error impact, and its measured performance are not established here.

    Before rollout, compare the setting in both states. Run the same request batch with the option enabled and disabled, and record output differences, throughput, and peak memory usage.

    4. --enable-expert-parallel and --data-parallel-size

    Expert parallelism distributes different expert networks across GPUs, so each GPU loads only a portion of the expert weights. Data parallelism distributes requests across multiple replicas. Used together, these settings can reduce the weight memory required by each GPU.

    The example uses four-way parallelism for the smaller model and eight-way parallelism for the full model. The values should match the available GPU layout and the requirements of the corresponding deployment configuration.

    5. Parser Parameters

    --tokenizer-mode, --tool-call-parser, and --reasoning-parser determine how text is tokenized, how tool calls are parsed, and how reasoning content is separated.

    The parsing formats in V4 differ from those in V3. Existing V3 code should not be assumed to work without modification.

    3. Prefill-Decode Disaggregation: Confirm the KV Transfer Path

    Prefill-Decode disaggregation separates the two stages of inference. Prefill processes the input and builds the KV cache, making it compute-intensive. Decode generates output tokens one at a time and is more sensitive to memory access.

    Deploying the two stages separately allows them to scale independently.

    The described configuration uses a node with eight H200 GPUs, assigning four GPUs to Prefill and four to Decode. It uses MooncakeConnector to transfer the KV cache. The source material describes the transfer as RDMA-based. However, when both GPU groups are located on the same node, the actual data path depends on the hardware topology and may involve NVLink, NVSwitch, or PCIe. RDMA is commonly associated with transfers across nodes or through network interfaces. These descriptions should not be treated as equivalent; the actual path must be verified through testing.

    Use the following procedure:

    • Run nvidia-smi topo -m to inspect the interconnect type between GPUs.
    • Compare time to first token (TTFT) and time per output token (TPOT) between PD-disaggregated and standard deployments.
    • Measure KV transfer time to determine whether data movement has become a bottleneck.

    The routing layer can use vllm-router. The round-robin strategy shown in the example is simple, but it does not account for the actual load on each node. A production deployment will typically also require health checks, failover, and monitoring for queue length, TTFT, TPOT, and KV transfer latency.

    For small and medium-sized clusters, a single-node disaggregated setup can be useful for validating the benefits of PD separation. Whether it is suitable for production should be determined by load-testing results.

    4. Reasoning Modes: Allocate Thinking Depth by Task

    Official materials describe three reasoning modes:

    • Non-think
    • Think High
    • Think Max

    The mode names come from the documentation. Use the official API documentation to confirm the exact request parameters and default mode.

    Non-think

    The model responds directly without extended reasoning. This mode is suitable for information extraction, text rewriting, and simple question answering. It generally has the lowest latency and produces the fewest tokens.

    Think High

    The model performs a relatively shallow reasoning process. This mode is suitable for code generation, mathematical problems, and structured data processing.

    Think Max

    The model uses a longer reasoning process and is intended for multi-step planning and analysis of contentious or complex questions. It has the highest latency and token consumption.

    A key benefit of these modes is that one set of model weights can support different reasoning depths through request parameters, without deploying multiple model copies. In practice, tasks can be routed by complexity: use Non-think for simple requests and upgrade more demanding requests to a deeper reasoning mode.

    Before defining routing rules, measure the average number of generated tokens, p95 latency, and accuracy for each mode. Conclusions based on a few individual examples will not represent overall production behavior.

    5. Migrating from V3: Validate Before Shifting Traffic

    Teams already running V3 in production should verify the following items before migration.

    1. Tokenization Changes

    After changing the tokenizer mode, the same text may produce a different token sequence. Caches, context-length budgets, and truncation logic that depend on the old token sequence must be reviewed.

    If historical data needs to be retokenized, allocate time for the processing work.

    2. Tool-Calling Format

    The extraction and reinsertion logic for function-call arguments may need to be rewritten for the new parser. Use real tool definitions and production-like samples for regression testing instead of relying on a few demonstration cases.

    3. Reasoning-Content Parsing

    If downstream services read fields containing the model’s reasoning process, confirm the field locations and structure in the new format.

    4. Environment Compatibility Matrix

    Record the following components:

    • Inference framework version
    • CUDA version
    • Driver version
    • Container image tag
    • GPU model
    • Communication library version

    The example image uses CUDA 13.0, but whether this requirement applies to a particular framework version must be confirmed against the official compatibility matrix. Do not treat any version combination as validated until it has been confirmed.

    5. Memory Headroom

    A 20% to 30% memory reserve can serve as an initial rule of thumb, but it is not a guaranteed requirement. A more reliable approach is to test the longest context and highest expected concurrency, measure peak memory usage, and reserve capacity based on the observed results.

    6. Rollback and Dual Running

    Keep the V3 service available during migration. Run both versions against the same request set and compare output quality and latency.

    Before upgrading the inference framework, save the last known-good container image tag. Back up data before changing cache formats or other stored data. Shift traffic gradually only after the dual-run evaluation has passed.

    6. Summary

    Before deploying DeepSeek-V4, confirm the relationship between weight precision and GPU memory. Then validate each deployment parameter individually, and use measured results to decide whether to adopt Prefill-Decode disaggregation and which reasoning modes to use.

    When migrating from V3, retest tokenization, tool calling, reasoning-content parsing, and the full software and hardware environment. Maintain a rollback path throughout the migration.

    The values and version requirements discussed here are based on publicly described deployment information. Before production rollout, rely on the official model card, deployment Recipe, and compatibility matrix, and complete load testing with traffic representative of your own workload.