Text Generation
Transformers
Safetensors
TensorRT
glm_moe_dsa
nvfp4
fp4
quantization
modelopt
Mixture of Experts
glm
sglang
conversational
8-bit precision
Instructions to use Mapika/GLM-5.2-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mapika/GLM-5.2-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Mapika/GLM-5.2-NVFP4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Mapika/GLM-5.2-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("Mapika/GLM-5.2-NVFP4") 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]:])) - TensorRT
How to use Mapika/GLM-5.2-NVFP4 with TensorRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Mapika/GLM-5.2-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mapika/GLM-5.2-NVFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mapika/GLM-5.2-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Mapika/GLM-5.2-NVFP4
- SGLang
How to use Mapika/GLM-5.2-NVFP4 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 "Mapika/GLM-5.2-NVFP4" \ --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": "Mapika/GLM-5.2-NVFP4", "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 "Mapika/GLM-5.2-NVFP4" \ --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": "Mapika/GLM-5.2-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Mapika/GLM-5.2-NVFP4 with Docker Model Runner:
docker model run hf.co/Mapika/GLM-5.2-NVFP4
| { | |
| "producer": { | |
| "name": "modelopt", | |
| "version": "0.44.0" | |
| }, | |
| "quantization": { | |
| "quant_algo": "NVFP4", | |
| "kv_cache_quant_algo": null, | |
| "group_size": 16, | |
| "exclude_modules": [ | |
| "lm_head", | |
| "model.layers.0.self_attn*", | |
| "model.layers.1.self_attn*", | |
| "model.layers.10.self_attn*", | |
| "model.layers.11.self_attn*", | |
| "model.layers.12.self_attn*", | |
| "model.layers.13.self_attn*", | |
| "model.layers.14.self_attn*", | |
| "model.layers.15.self_attn*", | |
| "model.layers.16.self_attn*", | |
| "model.layers.17.self_attn*", | |
| "model.layers.18.self_attn*", | |
| "model.layers.19.self_attn*", | |
| "model.layers.2.self_attn*", | |
| "model.layers.20.self_attn*", | |
| "model.layers.21.self_attn*", | |
| "model.layers.22.self_attn*", | |
| "model.layers.23.self_attn*", | |
| "model.layers.24.self_attn*", | |
| "model.layers.25.self_attn*", | |
| "model.layers.26.self_attn*", | |
| "model.layers.27.self_attn*", | |
| "model.layers.28.self_attn*", | |
| "model.layers.29.self_attn*", | |
| "model.layers.3.self_attn*", | |
| "model.layers.30.self_attn*", | |
| "model.layers.31.self_attn*", | |
| "model.layers.32.self_attn*", | |
| "model.layers.33.self_attn*", | |
| "model.layers.34.self_attn*", | |
| "model.layers.35.self_attn*", | |
| "model.layers.36.self_attn*", | |
| "model.layers.37.self_attn*", | |
| "model.layers.38.self_attn*", | |
| "model.layers.39.self_attn*", | |
| "model.layers.4.self_attn*", | |
| "model.layers.40.self_attn*", | |
| "model.layers.41.self_attn*", | |
| "model.layers.42.self_attn*", | |
| "model.layers.43.self_attn*", | |
| "model.layers.44.self_attn*", | |
| "model.layers.45.self_attn*", | |
| "model.layers.46.self_attn*", | |
| "model.layers.47.self_attn*", | |
| "model.layers.48.self_attn*", | |
| "model.layers.49.self_attn*", | |
| "model.layers.5.self_attn*", | |
| "model.layers.50.self_attn*", | |
| "model.layers.51.self_attn*", | |
| "model.layers.52.self_attn*", | |
| "model.layers.53.self_attn*", | |
| "model.layers.54.self_attn*", | |
| "model.layers.55.self_attn*", | |
| "model.layers.56.self_attn*", | |
| "model.layers.57.self_attn*", | |
| "model.layers.58.self_attn*", | |
| "model.layers.59.self_attn*", | |
| "model.layers.6.self_attn*", | |
| "model.layers.60.self_attn*", | |
| "model.layers.61.self_attn*", | |
| "model.layers.62.self_attn*", | |
| "model.layers.63.self_attn*", | |
| "model.layers.64.self_attn*", | |
| "model.layers.65.self_attn*", | |
| "model.layers.66.self_attn*", | |
| "model.layers.67.self_attn*", | |
| "model.layers.68.self_attn*", | |
| "model.layers.69.self_attn*", | |
| "model.layers.7.self_attn*", | |
| "model.layers.70.self_attn*", | |
| "model.layers.71.self_attn*", | |
| "model.layers.72.self_attn*", | |
| "model.layers.73.self_attn*", | |
| "model.layers.74.self_attn*", | |
| "model.layers.75.self_attn*", | |
| "model.layers.76.self_attn*", | |
| "model.layers.77.self_attn*", | |
| "model.layers.8.self_attn*", | |
| "model.layers.9.self_attn*" | |
| ] | |
| } | |
| } |