Instructions to use CosmicRaisins/GLM-5.2-AWQ-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-AWQ-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-AWQ-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-AWQ-INT4-15pct") model = AutoModelForCausalLM.from_pretrained("CosmicRaisins/GLM-5.2-AWQ-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-AWQ-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-AWQ-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-AWQ-INT4-15pct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CosmicRaisins/GLM-5.2-AWQ-INT4-15pct
- SGLang
How to use CosmicRaisins/GLM-5.2-AWQ-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-AWQ-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-AWQ-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-AWQ-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-AWQ-INT4-15pct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CosmicRaisins/GLM-5.2-AWQ-INT4-15pct with Docker Model Runner:
docker model run hf.co/CosmicRaisins/GLM-5.2-AWQ-INT4-15pct
GLM-5.2-AWQ-INT4-15pct
15% expert-pruned cyankiwi/GLM-5.2-AWQ-INT4 (256→218 experts/layer), to free
KV-cache headroom for 256k context on memory-constrained clusters (built for 4×
GB10 / DGX Spark). The prune is data-free. ~636B total / ~40B active, AWQ
compressed-tensors W4A16, ~378 GB.
Quality is coherence-checked, not benchmarked. Evaluate before production use; for
guaranteed quality use the unpruned cyankiwi/GLM-5.2-AWQ-INT4 or
zai-org/GLM-5.2.
Method (data-free)
GLM/DeepSeek routers carry a learned e_score_correction_bias per expert: a high
bias means the router had to boost that expert to select it (least favored).
awq_surgery.py drops the 38 highest-bias experts per layer, keeps the 218
lowest, re-indexes survivors, and row-slices the router. No calibration data, no
forward passes. Both num_experts and n_routed_experts become 218. This is not
REAP (REAP needs calibration data and was infeasible on this hardware).
Serving
A 256k 4-bit MoE for multi-node TP, not a single-GPU model. Needs sm_121 Triton
sparse-MLA kernels (native _flashmla_C is Hopper-only). Stack and bootstrap:
github.com/CosmicRaisins/glm-5.2-gb10. Runtime: TP=4, --kv-cache-dtype fp8_ds_mla, --reasoning-parser glm45 --tool-call-parser glm47 --enable-auto-tool-choice, cudagraph FULL, gpu-memory-utilization 0.93.
For MTP speculative decode, pair it with the matching draft built for this
target: CosmicRaisins/GLM-5.2-MTP-INT4-aligned.
License
MIT, inherited. Retain upstream notices on redistribution. GLM-5.2 © Z.ai (MIT); GLM-5.2-AWQ-INT4 © cyankiwi (MIT). The data-free prune is the only modification. Not affiliated with Z.ai or cyankiwi.
- Downloads last month
- 226