Text Generation
Transformers
Safetensors
deepseek_v3
conversational
custom_code
Eval Results
text-generation-inference
fp8
Instructions to use deepseek-ai/DeepSeek-V3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/DeepSeek-V3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-V3", 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", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-V3", trust_remote_code=True, device_map="auto") 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 Settings
- vLLM
How to use deepseek-ai/DeepSeek-V3 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" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-V3
- SGLang
How to use deepseek-ai/DeepSeek-V3 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" \ --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", "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" \ --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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-V3 with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-V3
Update README_WEIGHTS.md
Browse files- README_WEIGHTS.md +3 -3
README_WEIGHTS.md
CHANGED
|
@@ -18,7 +18,7 @@ The DeepSeek-V3 weight file consists of two main components: **Main Model Weight
|
|
| 18 |
- Input/output embedding layers and a complete set of 61 Transformer hidden layers.
|
| 19 |
- **Parameter Count**:
|
| 20 |
- Total parameters: **671B**
|
| 21 |
-
- Activation parameters: **36.6B**.
|
| 22 |
|
| 23 |
#### Structural Details
|
| 24 |
|
|
@@ -35,8 +35,8 @@ The DeepSeek-V3 weight file consists of two main components: **Main Model Weight
|
|
| 35 |
- **Composition**:
|
| 36 |
- Additional MTP Modules defined by the `num_nextn_predict_layers` field. In this model, the value is set to 1.
|
| 37 |
- **Parameter Count**:
|
| 38 |
-
- Parameters: **11.5B unique parameters**
|
| 39 |
-
- Activation parameters: **
|
| 40 |
|
| 41 |
#### Structural Details
|
| 42 |
|
|
|
|
| 18 |
- Input/output embedding layers and a complete set of 61 Transformer hidden layers.
|
| 19 |
- **Parameter Count**:
|
| 20 |
- Total parameters: **671B**
|
| 21 |
+
- Activation parameters: **36.6B** (including 0.9B for the output Head).
|
| 22 |
|
| 23 |
#### Structural Details
|
| 24 |
|
|
|
|
| 35 |
- **Composition**:
|
| 36 |
- Additional MTP Modules defined by the `num_nextn_predict_layers` field. In this model, the value is set to 1.
|
| 37 |
- **Parameter Count**:
|
| 38 |
+
- Parameters: **11.5B unique parameters** (excluding the shared 0.9B Embedding and 0.9B output Head).
|
| 39 |
+
- Activation parameters: **1.5B** (including 0.9B for the output Head).
|
| 40 |
|
| 41 |
#### Structural Details
|
| 42 |
|