Instructions to use cyankiwi/GLM-5.2-AWQ-INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cyankiwi/GLM-5.2-AWQ-INT4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cyankiwi/GLM-5.2-AWQ-INT4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cyankiwi/GLM-5.2-AWQ-INT4") model = AutoModelForCausalLM.from_pretrained("cyankiwi/GLM-5.2-AWQ-INT4") 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 cyankiwi/GLM-5.2-AWQ-INT4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cyankiwi/GLM-5.2-AWQ-INT4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cyankiwi/GLM-5.2-AWQ-INT4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cyankiwi/GLM-5.2-AWQ-INT4
- SGLang
How to use cyankiwi/GLM-5.2-AWQ-INT4 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 "cyankiwi/GLM-5.2-AWQ-INT4" \ --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": "cyankiwi/GLM-5.2-AWQ-INT4", "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 "cyankiwi/GLM-5.2-AWQ-INT4" \ --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": "cyankiwi/GLM-5.2-AWQ-INT4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cyankiwi/GLM-5.2-AWQ-INT4 with Docker Model Runner:
docker model run hf.co/cyankiwi/GLM-5.2-AWQ-INT4
Looking forward to testing this, thanks!
yes, thanks for the release!
Tested! Its nice and fast:
Here's the writeup:
https://dnhkng.github.io/posts/gh200-benchmarking-part-3-glm52/
@cpatonn this mod improved your AWQ model for me: https://huggingface.co/dnhkng/GLM-5.2-AWQ-INT4-FP8-MTP-delta
It's benchmarked in the blog.
Tested! Its nice and fast:
Here's the writeup:
https://dnhkng.github.io/posts/gh200-benchmarking-part-3-glm52/@cpatonn this mod improved your AWQ model for me: https://huggingface.co/dnhkng/GLM-5.2-AWQ-INT4-FP8-MTP-delta
It's benchmarked in the blog.
I tried dnhkng/GLM-5.2-AWQ-INT4-FP8-MTP-delta, but the draft acceptance rate was surprisingly low. Even on very simple cases, the average accepted length was lower than 1. Did I miss something in my setup, or do you also see this behavior in your tests? In your blog, you said it can be 3 to 4.
Here is my script output
Local FP8 MTP extraction plan
FP8 source: /path/to/GLM-5.2-FP8
Extract dir: /path/to/tmp
MTP tensors: 1569
Source shards: model-00136-of-00141.safetensors, model-00137-of-00141.safetensors, model-00138-of-00141.safetensors
GLM-5.2 AWQ MTP graft plan
AWQ source: /path/to/GLM-5.2-AWQ-INT4
MTP source: /path/to/tmp
Output: /path/to/GLM-5.2-AWQ-INT4-REFINED
AWQ link mode: copy
MTP tensors: 1569
MTP shard files: mtp-layer78-00001-of-00003.safetensors, mtp-layer78-00002-of-00003.safetensors, mtp-layer78-00003-of-00003.safetensors
Done.
Wrote /path/to/GLM-5.2-AWQ-INT4-REFINED
Layer-78 tensors: 1569
Extra shard bytes: 10032829896
and the vllm metrics is
Per-position acceptance rate: 0.343, 0.026, 0.000, 0.000, 0.000, Avg Draft acceptance rate: 7.4%
I add the quantization config patch to vllm==0.23.0
@dnhkng which vllm version are you using?
@Jubileus-ryz No idea why that might be the case. Ive used it a bit, and it seems fine. How did patching vLLLM go?
@Jubileus-ryz No idea why that might be the case. Ive used it a bit, and it seems fine. How did patching vLLLM go?
same as https://huggingface.co/dnhkng/GLM-5.2-AWQ-INT4-FP8-MTP-delta/blob/main/patches/vllm-awq-fp8-mtp-quant-config.patch
I'm going to check if the _get_mtp_quant_config function really worked, thanks for your reply.
Edit: My bad β my code changes weren't taking effect. After the fix, it works perfectly. Thanks!
@dnhkng
@Jubileus-ryz What are the before/after token generation speeds?
@dnhkng I didn't test it on an open dataset. In my setup, I used 8ΓH20 with 30k input tokens and ~1k output tokens at concurrency 1. Before: 51 tokens/s, after: 124 tokens/s. I set the MTP length to 3, and the average draft acceptance rate was 57.5%.