Instructions to use deepseek-ai/DeepSeek-V3.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/DeepSeek-V3.2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-V3.2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-V3.2", dtype="auto") - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use deepseek-ai/DeepSeek-V3.2 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.2" # 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.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-V3.2
- SGLang
How to use deepseek-ai/DeepSeek-V3.2 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.2" \ --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.2", "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.2" \ --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.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-V3.2 with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-V3.2
Fail to access DeepSeek-V3.2 through Claude Code
I try to use this amazing model in Claude Code. However, it seems that the base url as official website offers: https://api.deepseek.com/v3.2_speciale_expires_on_20251215 is wrong. I get error code: API Error: 404 status code (no body). This is my Claude Code configuration:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.deepseek.com/v3.2_speciale_expires_on_20251215",
"ANTHROPIC_AUTH_TOKEN": "${My key}",
"API_TIMEOUT_MS": "3000000",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"ANTHROPIC_MODEL": "deepseek-reasoner",
"ANTHROPIC_SMALL_FAST_MODEL": "deepseek-reasoner",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-reasoner",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-reasoner",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-reasoner"
},
"enabledPlugins": {
"document-skills@anthropic-agent-skills": true
}
}
How can I fix it. I can't wait to experience it in Claude Code.
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-key",
"ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-reasoner",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-reasoner",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-reasoner",
"ANTHROPIC_MODEL": "deepseek-reasoner",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1
}
} this will work.
The v3.2_speciale_expires_on_20251215 endpoint is an OpenAI-format endpoint, so it cannot be used by claude code.
You can use https://api.deepseek.com/anthropic for claude-compatible endpoint, but it can only access DeepSeek-V3.2 model, not DeepSeek-V3.2-Speciale.
