Text Generation
Transformers
Safetensors
deepseek_v3
conversational
custom_code
text-generation-inference
fp8
Instructions to use deepseek-ai/DeepSeek-V3.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/DeepSeek-V3.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-V3.1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-V3.1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-V3.1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use deepseek-ai/DeepSeek-V3.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deepseek-ai/DeepSeek-V3.1" # 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-V3.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-V3.1
- SGLang
How to use deepseek-ai/DeepSeek-V3.1 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-V3.1" \ --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-V3.1", "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-V3.1" \ --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-V3.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-V3.1 with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-V3.1
How is routed_scaling_factor = 2.5 chosen?
#50 opened about 11 hours ago
by
timg8710
Fix chat_template crash when assistant message omits the `content` key
#49 opened 22 days ago
by
qgallouedec
Distill the model into 4 variants: 600M, 1.5B, 4B and 7B
#48 opened 8 months ago
by
the81coder
模型在复杂工具调用出现输出乱码的
#47 opened 8 months ago
by
lichenxi2222
Quantum Ai
#45 opened 9 months ago
by
Xavernox
调用不存在的 tool
#43 opened 9 months ago
by
Jingxin
中文 markdown 表格容易出错
1
#42 opened 9 months ago
by
wunengbiao
OUTPUT_PARSING_FAILURE
#41 opened 9 months ago
by
jinysun
RuntimeError: No DeepseekV2MoE layer found in model.layers.
#40 opened 9 months ago
by
ajtakto
Script to download deepseek tensor files
#39 opened 9 months ago
by
gariandamo
Criticism, please read
👍❤️ 10
1
#38 opened 9 months ago
by
ChuckMcSneed
Solve this Isuue Please
1
#37 opened 9 months ago
by
deep7654
多轮tool call能力不稳定
3
#35 opened 9 months ago
by
xielegend
Have you guys noticed this "极""極""extreme"problem?
➕ 6
1
#34 opened 9 months ago
by
DingzhenPearl
为什么模型卡片里的weight_scale_inv即使用fp32存储,也还是存在尾数?
6
#33 opened 9 months ago
by
Ali1234588
Feat: Add toolcall description
#32 opened 9 months ago
by
eric8810
Update README.md
#29 opened 9 months ago
by
AmeelF
[W4A8 FP8 Quantization] Release of DeepSeek-V3.1 with SGLang Support – Near-Lossless & 1.56x Speed Boost!
🔥 2
#28 opened 9 months ago
by
Carson
tool call for reasoning mode
➕ 6
#27 opened 9 months ago
by
shing3232
V3.1 seems to be pretty bad at everything except coding and mathematics. V3.1 看起来除了编程和数学之外,其他方面都很差。
👀➕ 9
8
#26 opened 9 months ago
by
qazqazqazqaz46
DeepSeek-V3.1全方位最新实测出炉(300+维度),欢迎进群交流讨论~
#25 opened 9 months ago
by
JEIN
有人尝试过本地通过vllm部署并连接到claude code吗?
1
#24 opened 9 months ago
by
Yuxin362
why all the scale values of attn out_proj have the none-zero mantissa 0b111010101010010101001111111101 ?
#22 opened 9 months ago
by
abcstar
Update system prompt to include tools
3
#21 opened 9 months ago
by
bchenfireworks
recommended temp?
1
#19 opened 9 months ago
by
createthis
Tool calling usage examples
#18 opened 9 months ago
by
1000Xia
Context length: is it 128K (as mentioned in the model card) or 160K (as specified in config.json)?
1
#17 opened 9 months ago
by
Lissanro
不知道还有没有蒸馏模型
3
#13 opened 9 months ago
by
BlackLeee
no score on swe under thinking mode
➕👀 3
2
#11 opened 9 months ago
by
vitvamer
This model’s censorship is insane
👍🧠 6
13
#10 opened 9 months ago
by
smile1030
请问simpleQA结果是否为笔误?
4
#9 opened 9 months ago
by
rnc000
梁文疯垃圾模型
😎🧠 3
13
#7 opened 9 months ago
by
eiskalt
search是用think模式吗
#6 opened 9 months ago
by
awdrgyjilplij
Congratulations to DeepSeek, this version seems powerful for coding and agent development
👀❤️ 1
1
#5 opened 9 months ago
by
Robin-Han
火速下载
👍 1
#4 opened 9 months ago
by
HowardChenRV
Any plan to release the post-training recipe?
1
#3 opened 9 months ago
by
Yi30
Come on, third party bros! Deploy it!
👍🔥 6
3
#2 opened 9 months ago
by
DingzhenPearl