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
Clarify which genes are scored in Table A.9 Pearson Δ
I found two descriptions of Pearson Δ in the December 1 technical report. Section 2.2 describes Pearson correlation over differentially expressed genes. Section M.3.3.2 defines the correlation of the two control-subtracted profiles over all measured genes. Table A.9 labels its 32 rows Pearson Δ and points to Methods. Results, page 6 · Methods, page 37 · Table A.9, page 66
The choice changes the comparison. I rescored the same predictions on all 50 public Arc VCC validation targets using the 8-bit CellGemma checkpoint and one 50-token response per target. The mean-shift baseline was fit on the 150 Arc training targets. In this local sensitivity check, I selected the gene subset by absolute observed shift.
| Genes scored per target | CellGemma Pearson Δ | Training mean shift | Paired difference (95% CI) |
|---|---|---|---|
| All 18,080 measured genes | 0.16371 | 0.16279 | +0.00092 (−0.00064 to +0.00258) |
| 100 largest observed absolute shifts | 0.26765 | 0.25187 | +0.01577 (+0.00817 to +0.02444) |
The intervals resample validation targets. The 100-gene selection is an illustration of restricting the correlation. The table above uses local preprocessing and saved predictions. Arc VCC public data
A minimal example shows the two calculations on the same predicted and observed shift vectors.
import numpy as np
observed = np.array([-3, -2, 0, 1, 5])
predicted = np.array([1, -1, 0, -1, 4])
top = np.argsort(-np.abs(observed))[:3]
print(round(np.corrcoef(predicted, observed)[0, 1], 5)) # 0.67355
print(round(np.corrcoef(predicted[top], observed[top])[0, 1], 5)) # 0.86603
Could you confirm which gene set was used for Table A.9 and align the description in §2.2 with that calculation?
🤖 Generated with Claude Code