Instructions to use unsloth/GLM-5.2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use unsloth/GLM-5.2-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="unsloth/GLM-5.2-GGUF", filename="BF16/GLM-5.2-BF16-00001-of-00033.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use unsloth/GLM-5.2-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/GLM-5.2-GGUF:UD-Q4_K_M # Run inference directly in the terminal: llama cli -hf unsloth/GLM-5.2-GGUF:UD-Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/GLM-5.2-GGUF:UD-Q4_K_M # Run inference directly in the terminal: llama cli -hf unsloth/GLM-5.2-GGUF:UD-Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf unsloth/GLM-5.2-GGUF:UD-Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf unsloth/GLM-5.2-GGUF:UD-Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf unsloth/GLM-5.2-GGUF:UD-Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf unsloth/GLM-5.2-GGUF:UD-Q4_K_M
Use Docker
docker model run hf.co/unsloth/GLM-5.2-GGUF:UD-Q4_K_M
- LM Studio
- Jan
- vLLM
How to use unsloth/GLM-5.2-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/GLM-5.2-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/GLM-5.2-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/GLM-5.2-GGUF:UD-Q4_K_M
- Ollama
How to use unsloth/GLM-5.2-GGUF with Ollama:
ollama run hf.co/unsloth/GLM-5.2-GGUF:UD-Q4_K_M
- Unsloth Studio
How to use unsloth/GLM-5.2-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/GLM-5.2-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/GLM-5.2-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for unsloth/GLM-5.2-GGUF to start chatting
- Pi
How to use unsloth/GLM-5.2-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/GLM-5.2-GGUF:UD-Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "unsloth/GLM-5.2-GGUF:UD-Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use unsloth/GLM-5.2-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/GLM-5.2-GGUF:UD-Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default unsloth/GLM-5.2-GGUF:UD-Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use unsloth/GLM-5.2-GGUF with Docker Model Runner:
docker model run hf.co/unsloth/GLM-5.2-GGUF:UD-Q4_K_M
- Lemonade
How to use unsloth/GLM-5.2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull unsloth/GLM-5.2-GGUF:UD-Q4_K_M
Run and chat with the model
lemonade run user.GLM-5.2-GGUF-UD-Q4_K_M
List all available models
lemonade list
1-bit GLM-5.2 GGUF vs. Claude 4.8 Opus vs. GPT-5.5
Hey guys, we gave 3 models the same prompt and compared one-shot outputs.
It's not necessarily to pick out the winner but we want to showcase that 1-bit can actually perform well. GLM-5.2 was a first try one-shot attempt.
The 1-bit GLM-5.2 GGUF ran locally on a Mac Studio M3 Ultra 256GB RAM at ~21.6 tok/s. Guide: https://unsloth.ai/docs/models/glm-5.2
You can try it yourself in Unsloth Studio: https://github.com/unslothai/unsloth
Which do you like best?
IMO would make more sense if comparison is with other models of same size as well. If 4bit minimax m3 can do better than 1bit glm 5.2, would make no sense to go with glm 5.2
UD-Q2_K_XL vs UD-Q4_K_XL
I borrowed this prompt:
Act as a senior game developer. Build a technically impressive Backrooms horror game in a single self-contained HTML file. Embed all CSS and JavaScript, no external libraries. Raycaster (DDA) with textured walls plus floor/ceiling casting, 480x270 internal buffer upscaled with image-rendering: pixelated, infinite 16x16 chunks from value-noise/fBm with a guaranteed open street grid, procedural textures. WASD + mouse look, F flashlight, Esc releases pointer lock. Dynamic fluorescent lighting ON by default (never hard to see), warm yellow fog, vignette/grain/subtle VHS, Web Audio hum + fluorescent whine + footsteps. Psychological horror, dread over jumpscares: footsteps behind you that stop when you turn, lights that flicker then settle, a far silhouette that vanishes, rare spatial anomalies, randomized timers with cooldowns, slow escalation. Save position to localStorage. Return only the complete HTML.
Token usage for Q2 was substantially higher than for Q4, so in this test it was actually slower and broken.
Note: the side-by-side showcase video was created by Q4 itself, running inside the Pi Coding Agent. It set up an automated gameplay script with Puppeteer, captured each frame, generated the labels, and encoded everything with ffmpeg end to end.
UD-Q2_K_XL vs UD-Q4_K_XL
I borrowed this prompt:
Act as a senior game developer. Build a technically impressive Backrooms horror game in a single self-contained HTML file. Embed all CSS and JavaScript, no external libraries. Raycaster (DDA) with textured walls plus floor/ceiling casting, 480x270 internal buffer upscaled with image-rendering: pixelated, infinite 16x16 chunks from value-noise/fBm with a guaranteed open street grid, procedural textures. WASD + mouse look, F flashlight, Esc releases pointer lock. Dynamic fluorescent lighting ON by default (never hard to see), warm yellow fog, vignette/grain/subtle VHS, Web Audio hum + fluorescent whine + footsteps. Psychological horror, dread over jumpscares: footsteps behind you that stop when you turn, lights that flicker then settle, a far silhouette that vanishes, rare spatial anomalies, randomized timers with cooldowns, slow escalation. Save position to localStorage. Return only the complete HTML.
Token usage for Q2 was substantially higher than for Q4, so in this test it was actually slower and broken.
Note: the side-by-side showcase video was created by Q4 itself, running inside the Pi Coding Agent. It set up an automated gameplay script with Puppeteer, captured each frame, generated the labels, and encoded everything with ffmpeg end to end.
Oooooo super nice
I encountered various problems easily when running IQ2 quantized QWEN 3.5 235B with 40GB VRAM and 32GB RAM. Does this mean that models with more parameters will operate more efficiently in IMatrix?
I encountered various problems easily when running IQ2 quantized QWEN 3.5 235B with 40GB VRAM and 32GB RAM. Does this mean that models with more parameters will operate more efficiently in IMatrix?
Shouldn't you ask this on Qwen 3.5's page @motherisis ? As far I understand this is discussion is reserved for GLM 5.2 only.
can we get a coding benchmark for 5.2 gguf? Preferably at 4 and 8 bit