Text Generation
Transformers
Safetensors
Chinese
English
deepseek_v3
vLLM
GPTQ
conversational
custom_code
text-generation-inference
4-bit precision
awq
Instructions to use QuantTrio/DeepSeek-V3.1-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuantTrio/DeepSeek-V3.1-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QuantTrio/DeepSeek-V3.1-AWQ", 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("QuantTrio/DeepSeek-V3.1-AWQ", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("QuantTrio/DeepSeek-V3.1-AWQ", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use QuantTrio/DeepSeek-V3.1-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantTrio/DeepSeek-V3.1-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantTrio/DeepSeek-V3.1-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantTrio/DeepSeek-V3.1-AWQ
- SGLang
How to use QuantTrio/DeepSeek-V3.1-AWQ 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 "QuantTrio/DeepSeek-V3.1-AWQ" \ --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": "QuantTrio/DeepSeek-V3.1-AWQ", "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 "QuantTrio/DeepSeek-V3.1-AWQ" \ --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": "QuantTrio/DeepSeek-V3.1-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use QuantTrio/DeepSeek-V3.1-AWQ with Docker Model Runner:
docker model run hf.co/QuantTrio/DeepSeek-V3.1-AWQ
new installation instuction for stable/correct performance
Browse files
README.md
CHANGED
|
@@ -17,17 +17,18 @@ base_model_relation: quantized
|
|
| 17 |
Base model: [DeepSeek-V3.1](https://huggingface.co/deepseek-ai/DeepSeek-V3.1)
|
| 18 |
|
| 19 |
### 【Dependencies / Installation】
|
| 20 |
-
As of **2025-08-
|
| 21 |
|
| 22 |
```bash
|
| 23 |
# ❗there are glitches with vllm 0.10.1.1, still looking for resolutions❗
|
| 24 |
# ❗downgrade vllm for now ❗
|
| 25 |
-
pip install vllm==0.9.0
|
| 26 |
-
pip install transformers==4.53
|
| 27 |
|
| 28 |
-
# ❗patch up AWQ MoE quant config, otherwise some modules cannot be properly loaded❗
|
| 29 |
SITE_PACKAGES=$(pip -V | awk '{print $4}' | sed 's/\/pip$//')
|
|
|
|
| 30 |
cp awq_marlin.py "$SITE_PACKAGES/vllm/model_executor/layers/quantization/awq_marlin.py"
|
|
|
|
|
|
|
| 31 |
```
|
| 32 |
|
| 33 |
### 【vLLM Single Node with 8 GPUs — Startup Command】
|
|
@@ -51,6 +52,12 @@ vllm serve \
|
|
| 51 |
|
| 52 |
### 【Logs】
|
| 53 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
2025-08-23
|
| 55 |
1. Initial commit
|
| 56 |
```
|
|
|
|
| 17 |
Base model: [DeepSeek-V3.1](https://huggingface.co/deepseek-ai/DeepSeek-V3.1)
|
| 18 |
|
| 19 |
### 【Dependencies / Installation】
|
| 20 |
+
As of **2025-08-27**, create a fresh Python environment and run:
|
| 21 |
|
| 22 |
```bash
|
| 23 |
# ❗there are glitches with vllm 0.10.1.1, still looking for resolutions❗
|
| 24 |
# ❗downgrade vllm for now ❗
|
| 25 |
+
pip install vllm==0.9.2 transformers==4.53.0
|
|
|
|
| 26 |
|
|
|
|
| 27 |
SITE_PACKAGES=$(pip -V | awk '{print $4}' | sed 's/\/pip$//')
|
| 28 |
+
# ❗patch up AWQ MoE quant config, otherwise some modules cannot be properly loaded❗
|
| 29 |
cp awq_marlin.py "$SITE_PACKAGES/vllm/model_executor/layers/quantization/awq_marlin.py"
|
| 30 |
+
# ❗patch up for fp32 e_score_correction_bias, see https://www.github.com/vllm-project/vllm/pull/23640❗
|
| 31 |
+
cp deepseek_v2.py "$SITE_PACKAGES/vllm/model_executor/models/deepseek_v2.py"
|
| 32 |
```
|
| 33 |
|
| 34 |
### 【vLLM Single Node with 8 GPUs — Startup Command】
|
|
|
|
| 52 |
|
| 53 |
### 【Logs】
|
| 54 |
```
|
| 55 |
+
2025-08-27
|
| 56 |
+
1. new installation instuction for stable/correct performance
|
| 57 |
+
(a) use vllm 0.9.2 instead of 0.9.0:
|
| 58 |
+
there is unidentified issue with 0.9.0 🥹 which causes numerical error
|
| 59 |
+
(b) patch up deepseek_v2.py for fp32 e_score_correction_bias
|
| 60 |
+
|
| 61 |
2025-08-23
|
| 62 |
1. Initial commit
|
| 63 |
```
|