Instructions to use deepseek-ai/DeepSeek-V4-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/DeepSeek-V4-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-V4-Flash") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-V4-Flash") model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-V4-Flash") - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use deepseek-ai/DeepSeek-V4-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-Flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/DeepSeek-V4-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-V4-Flash
- SGLang
How to use deepseek-ai/DeepSeek-V4-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-Flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/DeepSeek-V4-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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-Flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/DeepSeek-V4-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-V4-Flash with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-V4-Flash
fastllm 启动deepseek-v4-flash 回答问题乱码
配置cpu 128
内存:256
显卡:RTX 4090 * 6
fastllm:0.1.7.0
cuda:13.2
ftllm server /data/models/DeepSeek-V4-Flash --model_name deepseek-v4-flash --port 15001 --host 0.0.0.0 --device multicuda --tp 6 --gpu_mem_ratio 0.75
[root]# curl http://ip:15001/v1/chat/completions
-H "Content-Type: application/json"
-d '{
"model": "deepseek-v4-flash",
"messages": [
{"role": "user", "content": "你好"}
],
"stream": true
}'
data: {"id":"fastllm-deepseek-v4-flash-018b69597d6c42b4923f90c8b3fc8256","object":"chat.completion.chunk","created":1784015161,"model":"deepseek-v4-flash","choices":[{"index":0,"delta":{"role":"assistant"},"logprobs":null,"finish_reason":null}]}
data: {"id":"fastllm-deepseek-v4-flash-018b69597d6c42b4923f90c8b3fc8256","object":"chat.completion.chunk","created":1784015161,"model":"deepseek-v4-flash","choices":[{"index":0,"delta":{"content":" handelt"},"logprobs":null,"finish_reason":null}]}
data: {"id":"fastllm-deepseek-v4-flash-018b69597d6c42b4923f90c8b3fc8256","object":"chat.completion.chunk","created":1784015161,"model":"deepseek-v4-flash","choices":[{"index":0,"delta":{"content":"咯咯"},"logprobs":null,"finish_reason":null}]}
data: {"id":"fastllm-deepseek-v4-flash-018b69597d6c42b4923f90c8b3fc8256","object":"chat.completion.chunk","created":1784015161,"model":"deepseek-v4-flash","choices":[{"index":0,"delta":{"content":"waż"},"logprobs":null,"finish_reason":null}]}