Instructions to use AesSedai/GLM-4.5-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use AesSedai/GLM-4.5-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="AesSedai/GLM-4.5-GGUF", filename="ik_llama.cpp/IQ2_KT/GLM-4.5-IQ2_KT-00001-of-00003.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use AesSedai/GLM-4.5-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf AesSedai/GLM-4.5-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf AesSedai/GLM-4.5-GGUF:Q2_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf AesSedai/GLM-4.5-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf AesSedai/GLM-4.5-GGUF:Q2_K
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 AesSedai/GLM-4.5-GGUF:Q2_K # Run inference directly in the terminal: ./llama-cli -hf AesSedai/GLM-4.5-GGUF:Q2_K
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 AesSedai/GLM-4.5-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf AesSedai/GLM-4.5-GGUF:Q2_K
Use Docker
docker model run hf.co/AesSedai/GLM-4.5-GGUF:Q2_K
- LM Studio
- Jan
- vLLM
How to use AesSedai/GLM-4.5-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AesSedai/GLM-4.5-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": "AesSedai/GLM-4.5-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AesSedai/GLM-4.5-GGUF:Q2_K
- Ollama
How to use AesSedai/GLM-4.5-GGUF with Ollama:
ollama run hf.co/AesSedai/GLM-4.5-GGUF:Q2_K
- Unsloth Studio new
How to use AesSedai/GLM-4.5-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 AesSedai/GLM-4.5-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 AesSedai/GLM-4.5-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for AesSedai/GLM-4.5-GGUF to start chatting
- Pi new
How to use AesSedai/GLM-4.5-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf AesSedai/GLM-4.5-GGUF:Q2_K
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": "AesSedai/GLM-4.5-GGUF:Q2_K" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use AesSedai/GLM-4.5-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf AesSedai/GLM-4.5-GGUF:Q2_K
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 AesSedai/GLM-4.5-GGUF:Q2_K
Run Hermes
hermes
- Docker Model Runner
How to use AesSedai/GLM-4.5-GGUF with Docker Model Runner:
docker model run hf.co/AesSedai/GLM-4.5-GGUF:Q2_K
- Lemonade
How to use AesSedai/GLM-4.5-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AesSedai/GLM-4.5-GGUF:Q2_K
Run and chat with the model
lemonade run user.GLM-4.5-GGUF-Q2_K
List all available models
lemonade list
llama.cppimatrix Quantizations of zai-org/GLM-4.5- Q6_K-IQ2_S-IQ2_S-IQ3_S: 128.18 GiB (3.07 BPW), Final estimate: PPL = 4.786993 ยฑ 0.031213, KLD = 0.145117 ยฑ 0.002232
- GLM-4.5-Q6_K-Q2_K-Q2_K-Q3_K: 129.57 GiB (3.11 BPW), Final estimate: PPL = 4.700384 ยฑ 0.030202, KLD = 0.164863 ยฑ 0.002339
- GLM-4.5-Q8_0-IQ3_XXS-IQ3_XXS-IQ3_S: 144.68 GiB (3.47 BPW), Final estimate: PPL = 4.729934 ยฑ 0.030769, KLD = 0.116520 ยฑ 0.002072
ik_llama.cppimatrix Quantizations of zai-org/GLM-4.5- IQ2_KT: 109.269 GiB (2.619 BPW): Lost the results somewhere, oops.
- IQ4_KSS: 176.499 GiB (4.231 BPW): Lost the results somewhere, oops.
- IQ4_KS-IQ4_KS-IQ5_KS: 200.326 GiB (4.802 BPW), Final estimate: PPL = 4.618597 ยฑ 0.029981, KLD = 0.072590 ยฑ 0.001816
- IQ5_K: 204.948 GiB (4.913 BPW), Final estimate: PPL = 4.665419 ยฑ 0.030393, KLD = 0.078092 ยฑ 0.001891
This repository contains some custom quants of GLM-4.5 that focus on a couple of different schemas compared to the usual quantization schemas.
The idea being that given the huge size of the FFN tensors compared to the rest of the tensors in the model, it should be possible to achieve a better quality while keeping the overall size of the entire model smaller compared to a similar naive quantization.
The following charts showcase a very wide variety of GLM-4.5 quants that were tested for KL Divergence using the reference logits and corpus included in this repo: GLM-4.5-KLD-8192-ref-logits-ed-combined-all-micro-Q8_0.bin and combined_all_micro.txt
A full CSV with the data is included as well in glm-4.5-quantization-output.csv.
The naming convention is (inconsistently) as follows, generally: [Default Type]-[FFN_UP]-[FFN_GATE]-[FFN_DOWN], eg: Q6_K-IQ2_S-IQ2_S-IQ3_S. This means:
- Q6_K is the default type (attention, shared expert, etc.)
- IQ2_S was used for the FFN_UP and FFN_GATE conditional expert tensors
- IQ3_S was used for the FFN_DOWN conditional expert tensors
Generally speaking, quants following the above convention tend to have a better KLD and PPL compared to quants from other providers. Visualized here are the Mean KLD and Mean PPL of the quants on the Pareto frontier (so, best for a given size). Full graphs are available in the plots-glm-4.5-8192 folder.
Provided here are a few quants, separated into llama.cpp and ik_llama.cpp folders for convenience (though, ik_llama.cpp is capable of running the quants in llama.cpp, but the opposite is not true).
llama.cpp imatrix Quantizations of zai-org/GLM-4.5
This quant collection can be run on llama.cpp or kobold.cpp like normal.
Q6_K-IQ2_S-IQ2_S-IQ3_S: 128.18 GiB (3.07 BPW), Final estimate: PPL = 4.786993 ยฑ 0.031213, KLD = 0.145117 ยฑ 0.002232
GLM-4.5-Q6_K-Q2_K-Q2_K-Q3_K: 129.57 GiB (3.11 BPW), Final estimate: PPL = 4.700384 ยฑ 0.030202, KLD = 0.164863 ยฑ 0.002339
GLM-4.5-Q8_0-IQ3_XXS-IQ3_XXS-IQ3_S: 144.68 GiB (3.47 BPW), Final estimate: PPL = 4.729934 ยฑ 0.030769, KLD = 0.116520 ยฑ 0.002072
ik_llama.cpp imatrix Quantizations of zai-org/GLM-4.5
This quant collection REQUIRES ik_llama.cpp fork to support the ik's latest SOTA quants and optimizations! Do not download these big files and expect them to run on mainline vanilla llama.cpp, ollama, LM Studio, KoboldCpp, etc!
NOTE ik_llama.cpp can also run your existing GGUFs from bartowski, unsloth, mradermacher, etc if you want to try it out before downloading my quants.
Some of ik's new quants are supported with Nexesenex/croco.cpp fork of KoboldCPP with Windows builds for CUDA 12.9. Also check for Windows builds by Thireus here. which have been CUDA 12.8.
See Ubergarm's GLM-4.5 quants for info on how to use the recipe or make your own quant.
IQ2_KT: 109.269 GiB (2.619 BPW): Lost the results somewhere, oops.
๐ Recipe
# 93 Repeating Layers [0-92]
# Attention
blk\..*\.attn_q.*=iq4_k
blk\..*\.attn_k.*=iq6_k
blk\..*\.attn_v.*=iq6_k
blk\..*\.attn_output.*=iq5_ks
# First 3 Dense Layers [0-2]
blk\..*\.ffn_down\.weight=iq4_ks
blk\..*\.ffn_(gate|up)\.weight=iq3_ks
# Shared Expert Layers [3-92]
blk\..*\.ffn_down_shexp\.weight=iq6_k
blk\..*\.ffn_(gate|up)_shexp\.weight=iq6_k
# Routed Experts Layers [3-92]
blk\..*\.ffn_down_exps\.weight=iq3_kt
blk\..*\.ffn_(gate|up)_exps\.weight=iq2_kt
# NextN MTP Layer [92]
blk\..*\.nextn\.embed_tokens\.weight=iq4_k
blk\..*\.nextn\.shared_head_head\.weight=iq6_k
blk\..*\.nextn\.eh_proj\.weight=iq6_k
# Non-Repeating Layers
token_embd\.weight=iq4_k
output\.weight=iq6_k
IQ4_KSS: 176.499 GiB (4.231 BPW): Lost the results somewhere, oops.
๐ Recipe
# 93 Repeating Layers [0-92]
# Attention
blk\.(0|1|2)\.attn_q.*=q8_0
blk\.(0|1|2)\.attn_k.*=q8_0
blk\.(0|1|2)\.attn_v.*=q8_0
blk\.(0|1|2)\.attn_output.*=q8_0
blk\..*\.attn_q.*=iq6_k
blk\..*\.attn_k.*=iq6_k
blk\..*\.attn_v.*=iq6_k
blk\..*\.attn_output.*=iq6_k
# First 3 Dense Layers [0-2]
blk\..*\.ffn_down\.weight=iq5_ks
blk\..*\.ffn_(gate|up)\.weight=iq4_ks
# Shared Expert Layers [3-92]
blk\..*\.ffn_down_shexp\.weight=q8_0
blk\..*\.ffn_(gate|up)_shexp\.weight=q8_0
# Routed Experts Layers [3-92]
blk\..*\.ffn_down_exps\.weight=iq4_ks
blk\..*\.ffn_(gate|up)_exps\.weight=iq4_kss
# NextN MTP Layer [92]
blk\..*\.nextn\.embed_tokens\.weight=iq5_ks
blk\..*\.nextn\.shared_head_head\.weight=iq5_ks
blk\..*\.nextn\.eh_proj\.weight=q8_0
# Non-Repeating Layers
token_embd\.weight=iq4_k
output\.weight=iq6_k
IQ4_KS-IQ4_KS-IQ5_KS: 200.326 GiB (4.802 BPW), Final estimate: PPL = 4.618597 ยฑ 0.029981, KLD = 0.072590 ยฑ 0.001816
๐ Recipe
Default quant level @ Q8_0
# Shared Expert Layers [3-92]
blk\..*\.ffn_down_shexp\.weight=q8_0
blk\..*\.ffn_(gate|up)_shexp\.weight=q8_0
# Routed Experts Layers [3-92]
blk\..*\.ffn_up_exps\.weight=iq4_ks
blk\..*\.ffn_gate_exps\.weight=iq4_ks
blk\..*\.ffn_down_exps\.weight=iq5_ks
IQ5_K: 204.948 GiB (4.913 BPW), Final estimate: PPL = 4.665419 ยฑ 0.030393, KLD = 0.078092 ยฑ 0.001891
๐ Recipe
# 93 Repeating Layers [0-92]
# Attention
blk\.(0|1|2)\.attn_q.*=q8_0
blk\.(0|1|2)\.attn_k.*=q8_0
blk\.(0|1|2)\.attn_v.*=q8_0
blk\.(0|1|2)\.attn_output.*=q8_0
blk\..*\.attn_q.*=iq5_k
blk\..*\.attn_k.*=iq5_k
blk\..*\.attn_v.*=iq5_k
blk\..*\.attn_output.*=iq5_k
# First 3 Dense Layers [0-2]
blk\..*\.ffn_down\.weight=q8_0
blk\..*\.ffn_(gate|up)\.weight=q8_0
# Shared Expert Layers [3-92]
blk\..*\.ffn_down_shexp\.weight=q8_0
blk\..*\.ffn_(gate|up)_shexp\.weight=q8_0
# Routed Experts Layers [3-92]
blk\..*\.ffn_down_exps\.weight=iq5_k
blk\..*\.ffn_(gate|up)_exps\.weight=iq4_k
# NextN MTP Layer [92]
blk\..*\.nextn\.embed_tokens\.weight=iq5_k
blk\..*\.nextn\.shared_head_head\.weight=iq5_k
blk\..*\.nextn\.eh_proj\.weight=q8_0
# Non-Repeating Layers
token_embd\.weight=q8_0
output\.weight=q8_0
- Downloads last month
- 892
Model tree for AesSedai/GLM-4.5-GGUF
Base model
zai-org/GLM-4.5
