Run this model with HF Jobs
Run google/cellgemma-e4b on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/google/cellgemma-e4b. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/google/cellgemma-e4b on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/google/cellgemma-e4b. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/google/cellgemma-e4b. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
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
Inquiry regarding combinatorial gene knockdown prediction using CellGemma
Dear CellGemma Team,
Thank you for developing and sharing CellGemma. I am currently planning a combinatorial gene knockdown analysis using your model and would appreciate your guidance on the appropriate conditioning strategy.
- Research objective
I aim to predict the transcriptional response to simultaneous knockdown of two genes in RPE1 cells. The target combinations correspond to either the both-genes-unseen or one-gene-unseen scenario with respect to the Replogle RPE1 dataset.
- Data limitations
Since single-gene knockdown data for some of my genes of interest are unavailable in the Replogle RPE1 Perturb-seq dataset, constructing the linear additive prior described in Equation M.7 of the technical report is not straightforward.
- Proposed approach
I am considering using the officially provided RPE1 ExpressionDecoder and mean_delta_global.json without modification, while specifying two Gene knockdown: descriptors in the prompt for simultaneous double-knockdown prediction.
- Potential concern
My understanding is that, under global conditioning, the same global mean shift is applied once to each single-knockdown and double-knockdown prediction.
Therefore, when comparing the double-knockdown prediction with the sum of the two predicted single-knockdown effects, the global mean shift would be accounted for twice in the additive expectation but only once in the double-knockdown prediction. I am concerned that this discrepancy may introduce apparent non-additive effects in downstream analyses.
- Questions
Is simultaneous double-knockdown prediction with global conditioning a recommended approach when empirical single-perturbation data are unavailable for one or both target genes?
Which conditioning strategies were used for the one-gene-unseen and both-genes-unseen scenarios in the combinatorial perturbation benchmarks presented in the technical report?
Is there a recommended approach to constructing an additive expectation or evaluating non-additive responses under global conditioning while accounting for the potential discrepancy described above?
I would like to adhere as closely as possible to CellGemma's original implementation and training framework rather than introduce custom conditioning strategies.
I would greatly appreciate any guidance or recommendations you could provide.
Thank you for your time and assistance.
Your concern about the single global mean-shift baseline is spot on β and we just ran a 75-run, 5-seed empirical audit of exactly this prompting pattern (\n\n-joined multi-perturbation descriptors using unmodified ExpressionDecoder + mean_delta_global.json, across both decoders/parse/ [single-perturbation trained] and decoders/dong/ [trained on single + combinatorial perturbations]).
Three practical findings that may save you debugging time before you scale up RPE1 double knockdowns:
- Always compare against a matched-length specificity control, not just the sum of singles: Because the global mean shift (
mean_delta_global) is applied once to the joint prompt and once to each single prompt, raw additive subtraction (pred(A+B) - [pred(A) + pred(B)]) double-countsmean_delta_globalunless you work in Stage-2 residual space (residual_vec = pred - baseline_expr) or compareA+Bdirectly against a neutral/non-interacting co-perturbationA+Cof identical prompt length. - Co-directional vs. opposing combinations behave very differently across seeds (
T = 0.7): In our 5-seed audit (seeds = 42, 101, 202, 303, 404), co-directional combinations (IFNG+IL15+IL1B,IFNG+IL15+IL7) were tightly unimodal (SD = 0.030β0.042), whereas opposing perturbations (IFNG+IL15+IL1RN) triggered bimodal attractor switching across seeds in bothparse(3/5vs2/5,p = 0.331) anddong(2/5vs3/5,p = 0.242). Single-seed (seed=42) apparent hits (-18.3%,-15.8%) vanished across 5 seeds (p = 0.89,p = 0.94). - Combinatorial-trained decoders still cut variance substantially (
2.7Γ): Even though Stage-1 bimodality persisted,dongreduced triple-combination SD from0.376(parse) to0.139and eliminated outlier draws (0/5vs1/5). Forrpe1(which is single-knockdown trained), runningN >= 5seeds plus an unexpressed-gene specificity control (A + unexpressed_gene) is strongly advisable before interpreting any epistasis/synergy score.
Code and all 75 per-seed combinatorial traces are open in re-cep/vitiligo-cellgemma-benchmark (configs robustness_multiseed_runs and multidecoder_dong_multiseed_runs).