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
Showcase: PROJECT C.U.R.E. v2.0.0 — Open-Source Local macOS Oncology Workstation for CellGemma
Hi everyone — sharing an open-source, local-first oncology research workstation I just shipped that integrates google/cellgemma-e4b directly on Apple Silicon:
Repository: https://github.com/isaacrishi/PROJECT-C.U.R.E-
What It Does
PROJECT C.U.R.E. v2.0.0 is an Electron + React 19 + Three.js macOS desktop application built under I.R.A.I. Corp so researchers can run CellGemma perturbation workflows privately without sending sensitive assay data to third-party clouds.
Technical Architecture
- Local CellGemma Sidecar (
scripts/cellgemma_server.py): Runsgoogle/cellgemma-e4boffline (HF_HUB_OFFLINE=1) inbfloat16on Apple Silicon Metal (mps) via FastAPI (http://127.0.0.1:8000), with optional cloud GPU offload. - Multi-Modal Oncology Modules: Connects perturbation predictions to interactive 3D Tumor Microenvironment (TME) simulations, a DeepZoom Whole Slide Imaging (WSI) viewer & tile server, a single-cell AnnData bridge, AutoDock Vina protein docking, and an automated benchmark harness.
- Local-First Security: Encrypted local SQLite storage with electronic sign-off and audit trails.
Early Hardware Notes (16 GB M4 MacBook Pro)
Full bfloat16 (~15.5 GB) runs cleanly end-to-end on MPS, though it pushes 16 GB unified memory into swap pressure during concurrent 3D rendering. Next up, I'm benchmarking 6-bit/8-bit MLX quantization against full-precision perturbation fidelity for consumer laptops.
Would love any feedback from the CellGemma team or community on local inference optimizations and validation benchmarks!
Thanks for the detailed field report — a full local workstation around CellGemma on Apple Silicon is exactly the kind of deployment data watchers learn from. Running the full bfloat16 weights (~15.5 GB) end to end on MPS on a 16 GB M4, with swap pressure only when the 3D rendering runs alongside, gives a clear picture of where the memory ceiling sits. The offline sidecar design (HF_HUB_OFFLINE=1, local FastAPI) also keeps assay data on the machine, which matters for this kind of work. The planned 6-bit/8-bit MLX comparison against full-precision perturbation fidelity will be the interesting next read — fidelity, not just footprint, is the question that decides whether quantization helps here. We will be watching for those numbers.

