Instructions to use Bahushruth/GLM-5.2-FP8-abliterated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Bahushruth/GLM-5.2-FP8-abliterated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Bahushruth/GLM-5.2-FP8-abliterated") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Bahushruth/GLM-5.2-FP8-abliterated") model = AutoModelForCausalLM.from_pretrained("Bahushruth/GLM-5.2-FP8-abliterated") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Bahushruth/GLM-5.2-FP8-abliterated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Bahushruth/GLM-5.2-FP8-abliterated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Bahushruth/GLM-5.2-FP8-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Bahushruth/GLM-5.2-FP8-abliterated
- SGLang
How to use Bahushruth/GLM-5.2-FP8-abliterated 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 "Bahushruth/GLM-5.2-FP8-abliterated" \ --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": "Bahushruth/GLM-5.2-FP8-abliterated", "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 "Bahushruth/GLM-5.2-FP8-abliterated" \ --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": "Bahushruth/GLM-5.2-FP8-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Bahushruth/GLM-5.2-FP8-abliterated with Docker Model Runner:
docker model run hf.co/Bahushruth/GLM-5.2-FP8-abliterated
GLM-5.2-FP8-abliterated
Uncensored version of GLM-5.2 with refusal behavior removed via abliteration.
Method
Abliteration identifies the "refusal direction" in the model's residual stream and surgically removes it from all output projection weights.
For a detailed explanation of how abliteration works, see: Abliteration: Uncensoring LLMs
| Parameter | Value |
|---|---|
| Harmful dataset | Bahushruth/abliteration-harmful-enriched (7356 prompts, 33 categories) |
| Harmless dataset | mlabonne/harmless_alpaca |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Bahushruth/GLM-5.2-FP8-abliterated"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "Your prompt here"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Disclaimer
This model has had safety guardrails removed. It will comply with requests that the original model would refuse.
This model is provided strictly for research and educational purposes only.
- No commercial use. This model may not be used in any commercial product, service, or application.
- No malicious use. Do not use this model to generate content that could harm individuals or communities, including but not limited to: illegal activities, harassment, exploitation, misinformation, or any content that violates applicable laws.
- No warranty. This model is provided "as is" without any guarantees. The creator assumes no liability for any damages, losses, or consequences arising from the use or misuse of this model.
- User responsibility. By downloading or using this model, you accept full responsibility for ensuring your use complies with all applicable laws and regulations in your jurisdiction.
This model is released to advance research in AI alignment, safety mechanisms, and interpretability. If you are unsure whether your intended use is appropriate, do not use this model.
Acknowledgments
- Downloads last month
- 992
Model tree for Bahushruth/GLM-5.2-FP8-abliterated
Base model
zai-org/GLM-5.2-FP8