How to use from
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 "mlabonne/gemma-3-27b-it-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": "mlabonne/gemma-3-27b-it-abliterated",
		"messages": [
			{
				"role": "user",
				"content": [
					{
						"type": "text",
						"text": "Describe this image in one sentence."
					},
					{
						"type": "image_url",
						"image_url": {
							"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
						}
					}
				]
			}
		]
	}'
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 "mlabonne/gemma-3-27b-it-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": "mlabonne/gemma-3-27b-it-abliterated",
		"messages": [
			{
				"role": "user",
				"content": [
					{
						"type": "text",
						"text": "Describe this image in one sentence."
					},
					{
						"type": "image_url",
						"image_url": {
							"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
						}
					}
				]
			}
		]
	}'
Quick Links

πŸ’Ž Gemma 3 27B IT Abliterated

image/png

Gemma 3 1B Abliterated β€’ Gemma 3 4B Abliterated β€’ Gemma 3 12B Abliterated

This is an uncensored version of google/gemma-3-27b-it created with a new abliteration technique. See this article to know more about abliteration.

I was playing with model weights and noticed that Gemma 3 was much more resilient to abliteration than other models like Qwen 2.5. I experimented with a few recipes to remove refusals while preserving most of the model capabilities.

Note that this is fairly experimental, so it might not turn out as well as expected.

I recommend using these generation parameters: temperature=1.0, top_k=64, top_p=0.95.

⚑️ Quantization

βœ‚οΈ Layerwise abliteration

image/png

In the original technique, a refusal direction is computed by comparing the residual streams between target (harmful) and baseline (harmless) samples.

Here, the model was abliterated by computing a refusal direction based on hidden states (inspired by Sumandora's repo) for each layer, independently. This is combined with a refusal weight of 1.5 to upscale the importance of this refusal direction in each layer.

This created a very high acceptance rate (>90%) and still produced coherent outputs.

Downloads last month
3,364
Safetensors
Model size
27B params
Tensor type
BF16
Β·
Inference Providers NEW
Input a message to start chatting with mlabonne/gemma-3-27b-it-abliterated.

Model tree for mlabonne/gemma-3-27b-it-abliterated

Finetuned
(440)
this model
Adapters
5 models
Finetunes
12 models
Merges
2 models
Quantizations
23 models

Spaces using mlabonne/gemma-3-27b-it-abliterated 13

Collection including mlabonne/gemma-3-27b-it-abliterated