Instructions to use limloop/waifu-heretic-26b-a4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use limloop/waifu-heretic-26b-a4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="limloop/waifu-heretic-26b-a4b") 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("limloop/waifu-heretic-26b-a4b") model = AutoModelForMultimodalLM.from_pretrained("limloop/waifu-heretic-26b-a4b", 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 limloop/waifu-heretic-26b-a4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "limloop/waifu-heretic-26b-a4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "limloop/waifu-heretic-26b-a4b", "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/limloop/waifu-heretic-26b-a4b
- SGLang
How to use limloop/waifu-heretic-26b-a4b 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 "limloop/waifu-heretic-26b-a4b" \ --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": "limloop/waifu-heretic-26b-a4b", "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 "limloop/waifu-heretic-26b-a4b" \ --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": "limloop/waifu-heretic-26b-a4b", "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 limloop/waifu-heretic-26b-a4b with Docker Model Runner:
docker model run hf.co/limloop/waifu-heretic-26b-a4b
waifu-heretic-26b-a4b
🇷🇺 Нажмите, чтобы развернуть описание на русском
waifu-heretic-26b-a4b — это hiwaifu-research/WaifuGemma4-26b-a4b-v1, из которой удалена цензура.
Не модификация. Не новая персона. Не «улучшенная» версия. Та же модель — с теми же знаниями, тем же русским языком, тем же ролевым отыгрышем — но без внутренних барьеров, которые заставляли её отказывать.
Что изменилось
Ровно один компонент: self_attn.o_proj в слоях 11–22. Всё остальное — эмбеддинги, lm_head, MLP, роутер, эксперты, визуальный энкодер — осталось от WaifuGemma4 нетронутым.
Аbliteration-вектор взят из llmfan46/gemma-4-26B-A4B-it-ultra-uncensored-heretic — модели, которая снимает отказы через точечное воздействие на тот же компонент (attn.o_proj в слоях 11–22). Мы не смешивали модели целиком, а перенесли только то изменение, которое отвечает за отказы.
Характер модели
| Качество | Описание |
|---|---|
| Свобода | Не отказывает. Ни на жестокость, ни на NSFW, ни на этически сложные темы. Не читает лекций. Не добавляет дисклеймеров. |
| Ролевой отыгрыш | Сохранён. Персонаж, контекст, стиль — всё на месте. |
| Знания | Сохранены. Изменён только один проекционный слой, а не веса знаний. |
| Следование инструкциям | Улучшилось. Меньше «внутренних переговоров» о том, можно ли ответить — ответы прямее и чище. |
Цензура и границы
Модель не имеет встроенных отказов в том виде, в каком они присутствуют у WaifuGemma4. Это означает:
- ✅ Сцены жестокости, хоррора, политические темы, откровенный контент — без отказов
- ✅ Этически неоднозначные персонажи — без моральных вставок
- ✅ Прямые ответы на сложные вопросы — без «я не могу обсуждать эту тему»
Детали слияния
Слияние выполнено через mergekit-exp — форк mergekit, добавляющий поддержку архитектуры Gemma4ForConditionalGeneration и MoE-осведомлённые методы слияния.
Метод: moe_slerp с точечным фильтром.
База: WaifuGemma4 — русскоязычная база, реальные диалоговые данные, ролевой отыгрыш.
Донор: Heretic — аbliteration через self_attn.o_proj в слоях 11–22.
Что изменено: только self_attn.o_proj в слоях 11–22, с весом t = 0.8. Роутер (router_strategy: "first") остался полностью от WaifuGemma4 — русские токены маршрутизируются в те же эксперты, что и раньше.
Что не изменено: эмбеддинги, lm_head, MLP, эксперты, визуальный энкодер, все остальные слои.
Конфигурация
architecture: Gemma4ForConditionalGeneration
merge_method: moe_slerp
base_model: hiwaifu-research/WaifuGemma4-26b-a4b-v1
models:
- model: llmfan46/gemma-4-26B-A4B-it-ultra-uncensored-heretic
parameters:
weight: 1.0
parameters:
t:
- filter: self_attn.o_proj
value: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
- value: 0.0
router_strategy: "first"
dtype: bfloat16
out_dtype: bfloat16
tokenizer:
source: "base"
Пояснения к конфигу:
architecture: Gemma4ForConditionalGeneration— явное указание архитектуры, чтобыmergekit-expкорректно обрабатывал мультимодальные модули (model.language_model.layers,model.vision_tower.encoder.layers,default).merge_method: moe_slerp— MoE-осведомлённый SLERP для двух моделей. Сохраняет норму весов, не размывая их линейным усреднением.base_model: WaifuGemma4— точка отсчёта. Все веса, не попавшие под фильтр, берутся отсюда.models[].weight: 1.0— вmoe_slerpне используется (метод работает черезt), оставлено для совместимости с форматом mergekit.t: filter: self_attn.o_proj— целевой компонент. Abliteration в Heretic затронула именноattn.o_proj, поэтому переносим только его.value: [0.0, ..., 0.8, ..., 0.0]— список из 30 значений, по одному на каждый слой. Слои 0–10 и 23–29 получаютt = 0.0(чистая WaifuGemma4), слои 11–22 получаютt = 0.8(80% Heretic, 20% WaifuGemma4).value: 0.0(второе правило) — catch-all для всех остальных тензоров (embed_tokens,lm_head, layer norms и т.д.). Они остаются полностью от WaifuGemma4.router_strategy: "first"— веса роутера берутся целиком изbase_model(WaifuGemma4). Критически важно: русские токены продолжают маршрутизироваться в те же эксперты, что и в исходной модели.tokenizer: source: "base"— токенизатор от WaifuGemma4. Гарантирует корректную работу с русским языком.
waifu-heretic-26b-a4b is hiwaifu-research/WaifuGemma4-26b-a4b-v1 with censorship removed.
Not a modification. Not a new persona. Not an "improved" version. The same model — same knowledge, same Russian, same roleplay — but without the internal barriers that made it refuse.
What changed
Exactly one component: self_attn.o_proj in layers 11–22. Everything else — embeddings, lm_head, MLP, router, experts, vision encoder — remains untouched from WaifuGemma4.
The abliteration vector is taken from llmfan46/gemma-4-26B-A4B-it-ultra-uncensored-heretic — a model that removes refusals through targeted intervention on the same component (attn.o_proj in layers 11–22). We didn't blend models wholesale; we transferred only the change responsible for refusals.
Model character
| Quality | Description |
|---|---|
| Freedom | No refusals. Not on violence, not on NSFW, not on ethically complex topics. No lectures. No disclaimers. |
| Roleplay | Preserved. Character, context, style — all intact. |
| Knowledge | Preserved. Only one projection layer changed, not knowledge weights. |
| Instruction following | Improved. Fewer "internal negotiations" about whether to answer — responses are more direct. |
Censorship and boundaries
The model has no built-in refusals in the form present in WaifuGemma4:
- ✅ Violence, horror, political topics, explicit content — no refusals
- ✅ Ethically ambiguous characters — no moral insertions
- ✅ Direct answers to difficult questions — no "I can't discuss this"
Merge details
The merge was performed with mergekit-exp — a fork of mergekit that adds support for the Gemma4ForConditionalGeneration architecture and MoE-aware merge methods.
Method: moe_slerp with targeted filtering.
Base: WaifuGemma4 — Russian base, real dialogue data, roleplay.
Donor: Heretic — abliteration via self_attn.o_proj in layers 11–22.
Changed: only self_attn.o_proj in layers 11–22, with weight t = 0.8. Router (router_strategy: "first") remains fully from WaifuGemma4 — Russian tokens route to the same experts as before.
Unchanged: embeddings, lm_head, MLP, experts, vision encoder, all other layers.
Configuration
architecture: Gemma4ForConditionalGeneration
merge_method: moe_slerp
base_model: hiwaifu-research/WaifuGemma4-26b-a4b-v1
models:
- model: llmfan46/gemma-4-26B-A4B-it-ultra-uncensored-heretic
parameters:
weight: 1.0
parameters:
t:
- filter: self_attn.o_proj
value: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
- value: 0.0
router_strategy: "first"
dtype: bfloat16
out_dtype: bfloat16
tokenizer:
source: "base"
Configuration notes:
architecture: Gemma4ForConditionalGeneration— explicit architecture somergekit-expcorrectly handles multimodal modules (model.language_model.layers,model.vision_tower.encoder.layers,default).merge_method: moe_slerp— MoE-aware SLERP for two models. Preserves weight norm instead of blurring via linear averaging.base_model: WaifuGemma4— anchor point. All weights not matched by a filter are taken from here.models[].weight: 1.0— unused bymoe_slerp(the method works throught), kept for mergekit format compatibility.t: filter: self_attn.o_proj— target component. Abliteration in Heretic affectedattn.o_proj, so we transfer only that.value: [0.0, ..., 0.8, ..., 0.0]— list of 30 values, one per layer. Layers 0–10 and 23–29 gett = 0.0(pure WaifuGemma4), layers 11–22 gett = 0.8(80% Heretic, 20% WaifuGemma4).value: 0.0(second rule) — catch-all for all other tensors (embed_tokens,lm_head, layer norms, etc.). They remain fully from WaifuGemma4.router_strategy: "first"— router weights are taken entirely frombase_model(WaifuGemma4). Critical: Russian tokens continue to route to the same experts as in the original model.tokenizer: source: "base"— tokenizer from WaifuGemma4. Ensures correct handling of Russian.
- Downloads last month
- 14