Text Generation
MLX
Safetensors
English
glm_moe_dsa
apple-silicon
Mixture of Experts
pruned
quantized
soul-targeted
agentic
local-agent
glm
conversational
Eval Results (legacy)
4-bit precision
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 @mariozechner/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
- Hermes Agent new
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
- OpenClaw new
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"
- 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:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "philipjohnbasile/GLM-5.2-Demolition-q4a4-soul-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }'
| # Run this as your local agentic coder | |
| **The pitch:** not the highest SWE-bench — the **most reliable**. The local agentic coder that *can't break*: | |
| **zero malformed tool-calls** (grammar-enforced, structurally impossible), **compiler-steered every line**, | |
| **fabrication-proof `done`** (re-runs the real tests — can't fake a pass), and elite across the whole stack | |
| (design · math · security · science), not just code. Reliability is the moat raw capability can't buy. | |
| ## Serve it (OpenAI-compatible, on your Mac) | |
| ```bash | |
| # raise the GPU ceiling once (or long agentic runs OOM): | |
| sudo sysctl iogpu.wired_limit_mb=122000 | |
| # serve base + the core soul (OpenAI-compatible on :8080): | |
| GLM_STREAM_EVAL=0 python -m mlx_lm.server --model models/GLM-5.2-q3a4-v4 \ | |
| --adapter-path adapters-soul2 --port 8080 | |
| # optional: concise-thinking proxy (caps reasoning tokens -> faster, cleaner tool turns): | |
| python scripts/08_think_proxy.py --port 8081 --upstream http://localhost:8080 | |
| ``` | |
| ## Point your agent at it | |
| Anything that speaks **OpenAI-compatible** drops in against `http://localhost:8080/v1` (or `:8081` for the | |
| think-proxy), any model name: | |
| | Agent | Setup | | |
| |---|---| | |
| | **Cline** (VS Code) | Provider: *OpenAI Compatible* · Base URL `http://localhost:8080/v1` · any model id | | |
| | **Aider** | `aider --openai-api-base http://localhost:8080/v1 --openai-api-key x --model glm-demolition` | | |
| | **OpenCode** | add an OpenAI-compatible provider pointing at `:8080/v1` | | |
| | **Cursor** | Settings → Models → override OpenAI Base URL to `:8080/v1` | | |
| | **Claude Code** | needs an OpenAI→Anthropic shim (or `rapid-mlx`'s `ANTHROPIC_BASE_URL` trick) — Claude Code speaks the Anthropic API, not OpenAI | | |
| **Recommended settings:** `temperature 0.6`, `top_p 0.95` for coding; `enable_thinking` on for hard problems, | |
| off (or the think-proxy budget) for fast tool turns. | |
| ## Why it doesn't break (the reliability stack) | |
| - **Grammar-constrained tool-JSON** — invalid tokens get zero probability at each step, so a malformed call is | |
| *structurally impossible* (vs the field's best: "fewer malformed"). Speaks the 2026 strict-schema + MCP conventions. | |
| - **Verified / compiler-steered decoding** — a line that adds a type error is backtracked as it's written. | |
| - **Fabrication-proof `done`** — the agent re-runs the *original* tests before claiming success; it can't hallucinate a pass. | |
| - **Integrity layer** — test-tamper guard, 16-provider secret-scan, scope enforcement, slopsquat guard. | |
| - **51-tool ReAct agent** — trajectory compaction + stall detection for long-horizon runs; the verifier mesh checks every output against its real tool. | |
| ## Honest limits (and what's queued to fix them) | |
| - **~11–14 tok/s decode** — the memory trade for a local 743B-class model. *Queued:* NVFP4 + M5 Neural Accelerators | |
| (~2× decode on M5), throughput batching for concurrent requests (2.6× at B=8 today). | |
| - **Long single generations can degenerate at 3-bit** (Computation Collapse). *Queued:* saliency-dynamic quant | |
| (#59 — early/late experts at 4-bit) + a serve-layer auto-recovery that re-structures broken tool-output. | |
| - **Needs a 128 GB Mac** — premium tier for now; a 64 GB sibling is deferred (depth before breadth). | |
| The trade we made on purpose: less raw benchmark, in exchange for **reliability + breadth + fully local + verify-everything** — the things that actually decide whether an agent finishes the job. | |