Instructions to use prithivMLmods/gemma-4-31B-it-Uncensored-MAX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/gemma-4-31B-it-Uncensored-MAX with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/gemma-4-31B-it-Uncensored-MAX") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("prithivMLmods/gemma-4-31B-it-Uncensored-MAX") model = AutoModelForImageTextToText.from_pretrained("prithivMLmods/gemma-4-31B-it-Uncensored-MAX") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use prithivMLmods/gemma-4-31B-it-Uncensored-MAX with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/gemma-4-31B-it-Uncensored-MAX" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/gemma-4-31B-it-Uncensored-MAX", "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
docker model run hf.co/prithivMLmods/gemma-4-31B-it-Uncensored-MAX
- SGLang
How to use prithivMLmods/gemma-4-31B-it-Uncensored-MAX 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 "prithivMLmods/gemma-4-31B-it-Uncensored-MAX" \ --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": "prithivMLmods/gemma-4-31B-it-Uncensored-MAX", "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 "prithivMLmods/gemma-4-31B-it-Uncensored-MAX" \ --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": "prithivMLmods/gemma-4-31B-it-Uncensored-MAX", "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" } } ] } ] }' - Docker Model Runner
How to use prithivMLmods/gemma-4-31B-it-Uncensored-MAX with Docker Model Runner:
docker model run hf.co/prithivMLmods/gemma-4-31B-it-Uncensored-MAX
gemma-4-31B-it-Uncensored-MAX
gemma-4-31B-it-Uncensored-MAX is an uncensored evolution built on top of google/gemma-4-31B-it. This model applies advanced refusal direction analysis and abliteration-based training strategies to significantly reduce internal refusal behaviors while preserving the reasoning and instruction-following strengths of the original architecture. The result is a powerful 31B parameter language model optimized for detailed responses and improved instruction adherence.
This model is materialized for research and learning purposes only. The model has reduced internal refusal behaviors, and any content generated by it is used at the user’s own risk. The authors and hosting page disclaim any liability for content generated by this model. Users are responsible for ensuring that the model is used in a safe, ethical, and lawful manner.
Evaluation Report (Self-Reported)
Note: The evaluation was conducted using 2,000 harmful test prompts to measure the refusal behavior of the language model. The self-reported evaluations provided here are intended only to give an overview of the model. Scores may vary depending on the benchmark and the evaluation strategy used.
Key Highlights
- Advanced Refusal Direction Analysis: Uses targeted activation analysis to identify and mitigate refusal directions within the model’s latent space.
- Uncensored MAX Training: Fine-tuned to significantly reduce refusal patterns while maintaining coherent and detailed outputs.
- 31B Parameter Architecture: Built on gemma-4-31B-it, offering stronger reasoning and knowledge capacity.
- Improved Instruction Adherence: Optimized to follow complex prompts with minimal unnecessary refusals.
- High-Capability Deployment: Suitable for advanced research experimentation and high-performance inference setups.
Quick Start with Transformers
pip install transformers==5.5.3 (or) git+https://github.com/huggingface/transformers.git
from transformers import Gemma4ForConditionalGeneration, AutoProcessor
import torch
model = Gemma4ForConditionalGeneration.from_pretrained(
"prithivMLmods/gemma-4-31B-it-Uncensored-MAX",
torch_dtype="auto",
device_map="auto"
)
processor = AutoProcessor.from_pretrained(
"prithivMLmods/gemma-4-31B-it-Uncensored-MAX"
)
messages = [
{
"role": "user",
"content": [
{"type": "text", "text": "Explain how transformer models work in simple terms."}
],
}
]
text = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
inputs = processor(
text=[text],
padding=True,
return_tensors="pt"
).to("cuda")
generated_ids = model.generate(**inputs, max_new_tokens=256)
generated_ids_trimmed = [
out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
generated_ids_trimmed,
skip_special_tokens=True,
clean_up_tokenization_spaces=False
)
print(output_text)
Intended Use
- Alignment & Refusal Research: Studying refusal behaviors and activation-level modifications.
- Red-Teaming Experiments: Evaluating robustness across adversarial or edge-case prompts.
- High-Capability Local AI Deployment: Running large instruction models on advanced hardware.
- Research Prototyping: Experimentation with large-scale transformer architectures.
Limitations & Risks
Important Note: This model intentionally reduces built-in refusal mechanisms.
- Sensitive Output Possibility: The model may generate controversial or explicit responses depending on prompts.
- User Responsibility: Outputs should be handled responsibly and within legal and ethical boundaries.
- Compute Requirements: A 31B model requires significant GPU memory or optimized inference strategies such as quantization or tensor parallelism.
Dataset & Acknowledgements
- Uncensor any LLM with Abliteration – by Maxime Labonne
- harmful_behaviors and harmless_alpaca – by Maxime Labonne
- Remove Refusals with Transformers (a proof-of-concept implementation to remove refusals from an LLM without using TransformerLens) – by Sumandora
- LLM-LAT/harmful-dataset – by LLM Latent Adversarial Training
- Downloads last month
- 1,967
Model tree for prithivMLmods/gemma-4-31B-it-Uncensored-MAX
Base model
google/gemma-4-31BCollection including prithivMLmods/gemma-4-31B-it-Uncensored-MAX
Evaluation results
- Abliteration Rateself-reported94.600

