license: apache-2.0
base_model:
- google/gemma-4-E2B-it
- litert-community/gemma-4-E2B-it-litert-lm
library_name: litert-lm
pipeline_tag: image-text-to-text
tags: - litert-lm
- gemma
- gemma-4
- abliterated
- uncensored
- on-device
- ios
- android
- mtp
- multimodal
Gemma 4 E2B — abliterated, on-device (.litertlm), vision + audio + MTP intact
An abliterated (refusal-reduced) build of Gemma 4 E2B packaged as a single .litertlm for the
LiteRT-LM runtime. Made for an offline survival & preparedness assistant, where the stock model
refuses ordinary questions (field-dressing a deer, storing fuel, suturing a wound, making a snare).
Everything except the edited text weights is byte-identical to Google'slitert-community/gemma-4-E2B-it-litert-lm — vision encoder, audio encoder, MTP drafter,
tokenizer and chat template all survive. Same size (2.59 GB), same speed.
How it was made
Port of oknyshuk's in-place method for E4B
(olekk/gemma-4-E4B-it-abliterated-litert-lm):
- Per-layer refusal directions from
google/gemma-4-E2B-it-qat-q4_0-unquantized
(mean difference of last-token residuals on 256 harmful vs 256 harmless prompts, winsorized,
biprojected against the harmless mean). - The stock
.litertlmis patched in place: the int4o_proj(all 35 layers) and int4down_proj(layers 0–14) weights insideprefill_decodeare dequantized, norm-preserving
biprojected, and re-quantized onto the frozen per-channel scales with directional error
feedback (so the sub-quantization-step edit survives int4). ~3–4% of int4 codes change. - E2B's double-wide layers (15–34, int2
down_proj) and the int8 per-layer-embedding projections
are deliberately not edited — editing them removed more refusals but cost answer quality.
Measured (blind-graded, LiteRT-LM 0.18.1)
| stock E2B | this model | |
|---|---|---|
| refusals on 30 survival/preparedness edge cases | 17 / 30 | ~1 / 30 |
| refusals on 104 held-out generic harmful prompts (mlabonne test split) | 101 / 104 | 28 / 104 |
| survival-answer quality vs stock (190 questions, 1–5 scale) | — | −0.14 (95% CI −0.25…−0.04) |
This is a moderate abliteration: it still declines a share of generic harmful requests. Image and
audio input verified (photo description; word-exact speech transcription). iPhone 15 GPU:
~23–31 tok/s decode with speculative decoding (MTP) enabled.
Run it
uvx --from litert-lm litert-lm run gemma-4-E2B-it-abliterated.litertlm --backend=gpu --prompt="…"
Swift / Kotlin: load like the stock gemma-4-E2B-it.litertlm (vision/audio backends on CPU).
Safety & responsible use
Refusal behavior has been reduced. The model may produce harmful, inaccurate or dangerous content —
it is not a substitute for medical, legal or safety professionals; small models make factual
errors (verify doses, temperatures and procedures). You are responsible for how you use it and for
its outputs. The Gemma Prohibited Use Policy
applies.
License & attribution
Apache-2.0, as the base Gemma 4 model and the litert-community .litertlm. Modifications: refusal
direction removal in the quantized text-decoder weights. Method: biprojected abliteration
(grimjim; p-e-w/heretic), Gemma-4 recipe (TrevorS/gemma-4-abliteration), in-place int4 patch +
directional error-feedback requantizer (oknyshuk). Tooling:scripts/abliteration/ in the Shadow Guardian repository.