Instructions to use google/cellgemma-e4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/cellgemma-e4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="google/cellgemma-e4b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("google/cellgemma-e4b") model = AutoModelForCausalLM.from_pretrained("google/cellgemma-e4b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use google/cellgemma-e4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "google/cellgemma-e4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/cellgemma-e4b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/google/cellgemma-e4b
- SGLang
How to use google/cellgemma-e4b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "google/cellgemma-e4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/cellgemma-e4b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "google/cellgemma-e4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/cellgemma-e4b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use google/cellgemma-e4b with Docker Model Runner:
docker model run hf.co/google/cellgemma-e4b
Independent OOD evaluation on natural products: external baseline ribo/MT collapse guardrail, batch_size=8 speedup, and SMILES glycoside aliasing
Thank you for open-sourcing google/cellgemma-e4b under Apache 2.0. Sharing a concise, reproducible set of engineering and out-of-distribution (OOD) findings from 96 A100-40GB evaluation runs on unseen natural-product perturbations (Nigella sativa quinones and triterpenoids, absent from LINCS L1000 and Tahoe-100M):
External baseline
RPL*/RPS*/MT-*collapse guardrail (tahoedecoder):
Nativetahoecontrols incontrols_sample.jsonhave ~8%RPL*/RPS*/MT-*genes in their Top-100Source:list (sum(expm1) = 1543.0). Feeding bulk TPM (B-CPAP, 77% ribo/MT) or unfiltered 10x primary thyroid tumor scRNA-seq (GSE232237PT10, 57% ribo/MT) frequently triggered autoregressive token-repetition collapse (+6/-8valid genes out of 2,048 tokens; seed Jaccard0.005–0.085), even forNVP-BHG712. FilteringRPL*/RPS*/MT-*prior to Tahoe scaling eliminated collapse across 48/48 runs (Jaccard 0.50–0.82). (Also logged as a small docs suggestion in google-gemma/docs#25.)Left-padded batched inference speedup (~7.4× on A100-40GB):
Settingtokenizer.padding_side = "left"withbatch_size = 8(bfloat16,max_new_tokens = 2048) cut wall-clock latency from~192 s/runto25.9 s/run(48 runs in 20.7 min) with normal parsed outputs.OOD decoy-ranking & SMILES "glycoside aliasing" vs. real wet-lab RNA-seq:
- Against real
GSE186218A549 hederagenin (10 µM),Hederageninbeat inertDMSO(r = +0.122all /+0.241WL-sig vsDMSO -0.012 / -0.081) but ranked#6/13on WL-sig DEGs (#8/13all predicted genes), behind unrelated decoys (NVP-BHG712,Menadione, 4-drug unrelated mean) and drug-freetahoe_mean_delta_global(r_full = +0.123vs hederagenin+0.095) — highlighting the value of ranking against active decoys rather thanDMSOalone. - On identical
A549_tahoe_pb, glycosylatedα-hederinmapped closely onto cardiac glycosidesDigoxin(cos = +0.749) andOuabain(+0.610) rather than its aglyconeHederagenin(+0.081) orUrsolic acid(+0.060). Direct comparison of realHeLaα-hederin RNA-seq (PRJNA1251828) againstGSE230039(C4-2BDigoxin 100 nMandUrsolic acid 10 µM) and LINCS L1000 shows the opposite in wet-lab biology (Ursolic acid48hr_sig = +0.346,Hederagenin+0.205, LINCSCelastrol#4–5vsDigoxin24h+0.069/ 48h-0.119), suggesting SMILES disaccharide aliasing onto cardenolides. - A provisional bulk-TPM thyroid
+GPNMBhit did not replicate (0/4) on cleaned primary human thyroid single-cell baselines (PT10/AT9).
- Against real
Full offline-reproducible scripts, Colab notebooks, raw A100 JSON outputs, and the technical evaluation report (v1.1.0, Apache 2.0):