- Documentation
GPU Compute Service
GPU Compute Service
Best Practices
Building models
DeepSeek series models
GPU - Deploying DeepSeek-V4.1-Flash model
DeepSeek series models
GPU - Deploying DeepSeek-V4.1-Flash model
GPU - Deploying DeepSeek-V4.1-Flash model
This topic, with 1 ecs.hpcpni3ln.45xlarge instance as an example, introduces how to deploy the DeepSeek-V4.1-Flash model on a GPU instance.
DeepSeek-V4.1-Flash is the most lightweight model in DeepSeek's new model architecture series. The model provides native multimodal visual understanding capabilities and can process image and text inputs at the same time.
The model adopts a new asymmetric Causal-Encoder-Decoder architecture, with 8 billion activated parameters for input and 16 billion activated parameters for output. The model inference cost is significantly lower than that of known models of the same size. The model also uses a new pre-training method and undergoes larger-scale reinforcement learning during post-training. In benchmark tests, it outperforms flagship models such as DeepSeek-V4-Pro overall.
- GPU driver: A program used to drive NVIDIA GPUs. In the example provided in this topic, version 535.261.03 is used.
- SGLang framework: a high-performance service framework specifically built for Large Language Models (LLMs) and vision-language models. With the collaborative design of the frontend structured generation language and the backend runtime system, the SGLang framework supports efficient interaction with models and ensures controllability of the generation process. In the example provided in this topic, the SGLang community preview version is used.
Step 1: Prepare the environment
- Create a GPU Accelerated instance.
- Install the required software and tools.
- Execute the following command on the GPU instance to install and configure Docker.
sudo apt install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://mirrors.ivolces.com/docker/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.ivolces.com/docker/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
- Execute the following commands to install the NVIDIA Container Toolkit.
curl -s https://mirrors.ivolces.com/nvidia_all/ubuntu2204/x86_64/3bf863cc.pub | sudo apt-key add -
cat <<EOF >/etc/apt/sources.list.d/nvidia.list
deb http://mirrors.ivolces.com/nvidia_all/ubuntu2204/x86_64/ /
apt install nvidia-container-toolkit -y
- Execute the following commands to configure Docker so that containers can use the instance's GPU resources.
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
- (Optional) Initialize the local volume.
- If the instance type you choose has local volumes provided, we recommend that you execute the following commands to mount the local volume to the directory "/data00" where the model is stored. By doing this, you can improve the model loading speed.
mkfs -t ext4 /dev/nvme0n1
mount -t ext4 /dev/nvme0n1 /data00
tip
- Replace /dev/nvme0n1 with the name of the actual local volume.
- Replace ext4 with the file system you want to use.
Step 2: Deploy and run the model
- Download the model file.
- Execute the following command to install and configure onion.
curl -fsSL https://mirrors.ivolces.com/extra-tools/ubuntu/GPG-KEY-system | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/volc-extra-tools.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/volc-extra-tools.gpg] http://mirrors.ivolces.com/extra-tools/ubuntu jammy main" > /etc/apt/sources.list.d/volctools.list && apt update && apt install -y onion-ai-data
- Execute the following command to download the DeepSeek-V4.1-Flash model and store it in the target directory.
tip
- Please replace /data00 with the actual directory where the model is saved.
- You can also execute the oniond list model command to view the list of available models.
oniond download model DeepSeek-V4.1-Flash --dir /data00
- Execute the following commands on the GPU instance based on the region of the instance to download the Docker image.
China (Beijing)
China (Shanghai)
docker pull ai-containers-cn-beijing.cr.volces.com/deeplearning/sglang:dev-dsv41
docker pull ai-containers-cn-shanghai.cr.volces.com/deeplearning/sglang:dev-dsv41
- Based on the instance region, execute the corresponding command on the GPU instance to start the Docker container and the DeepSeek-V4.1-Flash model service.
tip
Please replace /data00 with the actual path where the model is saved.
China (Beijing)
China (Shanghai)
docker run --gpus all -itd --net=host --shm-size=100g --ulimit memlock=-1 --ulimit stack=67108864 --privileged --ipc=host --security-opt seccomp=unconfined --cap-add=ALL -v /data00/:/data00/ -v /var/run/nvidia-topologyd/:/var/run/nvidia-topologyd/ --entrypoint sglang ai-containers-cn-beijing.cr.volces.com/deeplearning/sglang:dev-dsv41 serve \
--model-path /data00/DeepSeek-V4.1-Flash \
--attention-backend dsv4 \
--moe-runner-backend flashinfer_mxfp4 \
--enable-decoder-swa-bounded-replay \
--reasoning-parser auto \
--tool-call-parser auto \
--image-processor-backend pil \
--cuda-graph-max-bs-decode 32 \
docker run --gpus all -itd --net=host --shm-size=100g --ulimit memlock=-1 --ulimit stack=67108864 --privileged --ipc=host --security-opt seccomp=unconfined --cap-add=ALL -v /data00/:/data00/ -v /var/run/nvidia-topologyd/:/var/run/nvidia-topologyd/ --entrypoint sglang ai-containers-cn-shanghai.cr.volces.com/deeplearning/sglang:dev-dsv41 serve \
--model-path /data00/DeepSeek-V4.1-Flash \
--attention-backend dsv4 \
--moe-runner-backend flashinfer_mxfp4 \
--enable-decoder-swa-bounded-replay \
--reasoning-parser auto \
--tool-call-parser auto \
--image-processor-backend pil \
--cuda-graph-max-bs-decode 32 \
- The preceding commands are used to start and deploy the DeepSeek-V4.1-Flash model. To deploy and start other models, replace the relevant environment variables and parameter values in the commands according to the parameter descriptions in the following table.
- Execute the following command to check from the Docker logs whether the container and model have started successfully.
- View the running log of the corresponding container.
docker logs -f <CONTAINER_ID>
tip
Replace <CONTAINER_ID> with the actual container ID.
- Execute the following command to call the model and verify that the deployed model can perform inference properly.
curl -X POST http://localhost:30000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "deepseek-v4.1-flash",
- This topic only describes the parameters used for verification.
Last updated: 2026.09.20 16:02:21