Instructions to use ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts", 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("ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts
- SGLang
How to use ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts 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 "ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts" \ --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": "ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts", "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 "ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts" \ --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": "ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts with Docker Model Runner:
docker model run hf.co/ISTA-DASLab/DeepSeek-R1-0528-GPTQ-4b-128g-experts
Random gibberish and endless gibberish appear after replying 1000-2000 characters.
Random gibberish and endless gibberish appear after replying 1000-2000 characters. Here is my startup command.
RAY_IGNORE_UNHANDLED_ERRORS=1 python -m vllm.entrypoints.openai.api_server
--model /home/kkk/ai/models/DeepSeek-R1-0528-GPTQ
--tensor-parallel-size 8
--pipeline-parallel-size 2
--host 0.0.0.0
--port 9997
--enable-prefix-caching
--served-model-name DeepSeek-R1
--gpu-memory-utilization 0.95
--trust-remote-code
--max-num-batched-tokens 32768
--max-model-len 65535
--dtype float16
@su400 and by the way, which GPU? We observed that there are currently issues for execution on GB200. Execution on H100/H200 yields coherent outputs.
vllm 0.9.1.dev85+g0f71e2403 /home/kkk/ai/vllm,compressed-tensors 0.9.4, 16X l40S.
There's no problem now. I switched to VLLM 0.9.01, but the speed is slower than the original R1 AWQ version. The same machine used to have 40 tokens per second, but now it has 30 tokens per second. The reason for VLLM optimization should also be attributed.