An unofficial Apple Silicon conversion of Google DeepMind’s CellGemma E4B. This is not a chat model. Stage 1 emits a ranked list of signed genes from a baseline and perturbation prompt. All 13 upstream dataset-specific Stage 2 expression decoders are included unchanged under decoders/.
What “8-bit g32” means: MLP and attention projections use 8-bit affine weights in groups of 32. The per-layer embedding lookup uses 8-bit groups of 64; the tied token embedding and per-layer projection/gate linears stay in BF16. No distillation. The measured average is 9.5333 bits per weight. The two main shards total 9.21 GB (decimal), excluding decoders and tokenizer. Their tensor payloads are the ones benchmarked, not a new conversion.
Download the complete repository with hf download joeynyc/CellGemma-E4B-MLX-8bit-g32 --local-dir ./CellGemma-8bit. From ./CellGemma-8bit on an Apple Silicon Mac, install the measured runtime in a Python 3.12 virtual environment with python -m pip install -r requirements-mac.txt. This short greedy example uses a bundled benchmark input; it needs neither a Studio installation nor remote model code.
from pathlib import Path
from mlx_lm import load
from mlx_lm.generate import stream_generate
from mlx_lm.sample_utils import make_sampler
model, tokenizer = load('.', tokenizer_config={'trust_remote_code': False}, trust_remote_code=False)
tokenizer.add_eos_token('<turn|>')
wrapped = Path('examples/k562-input.txt').read_text()
ids = tokenizer.encode(wrapped, add_special_tokens=False) # input already includes BOS
for response in stream_generate(model, tokenizer, ids, max_tokens=32, sampler=make_sampler(temp=0)):
print(response.text, end='', flush=True)
print()
The 32-token example is a load/generation smoke test, not a complete prediction. The benchmark used an 8,192-token cap. For input conventions, decoder reconstruction, intended use, and limitations, see the original model card. Its Transformers loading example is for the original BF16 weights; use MLX-LM for this conversion.
One native run on an Apple M4 Mac mini with 24 GB unified memory, MLX 0.32.2 and MLX-LM 0.32.0. Both cases used greedy decoding and the same saved original-weight Spark BF16 reference. LFC Pearson compares the reconstructed log-fold-change vectors; Spearman compares signed ranks on shared genes.
| Case | Tokens | Finish reason | LFC Pearson | Signed-rank Spearman |
|---|---|---|---|---|
| K562 | 1,927 | stop | 0.776 | 0.933 |
| Tahoe | 8,192 | length limit | 0.894 | 0.947 |
Peak MLX allocation was 9.41 GiB, with 0 GiB net system-wide swap growth in the matched run. Its automated output and memory checks passed; its report is review_needed, not operator-approved. An earlier run of this artifact exceeded the 1 GiB swap-growth budget. The delta is host-wide, not a guarantee about memory use on another Mac.
Compared with the 6-bit mixed release on these same inputs, 8-bit had higher Tahoe LFC agreement (0.894 vs. 0.877) but lower K562 agreement (0.776 vs. 0.817), and used 0.77 GiB more peak MLX memory. These results measure agreement with BF16 on two inputs, not experimental accuracy or clinical validity.
validation.json contains scoped measurements and source/reference identifiers. recipe.json records the precision policy; conversion-runtime.json records conversion library versions. SHA256SUMS covers the release files (excluding itself). Verify with shasum -a 256 -c SHA256SUMS from this directory.
The original model and decoders are by Google DeepMind. MLX Conversion Studio converted the language model to mixed precision. This derivative is not an official Google release. See LICENSE, NOTICE, and the upstream model card.
Have the files? Publish a torrent.
Publish a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo joeynyc/CellGemma-E4B-MLX-8bit-g32 ./model-foldermodel-00001-of-00002.safetensors 5.0 GiBmodel-00002-of-00002.safetensors 3.6 GiBdecoders/dong/model.safetensors 11.8 KiBdecoders/emeraldbay/model.safetensors 11.8 KiBdecoders/hepg2/model.safetensors 11.8 KiBdecoders/jurkat/model.safetensors 11.8 KiBdecoders/k562/model.safetensors 11.8 KiBdecoders/l1000/model.safetensors 11.8 KiBdecoders/norman/model.safetensors 11.8 KiBdecoders/parse/model.safetensors 11.8 KiBdecoders/rpe1/model.safetensors 11.8 KiBdecoders/sciplex/model.safetensors 11.8 KiBdecoders/tahoe/model.safetensors 11.8 KiBdecoders/tisch/model.safetensors 11.8 KiBdecoders/vcc/model.safetensors 11.8 KiBgoogle/cellgemma-e4b