moshi-gemma-4-e2b-ja-4bit
A smaller MLX build of Gemma 4 E2B (4-bit) for on-device Japanese conversation on iPhone. It is derived from mlx-community/gemma-4-e2b-it-4bit, which is a conversion of google/gemma-4-E2B-it.
What was changed
- Audio removed. The audio tower and audio embedding weights were dropped. Text and image input remain.
- Vocabulary pruned for Japanese conversation. The vocabulary was reduced from 262,144 to 74,857 tokens: tokens seen 10 or more times in a Japanese conversation corpus, about 8,000 frequent English words, all special tokens, and every token needed to keep the BPE merge paths intact. The tied embedding rows (weights, scales and biases) were cut together, and the token IDs in
config.json,tokenizer.jsonandprocessor_config.jsonwere remapped.
No weights were retrained. Size: about 1.83 GB (the source is about 3.55 GB).
Checks
- Greedy decoding: same replies as the audio-removed, unpruned model in 27/27 conversation turns and 64/64 extra prompts.
- Image input (MLXVLM in mlx-swift-lm 3.32.3): same descriptions as the unpruned model for 5 test images.
- Tokenization: identical token sequences to the original tokenizer for 100% of the Japanese conversation texts tested, and 98.7% of 1,000 general Japanese sentences. The sentences that differed contain English proper nouns or code, for example
JetBrains.
Limitations
- English words that are not in the kept list, and code, may be split into more tokens than with the original tokenizer.
- Audio input is not available.
- The model's ability is the same as Gemma 4 E2B. This build only makes it smaller.
License
Apache License 2.0, the same license as Gemma 4. This is a modified version of the original model; the modifications are listed above.