Skip to main content
株式会社オブライト
株式会社オブライト

MedGemma 2 Requirements

VRAM, GGUF Sizes, Ollama & License (Dec 2026)

Published 2026/12/0515 min read

MedGemma 2 (26B MoE, 3.8B active; E4B): 26B needs 17GB at 4-bit (24GB GPU), E4B ~5GB (estimate). Ollama, HAI-DEF license, medical cautions. Updated Dec 2026

MedGemma 2 is Google's open-weight model for health and life-sciences developers, announced on December 3, 2026 and built on Gemma 4. It comes in two sizes: a 26B MoE (25.2B total, 3.8B active, 8 of 128 experts plus one shared) and E4B (4.5B effective, about 8B including per-layer embeddings). Memory needs are roughly 58GB for the 26B MoE in bf16 (Google recommends an 80GB-class GPU), 17GB for a 4-bit GGUF (Unsloth UD-Q4_K_XL), about 18GB for E4B in bf16, and 4-5GB for E4B at 4-bit. A 24GB GPU should run the 26B MoE at 4-bit, and E4B at 4-bit fits phones and laptops (estimate).

Facts are from primary sources as of December 5, 2026: the Google Research blog, the Health AI Developer Foundations get-started page, the Hugging Face model card, Unsloth's GGUF repositories and the Ollama library page. Values marked official come from those sources; values marked estimate are our own calculations from them. MedGemma 2 is not meant to inform clinical decisions directly; it is a starting point that developers must validate and adapt. This article covers specs, and the medical-use cautions are collected in the last sections.

Requirements at a glance

