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
Mean-shift baselines in the model card differ from the technical report
I compared the 32 Pearson Δ settings in the model card with the matching rows in the technical report, Table A.9. The Mean Shift Baseline column differs beyond rounding in 19 rows. There are 11 differences in the mean and 14 in the standard error, with some rows differing in both. All 32 CellGemma means and standard errors agree within the displayed precision.
| Setting | Model card baseline | Paper MS baseline |
|---|---|---|
| Nadig/Replogle HepG2, unseen perturbation | 0.44 ± 0.01 | 0.481 ± 0.010 |
| L1000, unseen perturbation | 0.18 ± 0.01 | 0.146 ± 0.007 |
| Dong, unseen perturbation | 0.36 ± 0.06 | 0.345 ± 0.040 |
| Norman, both genes unseen | 0.48 ± 0.05 | 0.492 ± 0.030 |
To reproduce the largest difference, find the Nadig/Replogle HepG2 row under Benchmark Results in the pinned model card, then read the MS column for HepG2 in Table A.9. Table A.5 in the report also gives 0.481 ± 0.010 for that baseline. I counted differences only when the printed values were more than 0.0055 apart, allowing for rounding at both displayed precisions.
Could you align the baseline column with the report, or label the evaluation that produced the model card values if it used a separate calculation?
🤖 Generated with Claude Code