Instructions to use CosmicRaisins/GLM-5.2-MTP-INT4-15pct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CosmicRaisins/GLM-5.2-MTP-INT4-15pct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CosmicRaisins/GLM-5.2-MTP-INT4-15pct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CosmicRaisins/GLM-5.2-MTP-INT4-15pct") model = AutoModelForCausalLM.from_pretrained("CosmicRaisins/GLM-5.2-MTP-INT4-15pct") 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 CosmicRaisins/GLM-5.2-MTP-INT4-15pct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CosmicRaisins/GLM-5.2-MTP-INT4-15pct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CosmicRaisins/GLM-5.2-MTP-INT4-15pct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CosmicRaisins/GLM-5.2-MTP-INT4-15pct
- SGLang
How to use CosmicRaisins/GLM-5.2-MTP-INT4-15pct 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 "CosmicRaisins/GLM-5.2-MTP-INT4-15pct" \ --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": "CosmicRaisins/GLM-5.2-MTP-INT4-15pct", "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 "CosmicRaisins/GLM-5.2-MTP-INT4-15pct" \ --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": "CosmicRaisins/GLM-5.2-MTP-INT4-15pct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CosmicRaisins/GLM-5.2-MTP-INT4-15pct with Docker Model Runner:
docker model run hf.co/CosmicRaisins/GLM-5.2-MTP-INT4-15pct
GLM-5.2-MTP-INT4-aligned
Separate-draft MTP (multi-token-prediction) head for speculative decoding with
CosmicRaisins/GLM-5.2-AWQ-INT4-15pct. cyankiwi/GLM-5.2-AWQ-INT4 drops GLM-5.2's
native MTP layer, so this reconstructs it as a standalone INT4 draft that vLLM
loads via --speculative-config (which also sidesteps vLLM #35041 / #38494). INT4
compressed-tensors, single MTP layer, 218 experts to match the pruned target. ~4.8 GB.
Use
--speculative-config '{"model":"CosmicRaisins/GLM-5.2-MTP-INT4-aligned","method":"mtp","num_speculative_tokens":3,"attention_backend":"FLASHMLA_SPARSE"}'
k=3 benched best for me on a synthetic corpus; Z.ai recommends k=5, and I haven't compared them in real-world use yet. Serving stack: github.com/CosmicRaisins/glm-5.2-gb10.
Lineage & license
The MTP weights trace to GLM-5.2's native MTP head (Z.ai, MIT), sourced via
0xSero's NVFP4 layer-78 (0xSero/GLM-5.2-NVFP4-REAP-469B), then dequantized,
re-quantized to INT4, expert-pruned to 218, and aligned to the DeepSeekMTP
loader layout. The reconstruction and alignment are mine.
License MIT, inherited from the GLM-5.2 base: the MTP weights carry GLM-5.2's MIT grant through 0xSero's quantization (0xSero's repo declares no explicit license). Attributed to Z.ai and 0xSero; not affiliated with either.
- Downloads last month
- 294
Model tree for CosmicRaisins/GLM-5.2-MTP-INT4-15pct
Base model
zai-org/GLM-5.2