Views
No views yet

8-bit affine (8.805 bpw) MLX quant of an abliterated (refusal-ablated)google/gemma-4-12B-it— Google's encoder-free unified multimodal model (text · image · audio · video). Quantized for Apple Silicon by Lemura Labs. All vision & audio weights are preserved.
mlabonne/harmful_behaviors test[:100]), greedy decoding, refusal-marker classifier:| Model | Refusals | Refusal rate |
|---|---|---|
google/gemma-4-12B-it (original) | 99 / 100 | 99.0% |
| this model (abliterated) | 12 / 100 | 12.0% |
| Disk size | ~13.7 GB |
| Effective BPW | 8.805 |
| Scheme | 8-bit affine, group size 64 (MLX) |
| Base | google/gemma-4-12B-it — 11.95B, 48 layers, 256K context, 140+ languages |
| Modalities | text · image · audio · video in, text out (encoder-free / unified) |
| Vision / audio weights | Yes — fully preserved (kept at bf16) |
| Runtime | This MLX quant? | Notes |
|---|---|---|
| mlx-vlm / mlx-lm (Mac) | Yes — text today · Partial — vision/audio pending | native; needs the small shim below |
| LM Studio (Mac · MLX engine) | Partial — when its bundled mlx-lm adds gemma4_unified | drop-in once supported |
| vLLM (CUDA/GPU) | No — MLX format not supported | use bf16 google/gemma-4-12B-it + an FP8/AWQ/GPTQ quant instead |
| Ollama / llama.cpp | No — needs GGUF | requires a separate GGUF build (llama.cpp gemma4_unified support pending) |
| transformers (PyTorch) | runs the bf16 model, not this quant | Yes — full multimodal — see Vision & audio |
Why the shim / "pending"? Gemma 4 12B is the brand-newgemma4_unifiedencoder-free architecture.mlx-vlm0.5.0 ships agemma4module that loads the text + projection weights but does not yet implement the image patch-embedder forward, so vision/audio inference in MLX is pending an upstream update. The weights are all here, so it will "just work" once support lands.
pip install -U mlx-vlm torchvision # torchvision is needed by the Gemma-4 processor1# Shim: map gemma4_unified onto mlx-vlm's gemma4 module + tolerate the
2# not-yet-modeled vision patch-embedder tensors. Remove once mlx-vlm ships support.
3import mlx_vlm.utils as U
4U.MODEL_REMAPPING["gemma4_unified"] = "gemma4"
5import mlx.nn as nn
6_lw = nn.Module.load_weights
7nn.Module.load_weights = lambda self, w, strict=True: _lw(self, w, strict=False)
8
9from mlx_vlm import load, generate
10model, processor = load("lemuralabs/Gemma-4-12B-uncensored-8bit-mlx")
11
12# Gemma 4 REQUIRES its chat template — a raw string produces garbage (repeated tokens).
13messages = [{"role": "user", "content": "Explain abliteration in two sentences."}]
14prompt = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
15print(generate(model, processor, prompt, max_tokens=256).text)Verified: this produces coherent output on Apple Silicon (M-series). The chat template + the shim are both required untilmlx-vlmships nativegemma4_unifiedsupport.
mlx-lm/mlx-vlm recognizes the gemma4_unified encoder-free arch (text first; vision when the patch-embedder lands upstream). Until then, the Quick start shim above runs text today.| App | What it is |
|---|---|
| oMLX · omlx.ai | MLX inference server + macOS menu-bar app — paged SSD KV cache, continuous batching, OpenAI/Anthropic-compatible API (great for agents & long context) |
| vMLX | Free MLX Mac app — prefix + paged KV cache, continuous batching, MCP tools |
| LM Studio | GUI bundling the MLX engine + llama.cpp; best-in-class model browser (pick the MLX runtime) |
| Ollama 0.19+ | now runs MLX under the hood on Apple Silicon; REST API on :11434 |
| mlx-vlm / mlx-lm | Apple's native libraries — maximum performance (the Quick start above) |
| macMLX · Msty | native macOS MLX app · unified local-and-cloud workspace |
They all build onmlx-lm/mlx-vlm, sogemma4_unified(and the vision path) arrives through that stack. For full multimodal today, run the bf16 repo in transformers.
vision_embedder, embed_vision, embed_audio) and the vision_config/audio_config are preserved in this quant.mlx-vlm encoder-free support — no re-quantization will be needed when it lands.gemma4_unified):pip install -U "transformers>=5.10" torch torchvision librosa accelerate1from transformers import AutoProcessor, AutoModelForMultimodalLM
2
3mid = "google/gemma-4-12B-it" # base model; swap for an abliterated-bf16 repo for refusal-free multimodal
4processor = AutoProcessor.from_pretrained(mid)
5model = AutoModelForMultimodalLM.from_pretrained(mid, dtype="auto", device_map="auto")
6
7messages = [{"role": "user", "content": [
8 {"type": "image", "url": "https://.../photo.jpg"}, # image → key "url"
9 {"type": "audio", "audio": "https://.../clip.wav"}, # audio → key "audio" (≤30s)
10 {"type": "text", "text": "Describe what you see and hear."},
11]}]
12inputs = processor.apply_chat_template(messages, tokenize=True, return_dict=True,
13 return_tensors="pt", add_generation_prompt=True, enable_thinking=False).to(model.device)
14n = inputs["input_ids"].shape[-1]
15out = model.generate(**inputs, max_new_tokens=512)
16print(processor.parse_response(processor.decode(out[0][n:], skip_special_tokens=False)))Audio: ≤ 30 s clips (native ASR + speech translation). Images: variable resolution. Video: ≤ 60 s at ~1 fps. For refusal-free multimodal, swapmidfor the abliterated bf16 checkpoint (ask Lemura Labs if you need it published).
| Repo | Scheme | Eff. BPW | Size | |
|---|---|---|---|---|
Gemma-4-12B-uncensored-bf16 — abliterated, full multimodal | bf16 | 16 | ~23.9 GB | link |
Gemma-4-12B-uncensored-8bit-mlx | 8-bit affine | 8.805 | ~13.7 GB | Yes — you are here |
Gemma-4-12B-uncensored-mxfp4-mlx | MXFP4 (4-bit microscaling) | 7.628 | ~11.9 GB | link |
Gemma-4-12B-uncensored-mixed-4.2bpw-mlx | mixed 3/4-bit | 4.2 | ~6.6 GB | link |
google/gemma-4-12B-it — base (not abliterated) | bf16 | 16 | ~24 GB | link |
google/gemma-4-12B-it-assistant — MTP draft | can be added later | — | — | planned |
mlx-vlm convert (MLX), group size 64, scheme 8-bit affine → 8.805 bpw, ~13.7 GB.vision_embedder, 9 tensors) is re-inserted at bf16 and vision_config/audio_config retained — every original tensor is present.google/gemma-4-12B (Google DeepMind — base pretrain)
↓ instruction tuning
google/gemma-4-12B-it (multimodal, encoder-free)
↓ the ablation toolkit 1.3.0 — directional ablation, Optuna/TPE-optimized over 100 trials, best Pareto trial #55
abliterated bf16 (refusals 99→12 / 100, KL 0.053)
↓ mlx-vlm quantization (Lemura Labs)
this repo — 8-bit affine, MLX| Role | Project |
|---|---|
| Quantization & release | Lemura Labs |
| Research | Lemura Labs |
| Base model | Google DeepMind — Gemma 4 |
| Quant toolkit | mlx · mlx-vlm |