MiniMax M3.1
Serve MiniMaxAI/MiniMax-M3.1-Flash with TokenSpeed and its bundled DSpark draft for speculative decoding.
Prerequisites
Before you start, complete the following preparations:
- Prepare four Blackwell GPUs for this example's
--tensor-parallel-size 4configuration. - Install TokenSpeed, the
hfcommand, andcurl. For TokenSpeed installation instructions, see Getting started. - Obtain access to the
MiniMaxAI/MiniMax-M3.1-Flashcheckpoint on Hugging Face. - Make TCP port
8000available on the server host. - Review and trust the checkpoint's remote code. The server command passes
--trust-remote-code.
For checkpoints that declare quant_method: mxfp8 with moe_quant_algo: NVFP4, TokenSpeed automatically selects mxfp8_nvfp4. Projections use MXFP8, and routed experts use NVFP4. This quantization requires Blackwell.
Start the server
Download the target checkpoint and its bundled DSpark draft. This command stores the local checkpoint path in
model_dirfor the next step:bashmodel_dir=$(hf download MiniMaxAI/MiniMax-M3.1-Flash --quiet)The draft is in the
dspark/subdirectory and declaresDSparkMiniMaxDraftModel.Start TokenSpeed with the target checkpoint and DSpark draft. This example uses seven draft steps and an eight-token verify window. If your DSpark checkpoint has a different
block_size, adjust7and8as described in Configure DSpark widths:bashtokenspeed serve "$model_dir" \ --tensor-parallel-size 4 \ --max-model-len 1048576 \ --gpu-memory-utilization 0.95 \ --attention-backend trtllm \ --kv-cache-dtype fp8 \ --moe-backend flashinfer_trtllm \ --speculative-algorithm DSPARK \ --speculative-draft-model-path "$model_dir/dspark" \ --speculative-num-steps 7 \ --speculative-eagle-topk 1 \ --speculative-num-draft-tokens 8 \ --trust-remote-code \ --host 0.0.0.0 \ --port 8000From another terminal on the server host, query the readiness endpoint:
bashcurl --fail --silent --show-error \ --output /dev/null --write-out '%{http_code}\n' \ http://127.0.0.1:8000/readinessThe command prints
200when TokenSpeed is ready to accept requests.
Configure DSpark widths
Set --speculative-num-steps to the DSpark checkpoint's block_size, and set --speculative-num-draft-tokens to block_size + 1. For more information about the width conventions, see Speculative decoding.
Optional: Serve the target without DSpark
To serve the target alone, remove the --speculative-* options from the launch command.