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", device_map="auto") - 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
Add LHTB eval result: 2/46 tasks solved (90-min budget, estimated)
Adds the Long-Horizon Terminal-Bench (LHTB) result for DeepSeek V4 Flash to the LHTB benchmark leaderboard.
Score: 2 — tasks solved at reward >= 0.95, out of 46. The leaderboard metric is a task count, not a percentage.
Please read the caveat before merging, because this number is an estimate:
| Agent | terminus-2 (official LHTB Harbor harness) |
| Run budget | 3 hours |
| Leaderboard budget | 90 minutes |
| Score at 90 min | 2/46 (range 2-3, riscv-core-debug unresolved) |
| Score at full 3h | 5/46 |
We only have a 3-hour run of DeepSeek V4 Flash on terminus-2, but every entry on this
leaderboard uses a 90-minute budget. Rather than publish the 3-hour number as if it were
comparable, the 90-minute figure is reconstructed from the run's interim verifier
checkpoints: LHTB re-verifies after each phase, so a task's reward at an earlier cutoff can
be read back. Ten tasks have no checkpoint that early and are counted as unsolved, which is
why 2 is a lower bound and 3 the upper.
This is not a substitute for actually running at 90 minutes -- the continuation prompt
tells the agent how much time remains, so a real shorter run would budget its effort
differently. Full artifacts and the per-budget curve (reward_curve.json) are published so
the derivation can be checked:
https://huggingface.co/datasets/IntelligenceLab/LHTB-leaderboard/tree/main/submissions/long-horizon-terminal-bench/1.0-extended/terminus-2__deepseek-v4-flash-3h
Submitted by the LHTB maintainers. Happy to withdraw this if you would rather wait for a
native 90-minute run, or to adjust the wording.