ddalcu's picture
Upload text-only (vision+audio stripped) gemma-4-e2b-it 4bit MLX build
0ac4fb7 verified
|
Raw
History Blame Contribute Delete
2.25 kB
metadata
library_name: mlx
license: gemma
base_model: google/gemma-4-E2B-it
tags:
  - mlx
  - mlx-vlm
  - gemma4
  - text-generation

gemma-4-e2b-it-4bit-textonly

A stripped-down MLX build of Google's Gemma 4 E2B (instruction-tuned), based on mlx-community/gemma-4-e2b-it-4bit, with the vision tower and audio tower weights removed.

Gemma 4 E2B is natively multimodal (text/image/audio), but the vision and audio encoders together account for roughly a quarter of the checkpoint's size while going largely unused in text-only chat deployments. This variant drops both, shrinking the download from 3.55 GB to 2.5 GB (~30% smaller) with no change to the language model's weights or quantization — text generation quality is identical to the source model.

Built for MLX Chat, an iOS app (not yet released) that runs Gemma 4 fully on-device. Apple App Store review flagged the original build's download size, and this app doesn't use image or audio input, so both towers were removed rather than kept unused.

  • Source: mlx-community/gemma-4-e2b-it-4bit
  • Removed: all vision_tower.*, embed_vision.*, audio_tower.*, embed_audio.* tensors (1,415 of 2,511 total)
  • Quantization: unchanged (4-bit affine, language backbone + embeddings, same as source)
  • config.json: audio_config set to null; vision_config left in place structurally (some MLX loaders instantiate the vision module unconditionally) — load with strict=False if your loader errors on the missing vision weights

What this model can't do

No image or audio input. Text-in, text-out only. If you need Gemma 4's multimodal capabilities, use the upstream mlx-community/gemma-4-e2b-it-4bit instead.

Usage

pip install mlx-vlm
python -m mlx_vlm generate \
  --model ddalcu/gemma-4-e2b-it-4bit-textonly \
  --prompt "Explain what a black hole is in two sentences." \
  --max-tokens 80

If your mlx-vlm version raises a shape error while loading, load with strict=False:

from mlx_vlm import load, generate
model, processor = load("ddalcu/gemma-4-e2b-it-4bit-textonly", strict=False)