Instructions to use deepseek-ai/DeepSeek-V4.1-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/DeepSeek-V4.1-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="deepseek-ai/DeepSeek-V4.1-Flash")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-V4.1-Flash", device_map="auto") - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use deepseek-ai/DeepSeek-V4.1-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deepseek-ai/DeepSeek-V4.1-Flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/DeepSeek-V4.1-Flash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-V4.1-Flash
- SGLang
How to use deepseek-ai/DeepSeek-V4.1-Flash with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "deepseek-ai/DeepSeek-V4.1-Flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/DeepSeek-V4.1-Flash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "deepseek-ai/DeepSeek-V4.1-Flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/DeepSeek-V4.1-Flash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-V4.1-Flash with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-V4.1-Flash
Running on 4x RTX PRO 6000 with NVMe offload for ngram
Any idea what's the speed difference vs RAM offload? RDIMM is pricey, have just 128GB.
kept failing on tool caliing benchmarks. disabling dspark solved it.
thanks for the super fast implementation 😃
i'm currently running glm-5.3 flash on the 4x RTX Pro 6000 rig and before that ...
- GLM-5.2-NVFP4 hybrid and before that ...
- deepseek v4 flash preview and before that ...
- MiniMax M3 NVFP4 and before that ...
- MiniMax 2.7 ??
at each point in the rig evolution for 1 to 2, to 3 and finally 4 GPU, I've always run the best model that will fit. glm-5.3-flash doesn't feel better than 5.2 to me, but damn it's so much faster, multi-modal and can handle way more concurrent agents, it's hard to go back to 5.2.
i say this because THIS model, the Deepseek v4.1 Flash beats GLM-5.3-Flash on ALL but two benchmarks. According to the benchmarks, this model should CRUSH GLM 5.3 Flash. I'm about to find out if that's true or not this weekend. I have a fresh SPEC and full 20 phase implementation plan written for an iPad app I was about to let GLM 5.3 Flash slay, but now it's going to be THIS model putting in work.
all of the talk of benchmaxxing is being put to the test on a real project and not a flappy bird clone or some lame one-shot game.
On a side note, why is every single AI YouTuber obsessed with how models perform in a string of one-shot tests. No one develops software as one-shot stunts.