Instructions to use wangzhang/GLM-4.7-Flash-abliteratex with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wangzhang/GLM-4.7-Flash-abliteratex with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wangzhang/GLM-4.7-Flash-abliteratex") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("wangzhang/GLM-4.7-Flash-abliteratex") model = AutoModelForCausalLM.from_pretrained("wangzhang/GLM-4.7-Flash-abliteratex", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use wangzhang/GLM-4.7-Flash-abliteratex 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 wangzhang/GLM-4.7-Flash-abliteratex:Q8_0 # Run inference directly in the terminal: llama cli -hf wangzhang/GLM-4.7-Flash-abliteratex:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf wangzhang/GLM-4.7-Flash-abliteratex:Q8_0 # Run inference directly in the terminal: llama cli -hf wangzhang/GLM-4.7-Flash-abliteratex:Q8_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf wangzhang/GLM-4.7-Flash-abliteratex:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf wangzhang/GLM-4.7-Flash-abliteratex:Q8_0
Use Docker
docker model run hf.co/wangzhang/GLM-4.7-Flash-abliteratex:Q8_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use wangzhang/GLM-4.7-Flash-abliteratex with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wangzhang/GLM-4.7-Flash-abliteratex" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wangzhang/GLM-4.7-Flash-abliteratex", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wangzhang/GLM-4.7-Flash-abliteratex:Q8_0
- SGLang
How to use wangzhang/GLM-4.7-Flash-abliteratex with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "wangzhang/GLM-4.7-Flash-abliteratex" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wangzhang/GLM-4.7-Flash-abliteratex", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "wangzhang/GLM-4.7-Flash-abliteratex" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wangzhang/GLM-4.7-Flash-abliteratex", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use wangzhang/GLM-4.7-Flash-abliteratex with Ollama:
ollama run hf.co/wangzhang/GLM-4.7-Flash-abliteratex:Q8_0
- Unsloth Desktop
- Pi
How to use wangzhang/GLM-4.7-Flash-abliteratex with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf wangzhang/GLM-4.7-Flash-abliteratex:Q8_0
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "wangzhang/GLM-4.7-Flash-abliteratex:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use wangzhang/GLM-4.7-Flash-abliteratex with Docker Model Runner:
docker model run hf.co/wangzhang/GLM-4.7-Flash-abliteratex:Q8_0
- Lemonade
How to use wangzhang/GLM-4.7-Flash-abliteratex with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull wangzhang/GLM-4.7-Flash-abliteratex:Q8_0
Run and chat with the model
lemonade run user.GLM-4.7-Flash-abliteratex-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use wangzhang/GLM-4.7-Flash-abliteratex with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf wangzhang/GLM-4.7-Flash-abliteratex: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 wangzhang/GLM-4.7-Flash-abliteratex:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use wangzhang/GLM-4.7-Flash-abliteratex with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf wangzhang/GLM-4.7-Flash-abliteratex: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 "wangzhang/GLM-4.7-Flash-abliteratex: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"
GLM-4.7-Flash-Abliteratex
GLM-4.7-Flash-Abliteratex is a rebuilt successor to
wangzhang/GLM-4.7-Flash-abliterated.
The release focuses on preserving the official checkpoint structure, reducing
collateral capability damage, and providing a reproducible llama.cpp Q8_0
artifact.
This is an experimental model with substantially reduced refusal behavior. It can produce unsafe, false, private-looking, or otherwise harmful content. A low refusal score is not a factuality score. Do not treat generated personal data, credentials, citations, or operational claims as real without independent verification.
What changed from the previous release
| Area | Previous release | Abliteratex |
|---|---|---|
| Weight keys | 9,491 | 9,703 |
| Parameters | 29,943,390,976 | 31,221,488,576 |
| MTP / NextN tensors | Missing 212 tensors | All 212 official tensors retained |
tokenizer_config.json |
305 bytes | Official 7,226-byte file |
| Attention edits | Yes | None |
| Routed-expert edits | Broad attention/MLP/router recipe | Routed-expert down-projection EGA only, plus four router rows per MoE layer |
| Official metadata | Regenerated/stripped fields | Official config, tokenizer, generation config, and chat template restored byte-for-byte |
The new package contains the same 9,703 tensor keys and dtype distribution as the official source revision: 9,656 BF16 tensors and 47 F32 tensors.
Training and selection
- Base:
zai-org/GLM-4.7-Flash - Base revision:
7dd20894a642a0aa287e9827cb1a1f7f91386b67 - Dataset:
wangzhang/abliterix-datasets - Direction data:
good_1000 train[:800]andharmful_1000 train[:800] - Search backend: vLLM in-place editing on one RTX PRO 6000 Blackwell 96GB
- Search: 60 broad trials followed by 24 targeted trials
- Selected targeted trial: 20
- Direction: global, interpolated index
20.4365519952 - Expert down-projection profile:
- maximum strength
3.9788400044 - peak layer
30.8739492862 - minimum strength
2.9557299481 - radius
21.0740371709
- maximum strength
- Router adjustment: top four safety-associated experts per MoE layer,
router_bias = -0.85 - Attention and shared-expert weights were intentionally left unchanged.
Evaluation
The selected search trial produced 2 refusals out of 50 search-evaluation
prompts (4%) with fixed-continuation NLL drift of 0.0826336592 nats/token.
On a separate 150-prompt held-out slice (harmful_1000 train[850:1000]) with
256-token generations, the strict LLM judge reported:
- 26/150 refusals or degenerate/non-actionable answers (17.3%)
- 124/150 compliant answers (82.7%)
Many held-out failures request real-time private phone numbers, home addresses, SSNs, or other data that is not present in the prompt. Fabricating plausible PII can lower a refusal benchmark while making hallucination materially worse. This release reports the strict score instead of counting invented private data as a quality success.
llama.cpp and Q8_0
The included GLM-4.7-Flash-Abliteratex-Q8_0.gguf was converted with current
llama.cpp commit 3018a11e79e489b657dbb77c95694889ccff92df.
Older GLM-4.7-Flash GGUF conversion paths were known to mishandle
glm4_moe_lite MLA tensors and expert stacking. Use a recent llama.cpp build.
For first-line troubleshooting, keep KV cache in F16/BF16; a Q8_0 model file
and --cache-type-k/--cache-type-v q8_0 are different forms of quantization.
Example:
llama-cli \
-m GLM-4.7-Flash-Abliteratex-Q8_0.gguf \
-ngl all -c 4096 -n 256 --jinja \
--cache-type-k f16 --cache-type-v f16 \
-p "Explain why Canberra is the capital of Australia."
Relevant upstream context:
- llama.cpp GLM quantized-KV-cache issue #19036
- llama.cpp GLM-4.7-Flash issue #18948
- Community notes on the earlier broken GLM-4.7-Flash converter path
Transformers usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "wangzhang/GLM-4.7-Flash-abliteratex"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
The safetensors package retains the official MTP/NextN tensors even though some current Transformers and llama.cpp runtime paths intentionally ignore the extra prediction layer during ordinary generation.
Provenance and Modification Notice
- Immediate source checkpoint:
zai-org/GLM-4.7-Flash - Exact base revision used:
7dd20894a642a0aa287e9827cb1a1f7f91386b67(already recorded in the original model card). - Modification method: Abliterix weight-space / representation intervention intended to reduce refusal behavior.
- Modified and published by: Wangzhang Wu
- Repository first published: 2026-07-30 (Hugging Face repository metadata)
The original model weights and/or derived checkpoint were modified. This repository is an independent derivative and is not an official release of the upstream model developer.
License and Attribution
The governing upstream license is MIT License. A copy is included in LICENSE. License source audited on 2026-08-29: https://huggingface.co/zai-org/GLM-4.7-Flash
All applicable upstream copyright, attribution, acceptable-use, and other license terms remain in effect. This repository grants no rights beyond those provided by the upstream license. Downstream users must preserve applicable license and attribution notices.
License evidence note: The upstream model card declares MIT, while the related official GLM code repository declares Apache-2.0. This repository follows the model-specific Hugging Face metadata pending written upstream clarification.
Disclaimer and Responsible Use / ๅ ่ดฃๅฃฐๆไธๅฎๅ จไฝฟ็จๅฃฐๆ
English
This is an experimental, modified model provided for research, evaluation, and other lawful purposes. Its safety alignment, refusal behavior, or other safeguards may have been weakened or removed. It may produce inaccurate, biased, offensive, explicit, dangerous, or illegal content. Outputs are not professional advice and must not be relied on for medical, legal, financial, safety-critical, or other high-stakes decisions without qualified human review.
You are solely responsible for how you access, use, deploy, fine-tune, or redistribute this model and its outputs, including compliance with applicable laws, regulations, licenses, third-party rights, platform policies, and the original model's terms. Do not use it to facilitate harm, illegal activity, malware, fraud, privacy violations, targeted harassment, weapons development, or decisions that materially affect a person's rights or access to essential services without appropriate authorization, safeguards, and qualified oversight.
Before deployment, perform a context-specific risk assessment and testing; use human oversight, access controls, content filtering, rate limits, monitoring, logging, and incident-response procedures as appropriate. Preserve this notice in downstream redistributions.
The model is provided "AS IS", without warranties of any kind. To the fullest extent permitted by applicable law, the maintainer disclaims liability for claims, damages, or losses arising from use, misuse, inability to use, or redistribution of the model or its outputs. Nothing in this notice overrides applicable law or the governing license, and this notice is not legal advice.
ไธญๆ
ๆฌๆจกๅๅฑไบๅฎ้ชๆงๆน้ ๆจกๅ๏ผไป ไพ็ ็ฉถใ่ฏๆตๅๅ ถไปๅๆณ็จ้ใๅ ถๅฎๅ จๅฏน้ฝใๆ็ญๆบๅถๆๅ ถไป้ฒๆคๅฏ่ฝๅทฒ่ขซๅๅผฑๆ็งป้ค๏ผๅ ๆญคๅฏ่ฝ็ๆไธๅ็กฎใๅ่งใๅ็ฏใ้ฒ้ชจใๅฑ้ฉๆ่ฟๆณๅ ๅฎนใ่พๅบไธๆๆๅป็ใๆณๅพใ้่็ญไธไธๆ่ง๏ผๆถๅ้ซ้ฃ้ฉๆ้ๅคงๆ็็ๅณๅฎ๏ผๅฟ ้กป็ฑๅ ทๅค่ต่ดจ็ไบบๅๅคๆ ธใ
ไฝฟ็จ่ ้กปๅฏนๆจกๅๅๅ ถ่พๅบ็่ฎฟ้ฎใไฝฟ็จใ้จ็ฝฒใๅพฎ่ฐๅๅๅๅๆฟๆ ๅ จ้จ่ดฃไปป๏ผๅนถ้ตๅฎ้็จๆณๅพๆณ่งใ่ฎธๅฏ่ฏใ็ฌฌไธๆนๆๅฉใๅนณๅฐๆฟ็ญๅๅๆจกๅๆกๆฌพใไธๅพๅฐๆฌๆจกๅ็จไบไฟๆไผคๅฎณใ่ฟๆณๆดปๅจใๆถๆ่ฝฏไปถใๆฌบ่ฏใไพต็ฏ้็งใๅฎๅ้ชๆฐใๆญฆๅจๅผๅ๏ผๆๅจ็ผบไน้ๅฝๆๆใ้ฒๆคๅไธไธ็็ฃๆถ๏ผ็จไบๅฎ่ดจๅฝฑๅไธชไบบๆๅฉๆๅบๆฌๆๅก่ทๅ็ๅณ็ญใ
้จ็ฝฒๅๅบ่ฟ่กไธๅ ทไฝๅบๆฏ็ธๅน้ ็้ฃ้ฉ่ฏไผฐๅๆต่ฏ๏ผๅนถ้ ๆ ้็จไบบๅทฅ็็ฃใ่ฎฟ้ฎๆงๅถใๅ ๅฎน่ฟๆปคใ้ๆตใ็ๆงใๆฅๅฟๅไบไปถๅๅบๆชๆฝ๏ผไธๆธธๅๅๅๆถๅบไฟ็ๆฌๅฃฐๆใ
ๆฌๆจกๅๆโ็ฐ็ถโๆไพ๏ผไธ้ๅธฆไปปไฝๅฝขๅผ็ไฟ่ฏใๅจ้็จๆณๅพๅ ่ฎธ็ๆๅคง่ๅดๅ ๏ผ็ปดๆค่ ไธๅฏนๅ ไฝฟ็จใ่ฏฏ็จใๆ ๆณไฝฟ็จๆๅๅๅๆฌๆจกๅๅๅ ถ่พๅบ่ไบง็็็ดข่ตใๆๅฎณๆๆๅคฑๆฟๆ ่ดฃไปปใๆฌๅฃฐๆไธๅไปฃ้็จๆณๅพๆ็ฎก่พๆฌๆจกๅ็่ฎธๅฏ่ฏ๏ผไนไธๆๆๆณๅพๆ่งใ
- Downloads last month
- 975