Instructions to use bartowski/THUDM_GLM-4-32B-0414-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use bartowski/THUDM_GLM-4-32B-0414-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 bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf bartowski/THUDM_GLM-4-32B-0414-GGUF: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 bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf bartowski/THUDM_GLM-4-32B-0414-GGUF: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 bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M
Use Docker
docker model run hf.co/bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use bartowski/THUDM_GLM-4-32B-0414-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bartowski/THUDM_GLM-4-32B-0414-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": "bartowski/THUDM_GLM-4-32B-0414-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M
- Ollama
How to use bartowski/THUDM_GLM-4-32B-0414-GGUF with Ollama:
ollama run hf.co/bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M
- Unsloth Studio
How to use bartowski/THUDM_GLM-4-32B-0414-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 bartowski/THUDM_GLM-4-32B-0414-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 bartowski/THUDM_GLM-4-32B-0414-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for bartowski/THUDM_GLM-4-32B-0414-GGUF to start chatting
- Pi
How to use bartowski/THUDM_GLM-4-32B-0414-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bartowski/THUDM_GLM-4-32B-0414-GGUF: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": "bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use bartowski/THUDM_GLM-4-32B-0414-GGUF with Docker Model Runner:
docker model run hf.co/bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M
- Lemonade
How to use bartowski/THUDM_GLM-4-32B-0414-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.THUDM_GLM-4-32B-0414-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use bartowski/THUDM_GLM-4-32B-0414-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 bartowski/THUDM_GLM-4-32B-0414-GGUF: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 bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use bartowski/THUDM_GLM-4-32B-0414-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M
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 "bartowski/THUDM_GLM-4-32B-0414-GGUF:Q4_K_M" \ --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"
llama.cpp fixes have just been merged
It looks like a PR with the fixes for Llama.cpp has just been merged: https://github.com/ggml-org/llama.cpp/pull/13021
So working GGUFs should be possible to generate now with the latest master build :) FYI
Yup just waiting for a build release :) I like to keep it as official as possible 😂
Yup just waiting for a build release :) I like to keep it as official as possible 😂
Dude, stop teasing us lol, wanna binaries, try the ones from the fix test repo here:
https://github.com/piDack/llama.cpp/releases
This would work too, because only the converter has changed.
I bet this fix still not enough for amd cards using vulkan, but will see. For now i can only use cpu version of llama.cpp for this model, otherwise gibberish output.
Better to wait an extra couple hours to ensure it's not going to be another broken release
I've pulled in the release and am starting these quants up now, sorry for the delay!
I bet this fix still not enough for amd cards using vulkan, but will see. For now i can only use cpu version of llama.cpp for this model, otherwise gibberish output.
It works on my AMD GPU. I tested the fixed Q8 quant of the smaller 9B model.
Better to wait an extra couple hours to ensure it's not going to be another broken release
I've pulled in the release and am starting these quants up now, sorry for the delay!
There's now official build which should have the fixes already in, because the build is like 33 minutes old at the time of posting this. https://github.com/ggml-org/llama.cpp/releases
Yeah I've already pulled that release and have started remaking the quants
Seeing the commits trickle in now. Some of the quants have already been updated, see: https://huggingface.co/bartowski/THUDM_GLM-4-32B-0414-GGUF/tree/main
As i expected, still not fixed for AMD, apparently... When the promt is not too short, the output is something like this "=arg观vat limp加盐 일 Hemp descending accessible质dots gehscal Nir Clinrone b pik sw{ geh viableInfinity 将其-section� guardingوعةords Vari".
llama-b5173-bin-win-vulkan-x64. Without even offloading layers to GPU. Just cpu.
So i guess, i still have to use this model in cpu mode in llama-b5173-bin-win-avx2-x64
@urtuuuu It's not a AMD specific bug. Someone in the following issue tracker came with a solution: https://github.com/ggml-org/llama.cpp/issues/12946
You need to set the physical and logical batch size to a low value. -ub 32 -b 32 seemed for work for him, and as you can see in my screenshot in that topic it also fixed it for me.
You need to set the physical and logical batch size to a low value. -ub 32 -b 32 seemed for work for him, and as you can see in my screenshot in that topic it also fixed it for me.
llama-cli -m THUDM_GLM-4-32B-0414-Q3_K_M.gguf -c 8192 --temp 0.5 -cnv --color --multiline-input -b 32 -ub 32
Like this? I tried and still get "ratio неот县人民政府 RHSCha一线 dabalieesarlak或少inus сут不限����的DUCT无语itech韬atorauses'anNES generating Fol XC维 持escap.........."
Update: Ok, i just tried it at -b 16 -ub 16 and it works for now... :) Still sometimes get this output "GGGGGGGGGGGGGGGG" if offloading all 62 layers to GPU. With 60/62 seems to work again. Never had this weirdness with any other model before.
As i expected, still not fixed for AMD, apparently... When the promt is not too short, the output is something like this "=arg观vat limp加盐 일 Hemp descending accessible质dots gehscal Nir Clinrone b pik sw{ geh viableInfinity 将其-section� guardingوعةords Vari".
llama-b5173-bin-win-vulkan-x64. Without even offloading layers to GPU. Just cpu.
So i guess, i still have to use this model in cpu mode in llama-b5173-bin-win-avx2-x64
For whatever reason, I'm able to use this model on my AMD Radeon 8060S (Ryzen AI MAX+ 395) using Ollama | Ollama + Open WebUI with default settings. It's using ~100% of the GPU.
In LM Studio, I can load this model with all GPU layers using the Vulkan llama.cpp Windows runtime. But when answering a question, the output is only 'GGGGGGGGGGGGGGGGGG'. However, switching to CPU llama.cpp Windows runtime, the model works as intended, albeit more than half the speed of Vulkan.
So whatever Ollama is doing under the hood to get this model to work on my AMD GPU, it's working.
So, maybe it'll be the same for you.
@knarp there's still an ongoing issue under my original issue which probably has to do with some bug under Vulkan, you can follow here: https://github.com/ggml-org/llama.cpp/issues/12946
@bartowski your gguf seems to all good, but I get a weird behavior:
For 32B Q4_K_M I can usually offload approx 16K tokens for 65 layers models (Qwen family). Here, it's not from the Qwen family, and only has 62 layers, also the gguf is arround 200MB less than Qwen's ones.
BUT I can offload up to 70K tokens!
Same for Z1 variant.
I'm running this through ollama and deleted the gguf before noticing it.
From what I tested so far with a 23K tokens research paper, I don't get OOM and it still manages to raw recopy the abstract!
Can you or anyone reproduce this? Because that feels a bit unexpected :D
Yes, the KV cache here is very thin, so you can run huge contexts with very little RAM, it's much less demanding than Qwen or even Llama in terms of context memory.
Thanks @CHNtentes but why only the second dim? Shouldn't the product of the 2 dims be more accurate?
I just noticed The Rumination variant has a radical x4 increase in the second dim [6 144, 1 024] compared to GLM-4 and the Z1 variant [6 144, 256]. That's interesting, but I was wondering if it is really intended because the rest is identical.


