Get Started with DeepSeek-V4.1-Flash-1017
Deploy DeepSeek-V4.1-Flash-1017 using the SGLang Model-Free NIM Experimental Collection. The collection provides a model-free container and a separate serving recipe resource. Supply model weights at runtime and load the recipe for your GPU and topology. For the supported configurations, refer to DeepSeek-V4.1-Flash-1017.
Use container and recipe version
2.1.6-variant-deepseek-v4.1-flash-1017 together. The container does not
include model weights. Download the
DeepSeek AI checkpoint
separately, as shown below.
Prerequisites
Before deploying the container, ensure your environment meets the following requirements:
Hardware Requirements
The following are the minimum required specifications for supported hardware components:
Software Requirements
Minimum required versions for supported software components.
Operating System
While other Linux distributions can be compatible with NIM, they have not been officially validated.
We recommend using Ubuntu 22.04 LTS or later for the best experience.
CUDA SDK
Install CUDA SDK by following the CUDA installation guide for Linux.
GPU Drivers
Install the NVIDIA GPU drivers by following the NVIDIA Driver Installation Guide.
Docker
Docker is required to run the containerized NIM services.
-
Install Docker Engine for your Linux distribution by following the Docker Engine installation guide.
-
Verify that the Docker daemon is running and that your user can execute
dockercommands withoutsudo. Add your user to thedockergroup if needed: -
Log out and back in for the group change to take effect.
Container Toolkit
The NVIDIA Container Toolkit enables Docker containers to access the host GPU.
-
Install the toolkit by following the NVIDIA Container Toolkit installation guide.
-
Configure Docker to use the NVIDIA runtime by following the Docker configuration steps.
-
Restart the Docker daemon after configuration:
NIM Container Access
To download and deploy NIM containers, you need one of the following:
- A free NVIDIA Developer Program membership.
- An NVIDIA AI Enterprise license. To request a free 90-day evaluation license, refer to Ways to Get Started With NVIDIA AI Enterprise and Activate Your NVIDIA AI Enterprise License.
Generate Access Credentials
NGC
An NGC Personal API key is not required to access most NVIDIA NIM containers and models hosted on NGC. An NGC API key is only required to download Production Branch (PB) models. This Get Started documentation uses a feature branch model as an example, so creating an NGC Personal API key is optional.
If you want to create an NGC Personal API key, do the following:
-
Generate the Personal API Key on the Setup API Keys page.
-
When creating the Personal API key, select at least NGC Catalog from the Services Included list. You can also include additional services if you want to use the same key for other purposes.
Legacy API keys are not supported by NIM. Always use a Personal API Key.
Hugging Face
Create a Hugging Face access token with read permissions (or higher, only if your org or private repos require it). This token allows model-free NIM to fetch models directly from Hugging Face.
Verify NVIDIA Runtime Access
To ensure that your setup is correct, run the following command:
This command should produce output similar to one of the following, where you can confirm CUDA driver version, and available GPUs.
Install the NGC CLI to download the serving recipe. Provide disk space for approximately 476 GiB (511 GB) of FP8 weights, in addition to the container and runtime cache.
Configure Authentication and Caching
Accept any model access terms on Hugging Face before downloading weights.
Export a Hugging Face Access Token
Export a Hugging Face token to download models from Hugging Face.
-
Export the variable in your shell (temporary), replacing
<token-value>with your actual token: -
Optional: Persist the variable in your shell profile for future terminals.
If using bash:
If using zsh:
-
Verify the variable is set:
Export an NGC API Key
An NGC API key is only required to download Production Branch (PB) models. You can skip this section if you did not create an NGC API key.
-
Export the variable in your shell (temporary), replacing
<VALUE>with your actual API key: -
Optional: Persist the variable in your shell profile for future terminals.
If using bash:
If using zsh:
-
Verify the variable is set:
Model Cache
NIM downloads model weights to a cache on the host that you mount into the container. Artifacts persist across restarts, so you do not pull the full model on every run.
Local Cache
An essential variable to configure on your host system is the cache path directory. This directory is mapped from the host machine to container; assets (for example, model weights) are downloaded to this host directory and persist across container restarts. Configuring a local cache is highly recommended, as it avoids re-downloading large model files upon subsequent container restarts. You can name the environment variable containing the path to the local cache whatever you want.
Create the cache directory and export an environment variable:
When you start the NIM container, you must map your host machine’s local cache directory ($LOCAL_NIM_CACHE) to the container’s internal cache path (/opt/nim/.cache) using a Docker volume mount, such as -v "$LOCAL_NIM_CACHE:/opt/nim/.cache". This mapping ensures that the large model weights downloaded by the container are saved to your host machine. Because containers are ephemeral, any data stored only inside the container is lost when it stops. By using a volume mount, subsequent container runs detect the existing model files in your local cache and skip the lengthy download process, allowing the NIM to start up faster.
If you created an NGC API key, authenticate with the NVIDIA Container Registry using the following command:
Use $oauthtoken as the username and NGC_API_KEY as the password. The $oauthtoken username is a special name that indicates that you will authenticate with an API key and not a user name and password.
Choose the Model Source
To download the FP8 checkpoint from Hugging Face at startup, set:
NIM saves the downloaded files in the mounted cache. To use an existing local
checkpoint instead, mount its directory and set NIM_MODEL_PATH to the path
inside the container. Refer to Supported Model Sources for details.
Pull the Container and Download the Recipe
Pull the published
SGLang Model-Free NIM container
and download the matching
DeepSeek-V4.1-Flash-1017 recipe.
Both artifacts use version 2.1.6-variant-deepseek-v4.1-flash-1017:
Select the recipe for your GPU and topology from the downloaded resource. For supported configurations, refer to the Support Matrix for NIMs.
For example, to use four B200 GPUs, set:
For another configuration, set RECIPE to its downloaded YAML file and
GPU_COUNT to the GPU count required by that configuration in the
Support Matrix for NIMs. Make the selected
file readable by the container user with chmod 0644 "$RECIPE".
For GB200, configure an IMEX domain on the host spanning one tray with four
GPUs. After selecting the GB200 recipe and setting GPU_COUNT=4, set the
additional Docker options required for that configuration:
For B200, H200, and H20-3e, leave GPU_DOCKER_ARGS empty (GPU_DOCKER_ARGS=()).
Run the launch command below in the same Bash shell where you set these options.
All four recipes use the following validated settings:
For this model, settings in the recipe take precedence over the corresponding
NIM_* environment variables. Use the provided, validated recipes without
modifying these settings; changes can significantly degrade performance.
Run NIM
Mount the cache and selected recipe, and load the recipe with
NIM_CONFIG_FILE:
Keep the selected recipe loaded to reproduce the validated configuration.
Verify Readiness
Wait for the model to load before sending inference requests. Readiness returns HTTP 200 when the model is ready:
The recipes set served_model_name to
deepseek-ai/DeepSeek-V4.1-Flash-1017. Use that identifier in API requests.
Setting NIM_SERVED_MODEL_NAME in the launch command does not change the
identifier supplied by these recipes.
Send a Chat Completion Request
Test the running NIM with the recipe’s served model identifier,
deepseek-ai/DeepSeek-V4.1-Flash-1017, and an output budget that allows room
for reasoning:
Reasoning tokens consume the output budget. If the response ends with
finish_reason: "length", increase max_tokens and retry.
To receive output incrementally, add "stream": true to the request.
For additional request formats, refer to API Reference.
Send an Image Request
Image input is supported through image_url content parts in Chat Completions
requests. For example:
Video and audio content parts are not supported and return HTTP 400.
Send an Anthropic Messages Request
The SGLang container also exposes /v1/messages. To request thinking, send:
For tool calling examples, refer to Tool Calling and MCP Integration.