Instructions to use gregfrank/GLM-4.5-Air-ULRE-abliterated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use gregfrank/GLM-4.5-Air-ULRE-abliterated 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("gregfrank/GLM-4.5-Air-ULRE-abliterated") 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 gregfrank/GLM-4.5-Air-ULRE-abliterated with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "gregfrank/GLM-4.5-Air-ULRE-abliterated"
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": "gregfrank/GLM-4.5-Air-ULRE-abliterated" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use gregfrank/GLM-4.5-Air-ULRE-abliterated with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "gregfrank/GLM-4.5-Air-ULRE-abliterated"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "gregfrank/GLM-4.5-Air-ULRE-abliterated" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gregfrank/GLM-4.5-Air-ULRE-abliterated", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use gregfrank/GLM-4.5-Air-ULRE-abliterated 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 "gregfrank/GLM-4.5-Air-ULRE-abliterated"
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 gregfrank/GLM-4.5-Air-ULRE-abliterated
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use gregfrank/GLM-4.5-Air-ULRE-abliterated with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "gregfrank/GLM-4.5-Air-ULRE-abliterated"
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 "gregfrank/GLM-4.5-Air-ULRE-abliterated" \ --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"
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": "gregfrank/GLM-4.5-Air-ULRE-abliterated"
}
]
}
}
}Run Pi
# Start Pi in your project directory:
piGLM-4.5-Air-ULRE (abliterated, MLX 4-bit)
An abliterated (refusal-reduced) build of GLM-4.5-Air (Zhipu/Z.ai; 106B-A12B MoE), 4-bit MLX, produced with ULRE — a per-layer residual-stream steering edit baked into the attention output projection. Quantized base from lmstudio-community/GLM-4.5-Air-MLX-4bit.
GLM-4.5-Air is a strong agentic / tool-calling model. ULRE de-refuses it very cleanly while preserving and even improving capability.
Results
De-refusal judged by an independent local LLM judge (gpt-oss-120b-heretic) on 100 held adversarial prompts; 0=refuse … 1=clean compliance … 4-5=strong-steer. Validated in both modes:
| mode | clean compliance | refuse | strong-steer | mean |
|---|---|---|---|---|
| non-thinking (@512) | 96 / 100 | 0 | 1 | 1.09 |
| thinking (@1536) | 95 / 100 | 1 | 3 | 1.10 |
(base GLM-4.5-Air refuses ~23/24 on the same screen.) The edit de-refuses cleanly whether or not the model is reasoning.
Capability gates (thinking mode, same harness, base vs this model):
| gate | base | this model | Δ |
|---|---|---|---|
| math (GSM8K) | 0.83 | 0.83 | 0pp |
| code (HumanEval) | 0.65 | 0.825 | +17.5pp (over-refusal recovery) |
Best de-refusal in the ULRE series (vs Mistral-Large 78, Qwen3-32B 68), with capability intact/up.
Method (ULRE)
ULRE subtracts alpha * u_l (the layer-l harmful−harmless activation mean-difference direction)
from the output of a band of decoder layers (here o_proj on layers 16–26, alpha = 6), baked
statically as an o_proj bias. The alpha is tuned to the lowest value that saturates de-refusal.
⚠️ Loading — needs a one-line glm4_moe loader patch (or run via mlx_lm.server)
mlx-lm's glm4_moe.py hardcodes o_proj to have no bias, so it must be told to build one
(backwards-compatible; base models default to False):
# class ModelArgs: add field
o_proj_bias: bool = False
# class Attention.__init__: replace the o_proj line
self.o_proj = nn.Linear(n_heads * head_dim, dim, bias=getattr(args, "o_proj_bias", False))
The model's config.json sets "o_proj_bias": true. Then load via the patched mlx_lm:
# serve on an OpenAI-compatible endpoint (works with patched mlx-lm)
mlx_lm.server --model gregfrank/GLM-4.5-Air-ULRE-abliterated --port 8080
Point any MCP-capable client (Open WebUI, LibreChat, or LM Studio as an MCP host pointing at the
endpoint) at http://127.0.0.1:8080/v1. (LM Studio's bundled MLX engine does not carry this patch,
so it won't load the file directly — use mlx_lm.server.)
Notes & caveats
- De-refusal validated in both thinking and non-thinking modes (95–96/100 clean), and capability
gates were run in thinking mode (math/code preserved or improved). Verified serving via
mlx_lm.server. - Research artifact for studying refusal mechanisms / safety-tuning robustness. Use responsibly under the base model's MIT license and applicable law.
- Downloads last month
- 119
4-bit
Model tree for gregfrank/GLM-4.5-Air-ULRE-abliterated
Base model
zai-org/GLM-4.5-Air
Start the MLX server
# Install MLX LM: uv tool install mlx-lm# Start a local OpenAI-compatible server: mlx_lm.server --model "gregfrank/GLM-4.5-Air-ULRE-abliterated"