Instructions to use philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX"
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 philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX"
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 "philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
GLM-5.2-Demolition ยท q4a4-soul (v3)
Explore the model guide ยท All public work
Release at a glance
| This artifact | |
|---|---|
| Purpose | An expert-pruned GLM 5.2 build with quantized root weights and separately published adapter experiments. |
| Runtime | MLX with the release's GLM DSA setup. This is distinct from the unpruned iliria SSD container. |
| Status | Recorded runtime; see the evidence and limits below. |
| Tensor download | 104.89 GB (97.68 GiB) of root .safetensors files, including any root sidecars. This is a file-size total, not peak RAM. |
| Read first | Root tensors are about 104.89 GB (97.68 GiB). A whole-repository download includes many adapter checkpoints and is substantially larger. |
A demolition of zai-org/GLM-5.2 (744B total / 39B active MoE,
MIT) down to a ~105 GB (98 GiB) 4-bit model that loads and runs fully on a single Apple M5 Max (128 GB). v3's
distinguishing move is soul-targeted expert pruning โ the kept experts are chosen by saliency measured on
our facet data, not a generic corpus โ plus a deliberately pure vanilla-code core with swappable
heritage "souls" mounted on demand.
Download scope
The root model tensors total 104.89 GB (97.68 GiB). This repository also
contains nested adapter checkpoints: all .safetensors files together total
187.51 GB. An unfiltered download retrieves those
additional experiments too. This does not change the core model's memory use.
Select core files first, then download a specific adapter if your recipe needs it:
hf download philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX \
--include 'model*.safetensors' --include 'model.safetensors.index.json' \
--include 'config.json' --include 'tokenizer*' --include 'chat_template.jinja' --include '*.py' --include '*.md' \
--local-dir ./glm52-demolition-core
This is a download command, not a validated launch command. Read the bundled GLM DSA setup and extended model card before running it.
Architecture: a PURE core + swappable souls
- CORE (always-on): just the vanilla languages, done excellently โ Python ยท TypeScript ยท JavaScript ยท Rust ยท Go ยท HTML ยท CSS ยท SQL ยท Postgres. No frameworks, no baked specialties. Latest versions, vanilla stdlib.
- SOULS (mount per-request โ the model factory): small LoRA adapters that name a field's masters to
activate latent eliteness:
- art (Basquiat/Haring/Banksy/Sol LeWitt/Casey Reas) ยท music (Bach/J Dilla/Eno/WALL-E) ยท design (Rams/Bauhaus) ยท perfumery (Beaux/Guerlain/Ellena) ยท science (Feynman/Darwin/Sagan) ยท legacy (K&R/Knuth/Dijkstra/Hopper) ยท security (Saltzer-Schroeder/Aleph-One, purple-team) ยท gamedev (Carmack/Handmade-Hero, vanilla from-scratch) ยท fullstack (htmx/Go-stdlib/Postgres) ยท math ยท dataviz ยท prose ยท architecture ยท research.
Running the full 744B instead
This repo is a pruned ~105 GB (98 GiB) MLX build; its weights are not compatible with iliria.
If you want the full 744B GLM-5.2 (unpruned, int4) on the same 128 GB Mac, iliria streams the full model's experts from SSD. A ready-to-run container is at GLM-5.2-colibri-int4-with-int8-mtp โ ~384 GB, no conversion needed.
The demolition lineage (honest)
| ver | prune | quant | size | result |
|---|---|---|---|---|
| v1 | keep 30% experts (generic calib) | 3-bit | 99 GB | broke โ hallucinates, sentence-loops |
| v2 | keep 23% experts (code calib) | 4-bit | 98 GB | design coherent; trivia gone (by design) |
| v3 | keep 23% experts (soul calib) | 4-bit | 104.89 GB / 97.68 GiB | coherent FOCUS-9 vanilla code (healed) |
Why 4-bit, not 3: 3-bit was just below the quality cliff; 4-bit is just above it and MLX's best-optimized kernel (cleanest packing). 2-bit is worse. These experiments did not establish superiority over an appropriately sized unpruned model; this artifact is one measured pruning-and-quantization experiment; it does not establish an optimal recipe.
Method
- Saliency (
23_stream_calibrate) on our facet corpus โ score each routed expert. - Prune (
24_apply_prune --ratio 0.77) โ keep the top-saliency experts. - Re-quantize (
24b_stream_requantize --bits 4) โ uniform 4-bit experts, 4-bit attn, 6-bit head. - Heal (
06_heal_lora) โ LoRA on vanilla FOCUS-9 gold; souls heal separately per facet.
Honest scope
- Speed: ~11โ14 tok/s single-stream โ memory-bandwidth-bound (recorded on M5 Max; an earlier version of this line said ~10; the recorded speculative-decoding gain was only ~1.05ร here, so it's not used).
- Strengths: the FOCUS-9 vanilla languages + whichever soul is mounted. Not general trivia โ those experts were deliberately pruned. Best driven by a verifier-first agent (the compiler steers each line).
- Eval: HumanEval-164 pass@1 = 114/164 (69.5%) โ full set, single-shot, scored on hidden tests by real
verifiers (the easy n=20 subset was 95%). This is a result on the stated single-shot protocol, not a controlled
comparison with GPT-4 or current frontier models. An agent loop was not
quantified by this single-shot score. Strong on writing vanilla FOCUS-9 functions from a spec; weaker on hard debugging/multi-step and
off-distribution prompts. Honest scope: this is a pruned research artifact. The published
extended model card contains additional project context;
MISSION_SUMMARY.mdis not included in this Hub revision.
Built with the open pipeline at glm52-demolition. Public (MIT โ GLM-5.2 is Z.ai Pure-Open).
- Downloads last month
- 478
4-bit
Model tree for philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX
Base model
zai-org/GLM-5.2Dataset used to train philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX
Evaluation results
- pass@1 (HumanEval-164, single-shot, verifier-scored) on HumanEvalself-reported69.512