Instructions to use QuantPasture/GLM-4.6-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use QuantPasture/GLM-4.6-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="QuantPasture/GLM-4.6-GGUF", filename="for-ed-please-ignore/imatrix-ed-v2.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantPasture/GLM-4.6-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 QuantPasture/GLM-4.6-GGUF:Q8_0 # Run inference directly in the terminal: llama cli -hf QuantPasture/GLM-4.6-GGUF:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantPasture/GLM-4.6-GGUF:Q8_0 # Run inference directly in the terminal: llama cli -hf QuantPasture/GLM-4.6-GGUF:Q8_0
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 QuantPasture/GLM-4.6-GGUF:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf QuantPasture/GLM-4.6-GGUF:Q8_0
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 QuantPasture/GLM-4.6-GGUF:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantPasture/GLM-4.6-GGUF:Q8_0
Use Docker
docker model run hf.co/QuantPasture/GLM-4.6-GGUF:Q8_0
- LM Studio
- Jan
- Ollama
How to use QuantPasture/GLM-4.6-GGUF with Ollama:
ollama run hf.co/QuantPasture/GLM-4.6-GGUF:Q8_0
- Unsloth Studio
How to use QuantPasture/GLM-4.6-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 QuantPasture/GLM-4.6-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 QuantPasture/GLM-4.6-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantPasture/GLM-4.6-GGUF to start chatting
- Pi
How to use QuantPasture/GLM-4.6-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf QuantPasture/GLM-4.6-GGUF:Q8_0
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": "QuantPasture/GLM-4.6-GGUF:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use QuantPasture/GLM-4.6-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 QuantPasture/GLM-4.6-GGUF:Q8_0
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 QuantPasture/GLM-4.6-GGUF:Q8_0
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use QuantPasture/GLM-4.6-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf QuantPasture/GLM-4.6-GGUF:Q8_0
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "QuantPasture/GLM-4.6-GGUF:Q8_0" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use QuantPasture/GLM-4.6-GGUF with Docker Model Runner:
docker model run hf.co/QuantPasture/GLM-4.6-GGUF:Q8_0
- Lemonade
How to use QuantPasture/GLM-4.6-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantPasture/GLM-4.6-GGUF:Q8_0
Run and chat with the model
lemonade run user.GLM-4.6-GGUF-Q8_0
List all available models
lemonade list
What is the .bin file?
Is that imatrix data? I thought ik_llama.cpp only took .dat files, and it seems quite huge, heh.
Oh, that must be for KLD testing or something.
I would appreciate an imatrix if you have it, heh.
Yes, I'll be performing KLD testing for the quants I upload here and I uploaded the logits for another fellow to download for their own testing. I have a couple of quants uploading now, my upload speed is like a 4MB/s average so it'll take a few days for this repo to be populated.
The imatrix was from bartowski, in his repo here: https://huggingface.co/bartowski/zai-org_GLM-4.6-GGUF/tree/main
The quants here will be following a bit of a different schema than the usual llama.cpp quants, most of the model will be kept in Q8 and only the FFN_UP, FN_GATE, and FFN_DOWN tensors for the conditional experts will be quantized lower. This has shown in some previous testing to better preserve the KL divergence compared to the reference Q8_0 model while being the same size or small than the usual llama.cpp quants. So I'll post those results here when testing is concluded.
Cool, thanks for the info!
What's the approximate command you use for KLD testing? I'm interested in this too, and TBH don't have the hardware for the Q8_0 data, so that's useful to me.
I'm quanting something similar right now, though I'm doing slightly lower quants than Q8_0:
# Attention (GPU)
blk\..*\.attn_q.*=iq5_ks
blk\..*\.attn_k.*=iq6_k
blk\..*\.attn_v.*=iq6_k
blk\..*\.attn_output.*=iq5_ks
# First 3 Dense Layers [0-2] (GPU)
blk\..*\.ffn_down\.weight=iq5_ks
blk\..*\.ffn_(gate|up)\.weight=iq5_ks
# Shared Expert Layers [3-92] (GPU)
blk\..*\.ffn_down_shexp\.weight=iq5_ks
blk\..*\.ffn_(gate|up)_shexp\.weight=iq5_ks
# Routed Experts Layers [3-6] (GPU)
blk\.[3-6]\.ffn_down_exps\.weight=iq3_kt
blk\.[3-6]\.ffn_(gate|up)_exps\.weight=iq3_kt
# Routed Experts Layers [7-19] (CPU)
blk\.[7-9]\.ffn_down_exps\.weight=iq3_ks
blk\.[7-9]\.ffn_(gate|up)_exps\.weight=iq3_ks
blk\.[1-1][0-9]\.ffn_down_exps\.weight=iq3_ks
blk\.[1-1][0-9]\.ffn_(gate|up)_exps\.weight=iq3_ks
# Routed Experts Layers [20-80] (CPU)
blk\..*\.ffn_down_exps\.weight=iq2_kl
blk\..*\.ffn_(gate|up)_exps\.weight=iq2_kl
# Routed Experts Layers [81-92] (CPU)
blk\.[8-8][1-9]\.ffn_down_exps\.weight=iq3_ks
blk\.[8-8][1-9]\.ffn_(gate|up)_exps\.weight=iq3_ks
blk\.[9-9][0-2]\.ffn_down_exps\.weight=iq3_ks
blk\.[9-9][0-2]\.ffn_(gate|up)_exps\.weight=iq3_ks
# 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
And now I'm wondering if there are 'sweet spots' for the attention and and other shared layers, since they do add up to be pretty small.
So, this is how I generated the reference logits to begin with:
./llama-perplexity \
--n-gpu-layers 999 --threads 48 \
--override-tensor "blk\.(0|1|2|3|4)\.ffn_.*=CUDA0" \
--override-tensor "blk\.(5|6|7)\.ffn_.*=CUDA1" \
--override-tensor "blk\..*_exps\.=CPU" \
--flash-attn on \
--file /mnt/srv/host/resources/KLD/ddh0_imat_calibration_data_v2.txt \
--save-all-logits /mnt/srv/host/resources/GLM-4.6-KLD-ref-logits-Q8_0-ddh0-imat-calibration-data-v2.bin \
--model /mnt/srv/slush/gguf/GLM-4.6-GGUF/GLM-4.6-Q8_0.gguf
The overrides, gpu layers, and threads are all configurable for your specific setup but this is what works for mine (768GB 12ch DDR5 6000MHz and two 3090s). That produces a set of reference logits based on the text corpus.
Afterwards, I produce a model quant then test it as follows:
./llama-perplexity \
--n-gpu-layers 999 --threads 48 \
--override-tensor "blk\.(0|1|2|3|4)\.ffn_.*=CUDA0" \
--override-tensor "blk\.(5|6|7)\.ffn_.*=CUDA1" \
--override-tensor "blk\..*_exps\.=CPU" \
--flash-attn on \
--file /mnt/srv/host/resources/KLD/ddh0_imat_calibration_data_v2.txt \
--kl-divergence --kl-divergence-base /mnt/srv/host/resources/GLM-4.6-KLD-ref-logits-Q8_0-ddh0-imat-calibration-data-v2.bin \
--model /mnt/srv/host/gguf/GLM-4.6-GGUF/aes_sedai/GLM-4.6-Q8_0-Q4_K-Q4_K-Q5_K.gguf
That spits out a set of statistics at the end for Perplexity, KL divergence, and Token probabilities. I've got a little automation set up to save the output of that llama-perplexity into a .md file per quant that can then be processed with another script into a CSV output and a series of plots.
For reference, here are a couple of plots for quants I tested for GLM-4.5. Mean KLD vs File Size first:
Most of my quants were Q8 for the default type, with just the FFN_UP, FFN_GATE, FFN_DOWN tensors quanted to eg, Q4 / Q4 / Q5 respectively. This means that the shared experts are all Q8, the attention is Q8 (which means it does take up more VRAM for context), etc. Just quanting the conditional experts down via those FFNs looks really appealing IMO. I'm currently quanting and doing similar testing for GLM-4.6, and I'll upload a few of the more promising mainline llama.cpp and ik_llama.cpp quants over the next few days.
the attention is Q8 (which means it does take up more VRAM for context)
This is not true btw :3

