Text Generation
Transformers
Safetensors
qwen3
feature-extraction
speculative-decoding
draft-model
custom_code
text-generation-inference
Instructions to use Xinmu7/PPCM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Xinmu7/PPCM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Xinmu7/PPCM", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Xinmu7/PPCM", trust_remote_code=True) model = AutoModel.from_pretrained("Xinmu7/PPCM", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Xinmu7/PPCM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Xinmu7/PPCM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xinmu7/PPCM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Xinmu7/PPCM
- SGLang
How to use Xinmu7/PPCM 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 "Xinmu7/PPCM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xinmu7/PPCM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Xinmu7/PPCM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xinmu7/PPCM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Xinmu7/PPCM with Docker Model Runner:
docker model run hf.co/Xinmu7/PPCM
Qwen3-8B-PPCM
PPCM is a ~9M three-layer encoder (CCEL โ CTIL โ CPRL) over Top-7 candidates. It ranks causally consistent paths in one pass, then the target model verifies the top path.
This repo is not a standalone chat model. Load Qwen3-8B as the target.
| Code | github.com/Xinmu-Tantai/PPCM |
| Target | Qwen/Qwen3-8B |
| Speculative length | 7 (block_size = 8), Top-7 candidates |
| Extra params | 8.8M |
On Qwen3-8B / GSM8K (T = 0, L = 7): ฯ = 5.97, 5.18ร speedup.
Files
model.safetensorsโ 5-layer causal draft +ppcm.ccel/ppcm.ctil/ppcm.cprl/ppcm.scoreconfig.jsonโPPCMDraftModel,num_speculative_tokens: 7ppcm.pyโ Hugging FaceAutoModelclass
Usage
Serve with the PPCM vLLM code:
TARGET_MODEL=Qwen/Qwen3-8B
DRAFT_MODEL=Xinmu7/PPCM
NUM_SPECULATIVE_TOKENS=7
License
Apache License 2.0.
- Downloads last month
- 311