FormatFile size / memory (official)What should run it (estimate)
26B MoE, bf16~58GB (Google's inference memory); ~50.5GB weights (Unsloth BF16 GGUF)80GB-class GPU (A100, H100, RTX PRO 6000). Google also recommends 80GB+
26B MoE, UD-Q8_K_XL27.6GB32GB GPU or 48GB Mac
26B MoE, UD-Q6_K_XL23.3GB32GB GPU; tight on 24GB with long context
26B MoE, UD-Q5_K_XL21.2GB24GB GPU, short context
26B MoE, UD-Q4_K_XL17GB24GB GPU (RTX 4090/3090). The standard choice
26B MoE, UD-Q3_K_M12.7GB16GB GPU
26B MoE, UD-Q2_K_XL10.5GB12GB GPU, barely; expect quality loss
26B MoE, Ollama medgemma2:26b18-19GB24GB GPU
E4B, bf16~18GB (Google); 15.1GB weights24GB GPU (L4, RTX 4090), 24GB+ MacBook Pro
E4B, UD-Q8_K_XL8.71GB12GB GPU, 16GB Mac
E4B, UD-Q4_K_XL5.13GB8GB GPU, 16GB Mac, CPU-only PC
E4B, LiteRT-LM (4/8-bit mixed)~4-5GB (Google recommends 12GB+ memory)Phones, tablets, desktops
E4B, Ollama medgemma2:e4b6.6-7.5GB8GB GPU, 16GB Mac

To check whether your own GPU or Mac can run it, the free VRAM calculator (no sign-up) estimates required VRAM from model, quantization and context length. MedGemma 2 is available in its model list.

Add the KV cache and runtime overhead (we assume 1-3GB) to the sizes above to get real memory needs; the KV cache is estimated below. For an MoE, weight memory is set by the total 25.2B parameters, not the 3.8B active: you cannot know in advance which experts a token will use, so all experts must be resident. Speed follows the active parameters; memory follows the total.

What is MedGemma 2? Model specs

MedGemma 2 starts from Gemma 4 and is further trained on medical text, medical images and FHIR-style electronic health record data. Google calls it its most capable open model for health AI developers. Inputs are text and images (including volumes and video); E4B also accepts audio (16kHz, up to 30 seconds). Output is text. The table below collects what the blog and model card state.

Item26B MoEE4B
Hugging Face IDgoogle/medgemma-2-26B-A4B-itgoogle/medgemma-2-e4b-it
Parameters25.2B total, 3.8B active (blog: "26B, 4B active")4.5B effective (~8B with per-layer embeddings)
ArchitectureMoE, 8 of 128 experts + 1 sharedDense
Layers3042
Sliding window1,024 tokens512 tokens
Context lengthUp to 256K input (validated at 128K per the card)Up to 128K
InputText, images, volumes, videoSame plus audio
Distributionbf16 (gated on Hugging Face)bf16 and LiteRT-LM (4/8-bit mixed)
Vocabulary~262K~262K

The official text is not fully consistent. The card mentions both 256K and 128K-validated for the 26B model, and lists active parameters as 3.8B in the spec table but "approximately 4B" in the overview. We read it as: 256K is the input limit, 128K is the range where quality was validated. Ollama lists 256K for the 26B tag and 128K for E4B.

How MedGemma 2 differs from earlier MedGemma

According to Google's blog, MedGemma 1 and 1.5 were limited mostly to simple question answering. MedGemma 2 changes three things.

- Gemma 4 base: adds a 26B MoE option that earlier versions did not have, and native audio input on E4B
- Native tool calling: built for multi-turn workflows with external tools. It generates SQL and FHIR queries against patient records and writes Python for clinical calculations (to be run and validated in a sandbox)
- Grounded answers with citations: trained to answer from supplied references and point to the passages

Google reports these gains over Gemma 4 (published figures): MedAgentBench accuracy +6% (26B) and +9% (E4B); AgentEHR F1 +31% (26B) and over 2.5x (E4B); MedCalc-Bench-Verified accuracy +10% (26B) and +56% (E4B); internal grounded clinical QA accuracy +5% (26B) and +11% (E4B).

Evaluation (26B MoE, published)MedGemma 2 26BGemma 4 26BMedGemma 1.5 4B
MIMIC-CXR (macro F1)89.884.989.5
CheXpert CXR (macro F1)51.249.348.2
PathMCQA (internal, accuracy)68.049.670.0
US-DermMCQA (internal, accuracy)77.270.273.5
MedAgentBench (success rate)86.381.3-
MedCalc-Bench Verified (accuracy)72.866.2-
Grounded clinical QA (internal, accuracy)95.690.813.1

These are the provider's own figures, evaluated mainly in English, and we found no independent reproduction at the time of writing. Performance on Japanese or other non-English clinical documents cannot be read from the official material, so evaluate on your own data.

Estimating VRAM: weights and KV cache

Weights for the 26B MoE are about 50.5GB in bf16 (matching 25.2B x 2 bytes) and 17GB for UD-Q4_K_XL. Google's "about 58GB" on the get-started page reads as weights plus KV cache and working memory.

The KV cache grows with context. MedGemma 2's config is gated and could not be read, so we use the Gemma 4 26B-A4B config.json, whose layer count (30), sliding window (1,024) and expert count (128) match the MedGemma 2 card. Of its 30 layers, 25 use sliding-window attention (8 KV heads, head_dim 256) and 5 use full-context attention (2 KV heads, head_dim 512). Assuming a bf16 KV cache, our calculation is:

- Sliding layers: 25 layers x 2 (K and V) x 8 heads x 256 x 2 bytes x 1,024 tokens = about 0.2GB (fixed, regardless of context length)
- Full-attention layers: 5 layers x 2 x 2 heads x 512 x 2 bytes = about 20KB per token
- 32K tokens: about 0.9GB (estimate, including the fixed 0.2GB)
- 128K tokens: about 2.9GB (estimate)
- 256K tokens: about 5.6GB (estimate)

This is an upper-leaning figure that stores K and V separately; Gemma 4 has a mode that shares them, so the real number may be smaller. It is not confirmed against MedGemma 2's own config, so verify on real hardware with nvidia-smi or ollama ps. The takeaway: even at 128K the 26B MoE's KV cache is under 3GB, so UD-Q4_K_XL (17GB) on a 24GB GPU should leave a few GB of headroom. Images also consume tokens (70 to 1,120 per image, 280 by default), so leave more room when passing many images.

For E4B, weights dominate. It has 42 layers and a short 512-token sliding window, so KV growth should be modest, but we could not confirm E4B's config. An 8GB GPU running UD-Q4_K_XL (5.13GB) with about 32K context is a safe starting point (estimate).

GPU and Mac guide (all estimates)

Hardware26B MoEE4B
8GB GPU (RTX 4060)Does not fit; works with experts offloaded to CPU, slowlyUD-Q4_K_XL (5.13GB) to UD-Q6_K_XL (7.42GB)
12GB GPU (RTX 3060)UD-Q2_K_XL (10.5GB), barely; quality dropsUp to UD-Q8_K_XL (8.71GB)
16GB GPU (RTX 4080)UD-Q3_K_M (12.7GB); Q4 needs CPU offloadBF16 (15.1GB) is marginal; Q8 is practical
24GB GPU (RTX 4090/3090)UD-Q4_K_XL (17GB) is standard; Q5 possibleRuns in BF16 (~18GB), Google's recommended setup
32GB GPU (RTX 5090)UD-Q8_K_XL (27.6GB) fitsPlenty
80GB GPUBF16 (~58GB), Google's recommended setupPlenty
16GB MacDoes not fitUD-Q4_K_XL to Q8_K_XL
32GB MacUD-Q4_K_XL (17GB) is practicalBF16 also fine
64GB+ MacComfortable through Q8 (27.6GB); BF16 (~50GB) is marginalPlenty

If memory is short: step down one quantization level, shorten the context, then lower image resolution (max_soft_tokens). The model card states that quantized and community-converted versions may perform differently from bf16 and should be validated separately. For medical use, checking that quantization has not degraded quality on your own data matters more than saving memory.

How to run it: Ollama, llama.cpp, Transformers

Ollama is the fastest route. The medgemma2 library page lists medgemma2:latest and medgemma2:e4b (6.6-7.5GB, 128K, text and image input) and medgemma2:26b (18-19GB, 256K). You can also point Ollama at Hugging Face GGUFs directly.

# Ollama (official library)
ollama run medgemma2:e4b
ollama run medgemma2:26b

# Pointing at Unsloth GGUFs directly
ollama run hf.co/unsloth/medgemma-2-26B-A4B-it-GGUF:UD-Q4_K_XL
ollama run hf.co/unsloth/medgemma-2-E4B-it-GGUF:UD-Q4_K_XL

For llama.cpp, Unsloth's page gives the commands below. The server exposes an OpenAI-compatible API and a web UI; the same page has Docker Model Runner and Lemonade examples. Because the architecture is new, update llama.cpp to the latest version if startup fails.

# OpenAI-compatible server (with web UI)
llama serve -hf unsloth/medgemma-2-26B-A4B-it-GGUF:UD-Q4_K_XL

# Terminal chat
llama cli -hf unsloth/medgemma-2-26B-A4B-it-GGUF:UD-Q4_K_XL

# Docker Model Runner
docker model run hf.co/unsloth/medgemma-2-26B-A4B-it-GGUF:UD-Q4_K_XL

The official weights live in a gated Hugging Face repository: accept the terms and authenticate with hf auth login. Transformers 5.15.0 or later is required. This is the model card's pipeline example for an image question.

pip install -U "transformers>=5.15.0" accelerate
hf auth login
from transformers import pipeline
from PIL import Image
import requests

pipe = pipeline(
    "image-text-to-text",
    model="google/medgemma-2-26B-A4B-it",
    device_map="auto",
    dtype="auto"
)

image = Image.open(requests.get("<image URL>", stream=True).raw)
messages = [
    {"role": "user", "content": [
        {"type": "image", "image": image},
        {"type": "text", "text": "Describe this X-ray"}
    ]}
]

output = pipe(text=messages, max_new_tokens=1024)
print(output[0]["generated_text"][-1]["content"])

To try E4B on a phone or an offline PC, Google points to the LiteRT-LM 4/8-bit mixed build (about 4-5GB). vLLM support is listed, but we did not verify it; the vLLM line below is our own example.

# LiteRT-LM (E4B, example from Google's get-started page)
pip install litert-lm
litert-lm run \
  --from-huggingface-repo=litert-community/medgemma-2-e4b-it-litert-lm \
  medgemma-2-e4b-it.litertlm \
  --backend=gpu \
  --prompt="Your prompt here"

# vLLM (our example; check official docs for version requirements)
vllm serve "google/medgemma-2-26B-A4B-it"

To change the context length in Ollama, follow the Ollama context length (num_ctx) guide. Ollama chooses a default context from available VRAM, so run ollama ps to check the real value before feeding long documents.

Recommended settings: thinking mode and tool calling

The model card and Unsloth's page recommend Gemma 4's default sampling (temperature 1.0, top_p 0.95, top_k 64). Thinking is off by default; add the <|think|> token to the start of the system prompt to turn it on. In Transformers, pass enable_thinking=True to apply_chat_template.

ItemRecommendation
Output length (thinking off)1,024-4,096 tokens
Output length (thinking on)8,192-16,384 tokens (up to 32K for agentic evaluation)
Validated context128K (architecture supports 256K)
Multi-turn historyKeep only final answers; do not re-add thoughts (except in tool-calling turns)
ImagesPlace images before the text
Image tokens (max_soft_tokens)70, 140, 280 (default), 560, 1,120; use 70 or 140 for multi-slice CT/MRI or whole-slide pathology

Tool calling can generate FHIR API queries, SQL, and Python for external execution. Always validate model-generated code and queries in a sandbox before running them. Google states that model-produced calculations should not be used directly for clinical decisions. With Transformers 5.15.0 or later, processor.parse_response parses thinking and tool-call output.

How it compares

AspectMedGemma 2 26B MoEMedGemma 2 E4BGemma 4 26B (general)
Total / active parameters25.2B / 3.8B4.5B effective (~8B total)26B / ~4B
4-bit-class size17GB (UD-Q4_K_XL)5.13GBSimilar (about 16-18GB)
InputText, images, videoSame plus audioText, images
TrainingExtra training on medical text, images, FHIRSameGeneral
LicenseHAI-DEF termsHAI-DEF termsApache 2.0
Best forMedical R&D and internal toolsOn-device and offline prototypesGeneral business use

For general-purpose use, Gemma 4 is easier to handle because its license is clear. MedGemma 2 is stronger on medical data and tool calling but comes with heavier terms. Per-size Gemma 4 requirements are in the complete Gemma 4 requirements reference, and running E4B on devices is covered in the Gemma 4 E4B edge deployment guide. For the same MoE reasoning at a larger scale, see Qwen4-35B-A3B requirements.

License and medical-use cautions

- License: not Apache 2.0 but the Health AI Developer Foundations (HAI-DEF) terms of use. Weights and parameters fall under these terms, and you must accept them on Hugging Face to download files. Only the accompanying source code (recipes, inference code) is under Apache 2.0
- Redistribution and API hosting: under the terms, offering the model through an API or the web counts as distribution. Distribution requires passing the use restrictions downstream, providing a copy of the terms, and marking modified files
- Use restrictions: the Prohibited Use Policy is incorporated by reference, and uses that could cause a regulator to treat Google as a medical-device manufacturer are prohibited. Clinical use (diagnosing or treating patients) may require regulatory authorization
- Commercial use: the terms do not address it explicitly. Conditions depend on how you use it, so read the full terms and the prohibited use policy first
- Not for direct clinical decisions: Google states outputs are not intended to directly inform diagnosis, patient management or treatment recommendations. Verify outputs independently and correlate with clinical findings
- Mental health is out of scope: mental and behavioral health applications are excluded
- Grounded answers can still be wrong: even with references supplied, unsupported content may appear
- Evaluation bias: evaluations were mainly in English, and performance may drop for underrepresented populations and image types. Evaluate on your own Japanese or local clinical data
- Privacy: running locally is a strong way to keep data in-house, but compliance with privacy and medical-information laws must be checked separately
- Quantized and converted versions: may differ from bf16, so validate them separately

Troubleshooting

- Out of memory: step down one quantization level, shorten the context, then lower image tokens (max_soft_tokens)
- Cannot download weights: the repository is gated. Accept the terms on Hugging Face and run hf auth login. Community GGUFs may not need authentication
- llama.cpp or Ollama will not start: the architecture is new, so update to the latest version
- Empty output or stray thoughts: check whether thinking mode is on or off and that earlier thoughts are not left in the history
- Image questions fail: put the image before the text. With llama.cpp GGUF builds, also download the vision projector (in the Unsloth 26B repo, mmproj-BF16.gguf, about 1.2GB) and pass it with --mmproj

FAQ

Does MedGemma 2 run on a 24GB GPU (RTX 4090)?

The 26B MoE should run at 4-bit class with UD-Q4_K_XL (17GB) (estimate). The KV cache is under 3GB even at 128K by our calculation, so a few GB of headroom remains. bf16 (~58GB) will not fit. E4B fits in bf16 (~18GB) on a 24GB GPU, which is also Google's recommended setup.

How much VRAM does it need?

Google's guidance is about 58GB for the 26B MoE in bf16 (80GB+ GPU recommended), about 18GB for E4B in bf16 (24GB+), and about 4-5GB for E4B 4/8-bit mixed (12GB+ memory recommended). In Unsloth GGUFs, the 26B is 17GB at Q4 and 27.6GB at Q8, and E4B is 5.13GB at Q4. Add the KV cache and working memory on top.

Can I use MedGemma 2 commercially?

It is governed by the Health AI Developer Foundations (HAI-DEF) terms of use and prohibited use policy, not Apache 2.0. The terms do not address commercial use explicitly, redistribution and API hosting come with conditions, and uses that could make Google a medical-device manufacturer are prohibited. Read the full terms before use.

Can I use it for diagnosis or treatment decisions?

No. Google states the outputs are not intended to directly inform diagnosis, patient management or treatment recommendations. It is a starting point for developers to validate and adapt, and outputs must be independently verified and correlated with clinical findings. Mental health applications are out of scope.

What is the Ollama command?

ollama run medgemma2:e4b (6.6-7.5GB) or ollama run medgemma2:26b (18-19GB) are listed. For Unsloth's GGUF use ollama run hf.co/unsloth/medgemma-2-26B-A4B-it-GGUF:UD-Q4_K_XL. Check the context with ollama ps and set num_ctx if needed.

How is it different from the original MedGemma?

It is built on Gemma 4 and adds a 26B MoE. Native tool calling (SQL and FHIR queries, Python generation), grounded answers with citations, and E4B audio input are new. Google says MedGemma 1 and 1.5 were limited mostly to simple question answering.

References

株式会社オブライト

Oflight Inc. is a Tokyo-based IT company providing software development, digital signage, web development, network systems, and IoT/AR/VR technology services.

Feel free to contact us

Contact Us