MedGemma 2: Google's open medical AI queries patient records and runs offline on phones
Google has released MedGemma 2, a family of open models for developers who build medical software. The models can query patient records, calculate clinical values with code and cite their sources. A small version runs fully offline on smartphones.

What's new
On December 3, 2026, Google released MedGemma 2, a family of open AI models for developers who build healthcare software. The models are based on Google's general-purpose Gemma 4 and were further trained on medical data. They come in two sizes:
- MedGemma 2 26B MoE for hospital servers and private clouds (on Hugging Face as
google/medgemma-2-26B-A4B-it), - MedGemma 2 E4B for smartphones, tablets, laptops and offline workstations.
The weights are available on Hugging Face and in Google Cloud's Model Garden. Google says they work with Hugging Face Transformers, vLLM, Ollama, Unsloth, llama.cpp and MLX. MedGemma 2 isn't a finished product for doctors. It's a set of building blocks for developers.
From Q&A model to clinical agent
The earlier MedGemma 1 and 1.5 mostly answered medical questions. MedGemma 2 is designed to handle multi-step workflows. Google calls this native tool calling: the model recognizes when it's missing information, calls the right tool (a database, for example) and keeps working with the result over several steps. It combines chain-of-thought (the model reasons step by step "out loud") with structured function calls. Google highlights three use cases:
- Querying patient records: The model writes SQL queries (the standard language for databases) and FHIR queries. FHIR (Fast Healthcare Interoperability Resources) is an international standard that clinical systems use to exchange patient data. This lets the model look up and analyze a patient's history.
- Calculating clinical scores: Many medical decisions depend on formulas, for example for kidney function or triage urgency. MedGemma 2 writes Python code for these that runs in a sandbox, an isolated environment where buggy code can't do any damage.
- Citing sources (grounding): The model bases its answers on documents you provide, such as clinical guidelines or medical literature, and points to the relevant passages. That way, doctors can check where a claim comes from.
The numbers
Google compares MedGemma 2 with the matching Gemma 4 base model (vendor figures from the Model Card, via Unite.AI):
| Benchmark | Variant | MedGemma 2 | Gemma 4 |
|---|---|---|---|
| MedAgentBench (success rate) | 26B | 86.3 | 81.3 |
| MedAgentBench (success rate) | E4B | 53.3 | 48.7 |
| MedCalc-Bench Verified (accuracy) | 26B | 72.8 | 66.2 |
| MedCalc-Bench Verified (accuracy) | E4B | 59.1 | 37.9 |
MedAgentBench consists of 300 physician-written tasks across 10 categories, plus profiles of 100 patients with more than 700,000 data points in a simulated FHIR record. MedCalc-Bench covers more than 1,000 hand-verified cases for 55 medical calculations. On the SQL benchmark AgentEHR, Google says the 26B model's F1 score (a measure of answer quality) improves by 31 percent in relative terms. The E4B model scores more than 2.5 times what Gemma 4 does. For grounding, Google reports relative gains of 5 percent (26B) and 11 percent (E4B) on an internal test.
Cryptobriefing puts the numbers in context: citing The Decoder, it notes that neither model beats the big frontier models Claude Opus 5 or GPT-5.6 Sol, and those aren't even the newest. Google is betting that clinics care more about running models locally than about topping leaderboards. Cryptobriefing calls the small model's 37.9 percent the score of its "predecessor". According to the Model Card, though, it's the score of the base model, Gemma 4 E4B.
Two sizes, very different hardware
The large model is a Mixture-of-Experts (MoE). Think of it as a hospital full of specialists, where only a few get called in for each case. Of its roughly 26 billion parameters (25.8 according to Hugging Face), only about 4 billion are active per token. That makes it respond faster than a "dense" model of the same size, but the whole thing still has to fit in memory.
| 26B MoE (16-bit) | E4B (16-bit) | E4B mixed 4/8-bit (.litertlm) | |
|---|---|---|---|
| Memory required | approx. 58 GB | approx. 18 GB | approx. 4–5 GB |
| Target hardware | one 80 GB GPU (A100, H100, RTX PRO 6000) | 24 GB GPU (L4, RTX 4090) or a Mac with 24 GB or more | Android and iOS devices, desktop (CPU, GPU, Pixel TPU) |
| Use case | multi-step reasoning, many concurrent users | full quality, fine-tuning | offline apps |
The E4B is a dense model with an effective 4 billion parameters. For phones, Google offers a mixed-precision version via LiteRT-LM, its runtime for on-device AI. Particularly sensitive layers are stored at higher precision. Google names the Pixel 11 Pro and Samsung Galaxy S26 as example devices. Both models are validated for a 128,000-token context window, and the 26B architecture supports up to 256,000.
Both variants handle text and images. On audio, the sources disagree: Cryptobriefing says both models understand audio, while Unite.AI says only the E4B supports medical voice recordings and dictation transcription.
What you need to try it
- 26B model at full quality: a GPU with 80 GB (A100/H100). That's data center territory, not a home PC.
- 26B model, compressed: With 4-bit quantization, which shrinks a model by storing its numbers at lower precision, roughly 16–18 GB of VRAM (video memory) is realistic. That's our estimate; Google gives no official figure. A 24 GB card like the RTX 4090 or a Mac with 32 GB of unified memory should do. Google hasn't published its own GGUF file on Hugging Face yet, the common format for llama.cpp and Ollama.
- E4B: at 16-bit, a 24 GB card or a Mac with at least 24 GB. Compressed, 4–5 GB is enough, so a recent smartphone or an ordinary laptop will do.
- The weights are released under the Health AI Developer Foundations (HAI-DEF) terms. You usually have to accept them on Hugging Face before downloading.
Limits and liability
Google is unusually blunt: MedGemma 2 is not an approved medical device. Its output shouldn't feed directly into diagnosis, treatment or clinical calculations and must be independently verified. Answers with citations are only as good as the documents provided and can still contain unsupported claims. Developers are responsible for access control, security and for vetting generated code, database queries and connected tools.
The training data included public, private, licensed, de-identified and synthetic data. The Model Card warns that underrepresented populations, care settings, languages and imaging devices can lead to biased or unreliable answers. Safety testing was mostly done with English prompts, and the clinical safety evaluations before launch covered text only, not images or audio. That matters if you plan to use it in non-English settings.
Background
Google released the first MedGemma version in 2025. According to Google, it has since been downloaded more than 10 million times by over 60,000 users. More than 1,000 derivative models have been built on it, more than 2,000 publications cite it, and the underlying research was published in Nature Medicine. To get started, Google offers the "HAI-DEF Cookbook" with code samples, tutorials on fine-tuning and conversion, and ready-made .litertlm files on Hugging Face.
Our take
MedGemma 2 isn't the smartest medical model, and Google doesn't claim it is. The real progress is elsewhere: an open model that can query patient records, run calculations and cite sources, entirely on your own hardware. That matters for hospitals, because patient data never has to leave the building, or even the device. It makes data protection far simpler. Cryptobriefing sees big opportunities for rural practices and regions with poor internet access, where a 4–5 GB offline model can really help.
At the same time, the numbers show the limits. A 59.1 percent score on MedCalc-Bench means the small model gets four out of ten calculations wrong. All benchmarks come from Google, several results are only given as relative improvements over Gemma 4, and one internal test can't be independently verified. The license deserves a close look too. Despite what some reports suggest, the weights aren't simply Apache 2.0; they come with the additional HAI-DEF terms. Still, for healthcare developers, MedGemma 2 is currently one of the most interesting open foundations around. Whether it leads to safe applications will depend on vetting every single deployment.
Related videos
Sources
- Hugging Face Trending huggingface.co
- Google News (BR) pasqualepillitteri.it
- Google News (DE) pasqualepillitteri.it
- cryptobriefing.com cryptobriefing.com
- unite.ai unite.ai
- research.google research.google
- Bing News (en-US) letsdatascience.com
- ITHome (CN) ithome.com
- Google News (NG) news.google.com
- Bing News (en-US) interestingengineering.com
- Bing News (en-GB) rdworldonline.com
- Bing News (en-GB) cryptopolitan.com
- Google News (NL) news.google.com
Try it yourself: MedGemma 2 26B-A4B-it
Explained step by step, no prior knowledge needed – on your own computer or free in your browser.
What can I do with it?
MedGemma 2 is Google's medical language and vision model. It answers medical questions, but its real strength is working with tools: it writes database queries (SQL, FHIR) to look up patient data, generates Python code for clinical formulas and scores, and grounds its answers in documents you give it, with citations. It also understands images such as photos or scans. It scores measurably better than regular Gemma 4 on medical benchmarks, but it doesn't match big commercial models like Claude Opus 5 or GPT-5.6 Sol. It is explicitly not a medical device and doesn't replace a doctor. Always verify its output.
Who is it worth it for?
It's worth a look for developers, researchers and students building medical software, documentation tools or learning aids who want to keep data local. If you're interested in medicine, you can experiment with it too, for example to summarize medical papers. It's not suitable for diagnosing yourself or making treatment decisions. If you just want a general chatbot, a regular model will serve you better.
Ideas: What you can do with it
Load a clinical guideline into the context and ask questions about it. The model answers with quotes from the document, so you can quickly check every claim.
Have it write Python functions for common clinical scores and test them with sample data. You'll get a working prototype fast, but it needs expert review before any real-world use.
Students can have it explain case studies, lab values or conditions and practice exam questions. Since everything runs locally, your own study material stays private.
Paste in de-identified doctor's letters and have them organized by diagnoses, medications and open questions. It saves time on documentation, but you still need to check the results.
Research teams can generate SQL or FHIR queries for test databases, such as "all patients with diabetes and elevated creatinine". Then run the queries in a secure test environment.
What your computer needs
Which variant is right for me?
Many models come in several sizes or "quantizations." These are compressed versions: smaller and faster, but slightly less accurate. Rule of thumb: pick the largest variant whose memory requirement fits in your VRAM (video memory). The scripts below choose this for you automatically.
| Variant | Download | Needs approx. | Compatible graphics cards |
|---|---|---|---|
UD-Q2_K_XL |
10 GB | 13 GB | e.g. RTX 4060 Ti 16 GB, RTX 4080, RTX 5080, RX 7800 XT |
UD-Q3_K_XL |
13 GB | 16 GB | e.g. RTX 4060 Ti 16 GB, RTX 4080, RTX 5080, RX 7800 XT |
UD-Q4_K_XL Default |
17 GB | 20 GB | e.g. RTX 3090, RTX 4090, Tesla P40 |
UD-Q5_K_XL |
21 GB | 24 GB | e.g. RTX 5090 |
UD-Q6_K_XL |
23 GB | 27 GB | e.g. RTX 5090 |
UD-Q8_K_XL |
28 GB | 32 GB | e.g. RTX 5090 |
BF16 |
50 GB | 57 GB | e.g. multiple professional GPUs (2× A6000, H100) or DGX Spark |
The 26B MoE model covered here needs about 58 GB at full 16-bit precision, so you'll need an 80 GB professional card (A100, H100, RTX PRO 6000). A 4-bit version should need roughly 16–18 GB, enough for a 24 GB card like the RTX 4090 or a Mac with 32 GB (our estimate, not a Google figure). With less hardware, go for the smaller MedGemma 2 E4B: about 18 GB at 16-bit (24 GB GPU or a Mac with 24 GB or more), or just 4–5 GB as a mixed 4/8-bit version (.litertlm), which even runs on recent smartphones.
- 26B MoE at 16-bit: approx. 58 GB of memory; per Google, a single GPU with 80 GB or more (A100, H100, RTX PRO 6000).
- Only about 4B parameters are active per token, but the whole model still has to fit in memory. Compressed (4-bit), you'll need roughly 16–18 GB.
- E4B at 16-bit: approx. 18 GB; runs on a 24 GB GPU (L4, RTX 4090) or a MacBook Pro with at least 24 GB.
- E4B mixed 4/8-bit via LiteRT-LM: approx. 4–5 GB; runs on Android/iOS (e.g. Pixel 11 Pro, Galaxy S26) and desktop CPU/GPU.
- Context is validated up to 128,000 tokens. Long records and guidelines in the context eat up a lot of extra memory.
Gated access: You need a free Hugging Face account. Log in on the model page and accept the license. Then create an access token (type Read) at huggingface.co/settings/tokens and run hf auth login once before you start.
How do I find out what my computer has?
- Windows: Press Ctrl + Shift + Esc → Task Manager → Performance tab → click GPU on the left. At the bottom you'll see Dedicated GPU memory (that's your VRAM). You'll find system memory under Memory.
- Mac: Apple menu at the top left → About This Mac. You'll see your chip (e.g. M2) and memory (e.g. 16 GB). On Apple chips, graphics and processor share this memory.
- Linux: Type
nvidia-smiin the terminal (shows your graphics card and its memory) andfree -hfor system memory.
Guide
Google Colab (in your browser, no installation)
Google Colab is a free service from Google. It gives you a computer with a graphics card in your browser for a few hours. All you need is a Google account. For this model: runs for free – The free Tesla T4 GPU with 15 GB is enough.
- Download the notebook. Click the button and save the file.
- Open Colab. Go to colab.research.google.com and sign in with your Google account.
- Upload the notebook. In the window that appears, click Upload on the left (or choose File → Upload notebook at the top) and select the file
colab.ipynb. - Turn on the GPU. In the top menu, go to Runtime → Change runtime type → under Hardware accelerator, select T4 GPU → Save.
- Start everything. Runtime → Run all (keyboard shortcut Ctrl + F9). If you see the warning “This notebook was not authored by Google,” click Run anyway.
- Wait. The cells run one after another. A green checkmark appears to the left of each cell when it's done. Installation and download take about 10 minutes here.
- Try it out. The result appears below the last cell. To test something else, change the text in the cell and run it again with Shift + Enter. The last cell starts a proper chat with an input field.
- Clean up. When you're done: Runtime → Disconnect and delete runtime. This saves your free quota.
Good to know: The free GPU is limited (usually a few hours per day). After about 90 minutes of inactivity, Colab disconnects, and you'll have to start everything over.
Windows 10 / 11
The easiest way is Ollama, a free program that launches AI models with a single command.
- Update your graphics driver (NVIDIA cards only): Install the NVIDIA app or the latest driver. For AMD cards, use the latest Adrenalin driver.
- Install Ollama. Download the file OllamaSetup.exe from ollama.com/download/windows, double-click it, and choose Install. Afterward, a small llama icon appears in the taskbar at the bottom right.
- Open a terminal window. Press the Windows key, type PowerShell and press Enter. A blue or black window opens.
- Start the model. Copy this command ("Copy" button), paste it into the window with a right-click, and press Enter:
The first time, Ollama downloads the model (17 GB (about 23 min at 100 Mbit/s)). After that, it's instant.ollama run hf.co/unsloth/medgemma-2-26B-A4B-it-GGUF:UD-Q4_K_XL - Start typing. Once
>>> Send a messageappears, type your question and press Enter. Type/byeto end the chat.
Not enough memory? Pick a smaller variant from the table above, e.g. ollama run hf.co/unsloth/medgemma-2-26B-A4B-it-GGUF:UD-Q2_K_XL.
Prefer automatic? A script that picks the right variant for you
- Download both files into the same folder: try_windows.ps1 demo.py
- Open the folder in File Explorer, right-click an empty spot and choose Open in Terminal.
- Paste this command and press Enter:
powershell -ExecutionPolicy Bypass -File try_windows.ps1
If needed, the script installs Ollama via winget, measures your VRAM (video memory) and downloads the matching variant.
macOS
Macs with an Apple chip (M1 to M5) are ideal. Older Intel Macs are very slow.
- Install Ollama. Download it from ollama.com/download/mac, open the file, and drag Ollama into your Applications folder. Launch Ollama once – a llama appears in the menu bar at the top.
- Open Terminal. Press Cmd + Space, type Terminal, and press Enter.
- Start the model. Paste the command (Cmd + V) and press Enter:
The first time, the model is downloaded (17 GB (about 23 min at 100 Mbit/s)).ollama run hf.co/unsloth/medgemma-2-26B-A4B-it-GGUF:UD-Q4_K_XL - Start typing. Type your question and press Enter. Quit with
/bye.
Linux
- Check your GPU.
nvidia-smishould show your card. If it doesn't, install the driver on Ubuntu and restart:sudo ubuntu-drivers install - Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh - Start the model:
Exit withollama run hf.co/unsloth/medgemma-2-26B-A4B-it-GGUF:UD-Q4_K_XL/bye. Useollama psto check whether the model is running on the GPU. - Or let it pick the right variant automatically:
bash try_linux.sh # mit Python/transformers statt Ollama: MODE=hf bash try_linux.sh
Try it
Explain in simple terms what the HbA1c value tells you and which values are considered normal.Write Python code that calculates BMI and estimated glomerular filtration rate (eGFR using CKD-EPI) from age, sex, height, weight and creatinine.Here's an excerpt from a guideline: [paste text]. At what blood pressure is treatment recommended? Quote the relevant passage.Write a FHIR query that retrieves all lab results from the last six months for the patient with ID 12345.Summarize this discharge letter in a structured way by diagnoses, medication and open issues, and flag where information is missing: [paste text]
Tips for better results
- Give the model the source, such as a guideline or a paper, and explicitly ask for citations. Grounding is one of MedGemma 2's core strengths.
- Have it output calculations as Python code and run the code yourself instead of trusting the model's mental math.
- For complex questions, English prompts may give more accurate results, since training and testing were mostly in English.
- Check out Google's HAI-DEF Cookbook. It has code samples for typical workflows like record lookup and tool calling.
If something goes wrong
The weights are covered by the HAI-DEF terms of use. You need to sign in on Hugging Face and accept the terms before the download starts.
Google doesn't provide an official GGUF on Hugging Face. For llama.cpp or Ollama, you'll need a community conversion or have to convert it yourself.
The model uses the new Gemma 4 architecture. Use current versions of transformers, vLLM, llama.cpp or Ollama, or it won't be recognized.
Only run generated code and database queries in a sandbox, and never let them loose on real patient data without review.
Safety testing was mostly done in English. Answers in other languages may be less reliable, so always double-check medical terms and values.
“out of memory,” a crash, or your computer freezes
The model is too big for your VRAM (video memory). Pick a smaller variant from the table above and close other programs, especially games and browsers with lots of tabs.
It runs, but extremely slowly
Your CPU is probably doing the work instead of your graphics card. In Ollama, the PROCESSOR column of ollama ps shows how much runs on the GPU. If it says "100% CPU", update your graphics driver or pick a smaller variant that fits entirely into VRAM (video memory).
“ollama” or “python” is not found
Close the terminal window and open it again so it recognizes the newly installed program. For Python on Windows: reinstall it and check Add python.exe to PATH.
Windows: "Running scripts is disabled on this system"
Run the script with exactly the command above: powershell -ExecutionPolicy Bypass -File try_windows.ps1. This allows execution for this one time only.
Error message when loading the model (version, "trust_remote_code", unknown architecture)
Brand-new models often need the latest software version. With Ollama: update Ollama. With Python: pip install -U transformers in the activated environment. The Model Card usually lists the exact version.
Tokenstrom generates the scripts and notebook automatically. Please take a quick look before running them – they're plain, readable text. Mind the model's license: custom license (see Model Card).
Ask the AI assistant
Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.
The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.
Comments
What do you think? Already tried it? Write it here, no sign-up needed.
Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.