Text Generation
Transformers
Safetensors
deepseek_v3
conversational
custom_code
text-generation-inference
8-bit precision
blockwise_int8
Instructions to use meituan/DeepSeek-R1-Block-INT8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use meituan/DeepSeek-R1-Block-INT8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="meituan/DeepSeek-R1-Block-INT8", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("meituan/DeepSeek-R1-Block-INT8", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("meituan/DeepSeek-R1-Block-INT8", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use meituan/DeepSeek-R1-Block-INT8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "meituan/DeepSeek-R1-Block-INT8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meituan/DeepSeek-R1-Block-INT8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/meituan/DeepSeek-R1-Block-INT8
- SGLang
How to use meituan/DeepSeek-R1-Block-INT8 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 "meituan/DeepSeek-R1-Block-INT8" \ --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": "meituan/DeepSeek-R1-Block-INT8", "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 "meituan/DeepSeek-R1-Block-INT8" \ --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": "meituan/DeepSeek-R1-Block-INT8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use meituan/DeepSeek-R1-Block-INT8 with Docker Model Runner:
docker model run hf.co/meituan/DeepSeek-R1-Block-INT8
Commit History
-
Update README.md (#10)
Verified signature- Update README.md (752a83d893d97731f8356ca000b1756cefe477bc) Co-authored-by: laixinn <yuanzu@users.noreply.huggingface.co>e60c1b5
-
Update README.md (#8)
Verified signature- Update README.md (cdab70ee37816e572312be5842328c442c0334de) Co-authored-by: HandH1998 <HandH1998@users.noreply.huggingface.co>1842c56 -
Update inference/bf16_cast_block_int8.py (#7)
Verified signature- Update inference/bf16_cast_block_int8.py (ca68670207d276a38c4d91eb8054a6d1653c2c23) Co-authored-by: HandH1998 <HandH1998@users.noreply.huggingface.co>d476539
-
Update README.md (#6)
Verified signature- Update README.md (47346e4d832f26979f43a25b069688934c3f4cc8) Co-authored-by: laixinn <yuanzu@users.noreply.huggingface.co>e48a514 -
Update README.md (#5)
Verified signature- Update README.md (1f37595e7f0ca7d27fbf9224ae97095afaedf72e) Co-authored-by: laixinn <yuanzu@users.noreply.huggingface.co>160722a -
Update README.md (#3)
Verified signature- Update README.md (8e07ef9bb64b51687cde799feee406d64123ae32) Co-authored-by: laixinn <yuanzu@users.noreply.huggingface.co>d4440e1 -
Update README.md (#2)
Verified signature- Update README.md (ce34483c2fb7b4f0154e581f6a3d3bdff00caf8b) Co-authored-by: laixinn <yuanzu@users.noreply.huggingface.co>c0b1d45 -
Update README.md (#1)
Verified signature- Update README.md (9692d6350cc82096d838fa93a537d1f512fcee33) Co-authored-by: laixinn <yuanzu@users.noreply.huggingface.co>277034a -
Add files using upload-large-folder tool
Verified signature0d7d596 -
Add files using upload-large-folder tool
Verified signature9a88c3a -
Add files using upload-large-folder tool
Verified signature98bd0fb -
Add files using upload-large-folder tool
Verified signature7d69425 -
Add files using upload-large-folder tool
Verified signature8e8c28e -
initial commit
Verified signatureebeffaa