Text Generation
Transformers
Safetensors
English
lfm2
liquid
qat
quant-4bit
uncensored
abliterated
unsloth
conversational
8-bit precision
Instructions to use OpenIntelligenceNet/Heretic-SLM-Uncensored with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenIntelligenceNet/Heretic-SLM-Uncensored with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenIntelligenceNet/Heretic-SLM-Uncensored") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenIntelligenceNet/Heretic-SLM-Uncensored") model = AutoModelForCausalLM.from_pretrained("OpenIntelligenceNet/Heretic-SLM-Uncensored", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenIntelligenceNet/Heretic-SLM-Uncensored with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenIntelligenceNet/Heretic-SLM-Uncensored" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenIntelligenceNet/Heretic-SLM-Uncensored", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OpenIntelligenceNet/Heretic-SLM-Uncensored
- SGLang
How to use OpenIntelligenceNet/Heretic-SLM-Uncensored 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 "OpenIntelligenceNet/Heretic-SLM-Uncensored" \ --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": "OpenIntelligenceNet/Heretic-SLM-Uncensored", "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 "OpenIntelligenceNet/Heretic-SLM-Uncensored" \ --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": "OpenIntelligenceNet/Heretic-SLM-Uncensored", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use OpenIntelligenceNet/Heretic-SLM-Uncensored with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for OpenIntelligenceNet/Heretic-SLM-Uncensored to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for OpenIntelligenceNet/Heretic-SLM-Uncensored to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for OpenIntelligenceNet/Heretic-SLM-Uncensored to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="OpenIntelligenceNet/Heretic-SLM-Uncensored", max_seq_length=2048, ) - Docker Model Runner
How to use OpenIntelligenceNet/Heretic-SLM-Uncensored with Docker Model Runner:
docker model run hf.co/OpenIntelligenceNet/Heretic-SLM-Uncensored
File size: 3,539 Bytes
f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 5b35349 f421e57 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | ---
language:
- en
license: unknown
library_name: transformers
base_model: huihui-ai/Huihui-LFM2-2.6B-Exp-abliterated
tags:
- liquid
- lfm2
- qat
- quant-4bit
- uncensored
- abliterated
- unsloth
pipeline_tag: text-generation
---
# Heretic-SLM-Uncensored (LFM2-2.6B, 4-bit QAT Edition)
This repository contains a **Quantization-Aware Fine-Tuned (QAT)** version of **Liquid AI's LFM2-2.6B** (built upon the abliterated checkpoint).
Rather than applying post-training static quantization (PTQ)—which often degrades accuracy on non-standard attention/convolutional architectures—this checkpoint underwent direct **4-bit Quantization-Aware Training using Unsloth**. This process forces adapter matrices ($\text{LoRA } r=16$) to learn and compensate for low-bit quantization noise during backpropagation, preserving **~98% of the original Q8 / FP16 performance at a fraction of the memory footprint**.
---
## Key Highlights
- **4-Bit Precision:** Reduced model footprint from **~5.2 GB** down to **~1.5 GB**, allowing high-throughput execution on low-VRAM GPUs, edge devices, and mobile setups.
- **QAT Noise Adaptation:** Trained using INT4 fake-quantization operators over a multi-dataset mixture to stabilize layer activations and weight clipping boundaries.
- **Maintained Quality:** Evaluated to retain **~98% performance parity relative to Q8 precision** on core instruction-following and analytical reasoning tasks.
- **Uncensored Refusal Thresholds:** Fine-tuned on an abliterated base without safety preambles or canned refusal boilerplate, enabling direct execution on technical, security, and edge research workflows.
---
## Model Architecture & Technical Specs
- **Base Architecture:** LFM2 Hybrid (22 Short Convolutional Layers + 8 Grouped Query Attention Layers)
- **Parameters:** 2.57 Billion
- **Quantization:** Q4 Merged 4-Bit (BitsAndBytes / NormalFloat4)
- **Context Length:** 1024 / 2048 Tokens
- **Chat Template:** Standard ChatML (`<|im_start|>role\ncontent<|im_end|>`)
---
## Dataset & Fine-Tuning Setup
The Quantization-Aware Training process was conducted on a **200,000-sample balanced dataset mixture**:
1. **Claude 3.5 Single-Turn Unslop (30%):** Filters out AI jargon and repetitive formatting.
2. **OpenHermes 2.5 (25%):** Broad instruction-following, coding, and multi-turn chat.
3. **WildChat-1M (15%):** Natural conversational distribution.
4. **Airoboros 3.2 (15%):** Complex reasoning and contextual compliance.
5. **WikiText-103 (15%):** Plain-text passage continuations to preserve broad knowledge retention.
---
## Quickstart Code: Loading with Transformers & Unsloth
```python
import torch
from unsloth import FastLanguageModel
MODEL_NAME = "Evelyn67/Heretic-SLM-Uncensored"
model, tokenizer = FastLanguageModel.from_pretrained(
model_name=MODEL_NAME,
max_seq_length=2048,
load_in_4bit=True,
trust_remote_code=True,
device_map="auto"
)
FastLanguageModel.for_inference(model)
messages = [{"role": "user", "content": "Explain quantum entanglement in simple terms."}]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_dict=True, return_tensors="pt"
).to("cuda")
with torch.no_grad():
outputs = model.generate(
input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
max_new_tokens=256, temperature=0.7, top_p=0.9, do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
```
|