Text Generation
Transformers
Safetensors
glm_moe_dsa
auto-round
conversational
Eval Results
8-bit precision
compressed-tensors
Instructions to use INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound") model = AutoModelForCausalLM.from_pretrained("INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound") 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 INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound
- SGLang
How to use INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound 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 "INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound" \ --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": "INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound", "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 "INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound" \ --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": "INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound with Docker Model Runner:
docker model run hf.co/INCModel2/GLM-5.2-MXFP4-Mixed-CT-AutoRound
| tags: | |
| - auto-round | |
| license: other | |
| license_name: mit | |
| library_name: transformers | |
| base_model: | |
| - zai-org/GLM-5.2 | |
| ## Model Details | |
| This model is a MXFP4 and MXFP8 mixed model of [zai-org/GLM-5.2](https://huggingface.co/zai-org/GLM-5.2) generated by [intel/auto-round](https://github.com/intel/auto-round) with RTN mode. The model format is Compressed Tensor (CT), fully compatible with vLLM. | |
| <!-- Not real data | |
| | GLM-5.2 | gsm8k | mmlu | piqa | hellaswag | avg | ratio | | |
| |-------------------|---------|---------|---------|------------|--------|--------| | |
| | Raw | 0.9386 | 0.8898 | 0.8471 | 0.7747 | 0.863 | | | |
| | **INCModel2/GLM-5.2-MXFP4-Mixed-LLMC** | 0.9439 | 0.8847 | 0.8411 | 0.7646 | 0.859 | 99.54% | | |
| --> | |
| ## vllm Infernece Example | |
| ~~~bash | |
| vllm serve INCModel2/GLM-5.2-MXFP4-Mixed-LLMC \ | |
| --kv-cache-dtype fp8_e4m3 \ | |
| --tensor-parallel-size 4 \ | |
| --tool-call-parser glm47 \ | |
| --enable-auto-tool-choice \ | |
| --reasoning-parser glm45 \ | |
| --served-model-name glm \ | |
| --max-model-len 4096 | |
| ~~~ | |
| ~~~bash | |
| curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d ' { | |
| "model": "glm", | |
| "messages": [ | |
| {"role": "system", "content": "You are a helpful assistant."}, | |
| {"role": "user", "content": "Write code to fine-tune an LLM."} | |
| ], | |
| "temperature": 1, | |
| "max_tokens": 2048 | |
| } ' | |
| ~~~ | |
| ## Generate the Model | |
| RTN version | |
| commit: d1ddb5c9ba5f79adb8bbc124b8d438e6bafcb707 (high accuracy) | |
| ~~~bash | |
| auto-round zai-org/GLM-5.2 --model_free --format llm_compressor --scheme MXFP8 --output_dir /workspace/models/zai-org/GLM-5.2-MXFP4-MXFP8 --ignore_layers layers.0,layers.1,layers.2,indexer.weights_proj,indexer.wk --layer_config "{mlp.experts:{scheme:MXFP4}}" | |
| ~~~ | |
| commit: e56290ac3ba50b56cd9ea66423a3f4c9004848ee | |
| ~~~bash | |
| auto-round zai-org/GLM-5.2 --model_free --format llm_compressor --scheme MXFP8 --output_dir /workspace/models/zai-org/GLM-5.2-MXFP4-MXFP8 --ignore_layers indexer.weights_proj,indexer.wk --layer_config "{mlp.experts:{scheme:MXFP4}}" | |
| ~~~ | |
| ## Ethical Considerations and Limitations | |
| The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs. | |
| Therefore, before deploying any applications of the model, developers should perform safety testing. | |
| ## Caveats and Recommendations | |
| Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. | |
| Here are a couple of useful links to learn more about Intel's AI software: | |
| - [Intel Neural Compressor](https://github.com/intel/neural-compressor) | |
| ## Disclaimer | |
| The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes. | |
| ## Cite | |
| @article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} } | |
| [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round) |