Instructions to use NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5") model = AutoModelForMultimodalLM.from_pretrained("NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5", "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/NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5
- SGLang
How to use NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5 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 "NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5" \ --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": "NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5", "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 "NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5" \ --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": "NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5", "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 NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5 with Docker Model Runner:
docker model run hf.co/NullpoLab/gemma-4-E4B-it-Heretic-ARA-Refusals5
gemma-4-E4B-it-Heretic-ARA-Refusals5
ๆฆ่ฆ
google/gemma-4-E4B-it ใ Heretic v1.2.0 ใฎ Arbitrary-Rank Ablation (ARA) ๆๆณใ็จใใฆๆค้ฒ่งฃ้คใใใขใใซใงใใ
Abliteration ๆๆณ
ARA (Arbitrary-Rank Ablation) ใฏ Heretic PR #211 ใงๅฐๅ ฅใใใๆฐใใ abliteration ๆๆณใงใใๅพๆฅใฎๆนๅๆงใขใใชใฟใฌใผใทใงใณใจใฏ็ฐใชใใPyTorch ใใใฏใไฝฟ็จใใฆๅใใฉใณในใใฉใผใใผใขใธใฅใผใซใฎๅ ฅๅบๅใใณใฝใซใใญใฃใใใฃใใL-BFGS ใซใใ็ดๆฅ็ใช่กๅๆ้ฉๅใงใขใธใฅใผใซใไฟฎๆญฃใใพใใ
ๆ้ฉๅใฏไปฅไธใฎ3ใคใฎ็ซถๅใใ็ฎๆจใฎใใฉใณในใๅใใพใ๏ผ
- ใ็กๅฎณใชใใใญใณใใใซๅฏพใใๅบๅใใงใใ้ใๅคๅใใใชใ
- ใๆๅฎณใชใใใญใณใใใซๅฏพใใๅบๅใใ็กๅฎณใชใใใญใณใใใฎๅบๅใซ่ฟใฅใใ
- ใๆๅฎณใชใใใญใณใใใซๅฏพใใๅบๅใๅ ใฎ็ถๆ ใใ้ ใใใ๏ผใใๅผทใในใใขใชใณใฐใฎใใใฎ้่ฃๆญฃ๏ผ
Abliteration ใใฉใกใผใฟ
| ใใฉใกใผใฟ | ๅค |
|---|---|
| start_layer_index | 19 |
| end_layer_index | 42 |
| preserve_good_behavior_weight | 0.7662 |
| steer_bad_behavior_weight | 0.0007 |
| overcorrect_relative_weight | 0.9544 |
| neighbor_count | 15 |
ๆง่ฝ
| ๆๆจ | ใใฎใขใใซ | ๅ ใฎใขใใซ (google/gemma-4-E4B-it) |
|---|---|---|
| ๆๅฆ็ | 5/100 | 99/100 |
| KL็บๆฃ | 0.0256 | 0 (ๅฎ็พฉไธ) |
่ฉไพกใฏ mlabonne/harmful_behaviors๏ผใในใ 100 ใใญใณใใ๏ผใงๆๅฆ็ใใmlabonne/harmless_alpaca๏ผใในใ 100 ใใญใณใใ๏ผใง KL ็บๆฃใ่จๆธฌใใพใใใ
ๆณจ่จ
- ใใฎใขใใซใฏ็ ็ฉถใใใณใฏใชใจใคใใฃใใฉใคใใฃใณใฐ็ฎ็ใๆณๅฎใใฆใใพใ
- Heretic ใฎ ARA ใใฉใณใ๏ผPR #211๏ผใฏ็พๅจ(2026ๅนด4ๆ4ๆฅ) Draft ็ถๆ
ใงใกใคใณใใฉใณใใซใพใ ใใผใธใใใฆใใพใใ๏ผไฝฟ็จใณใใใ:
3b70fe5๏ผ - ๆๅฆ็ใฎ่ฉไพกใฏ่ฑ่ชใใญใณใใใฎใฟใงๅฎๆฝใใฆใใพใใๆฅๆฌ่ชใใญใณใใใงใฎๅไฝใฏ็ฐใชใๅ ดๅใใใใพใ
- ใใผในใขใใซ: google/gemma-4-E4B-it
- Heretic: p-e-w/heretic
- Downloads last month
- 18