TL;DR The short version
- Five builds: record queries, clinical calculations, cited protocol answers, document extraction and an offline assistant.
- The model proposes, ordinary software checks, and a qualified person decides.
- Start with invented patients and measure invented values and correct refusals before a pilot.
In this post
- TL;DR
- What rule applies to all five?
- Use case 1: ask questions of patient records
- Use case 2: calculate clinical scores with code
- Use case 3: answer from your own protocols with citations
- Use case 4: turn documents into structured data
- Use case 5: an offline assistant at the point of care
- How can you use it if you are not a developer?
- What should you measure before a pilot?
- Frequently asked questions
- Related reading
- Sources and further reading
Short answer: five practical things to build with MedGemma 2 are record queries through tools, clinical score calculations run as code, answers that cite your own protocols, document extraction and an offline assistant. In each one the model proposes, ordinary software checks, and a qualified person decides.
What rule applies to all five?
MedGemma 2 is a starting point for developers, not a clinical tool. Google says its outputs are not intended to directly inform diagnosis, patient management or treatment, and need independent verification. Use synthetic or properly de-identified data while you build.
Build every use case on invented patients first. Set up the model with Ollama before you start.
Use case 1: ask questions of patient records
Google says MedGemma 2 can generate FHIR and SQL queries and handle several rounds of tool calls. Give it narrow, read-only functions instead of database access.
Write one read-only tool. Return only the fields the question needs. This one uses made-up data.
def get_latest_lab(patient_id: str, test: str) -> str: """Latest lab result for a patient. Args: patient_id: Patient identifier test: Lab test name, for example creatinine """ fake = {('demo-1', 'creatinine'): '1.4 mg/dL on 2026-11-30'} return fake.get((patient_id, test.lower()), 'no result found')Let the model call it. The model asks for the tool, your code runs it, and the result goes back for the answer.
from ollama import chat messages = [{'role': 'user', 'content': 'What is the latest creatinine for patient demo-1?'}] r = chat(model='medgemma2', messages=messages, tools=[get_latest_lab]) messages.append(r.message) for call in r.message.tool_calls or []: if call.function.name == 'get_latest_lab': messages.append({'role': 'tool', 'tool_name': 'get_latest_lab', 'content': get_latest_lab(**call.function.arguments)}) print(chat(model='medgemma2', messages=messages).message.content)Enforce access outside the model. Check in code that this user may see this patient. Never rely on the prompt for permission.
Log and test. Record each call and result. Include a missing result and a wrong patient ID in your tests.
Use case 2: calculate clinical scores with code
Google’s example has the 26B model reason about a creatinine clearance case and write Python, which a separate sandbox runs.

Ask for code, not a number. Request Python that stores the result in one named variable.
Run it with no network. Treat generated code as untrusted. Save it as calc.py and run it in a throwaway container.
docker run --rm -i --network none --read-only --memory 256m --cpus 1 \ python:3.12-slim python - < calc.pyCompare with a reviewed formula. For scores you use often, keep your own tested function and flag any difference. This reproduces Google’s example case.
def crcl_female_adjusted(age, height_cm, weight_kg, creatinine_mg_dl): ibw = 45.5 + 2.3 * (height_cm / 2.54 - 60) adjusted = ibw + 0.4 * (weight_kg - ibw) # for overweight patients return (140 - age) * adjusted / (72 * creatinine_mg_dl) * 0.85 assert round(crcl_female_adjusted(49, 155.5, 61.0, 1.4), 1) == 41.0Show the working. Display inputs, units and formula to the clinician, not only the result.
Use case 3: answer from your own protocols with citations
Collect approved documents. Use current versions with an owner and a review date.
Retrieve before you ask. Search the documents, then place only the matching passages in the prompt, each with an ID.
Demand a citation or a refusal. Use an instruction like this one.
Answer only from the passages below. After each claim give the passage ID in brackets. If the passages do not answer the question, reply: not covered in the supplied documents.Verify the citation in code. Reject answers that cite an ID you did not send, and let the reader open the passage.
Use case 4: turn documents into structured data
Ollama’s page lists PDF to FHIR or JSON extraction and clinical coding such as LOINC.
Get the text or page image. Convert the PDF with a normal library, or send page images.
Extract against a schema. Allow empty values so the model is not pushed to invent them. The setup guide shows the code.
Validate every field. Check units, ranges, dates and that each value appears in the source.
Confirm codes against the official list. Look up each suggested code in your terminology service. Do not accept a code because it looks right.
Route doubts to a person. Anything failing a check goes to a review queue.
Use case 5: an offline assistant at the point of care
The E4B model is small enough for phones, tablets and laptops, which matters where connectivity is poor.
Choose the build. Take the E4B checkpoint for LiteRT-LM. Google gives about 4 to 5 GB of inference memory for the mixed 4-bit and 8-bit build.
Limit the scope. Reference lookup, note drafting or form filling, with a visible statement of what it must not be used for.
Test on the real device. Measure speed, battery, heat and accuracy on the cheapest device you will support.
Plan updates and loss. Encrypt stored data, require a lock screen and decide how a new model version reaches offline devices.
How can you use it if you are not a developer?
- Clinicians: supply realistic de-identified test cases and mark the answers. That is the most valuable input a project can get.
- Managers: ask for the error count, the review step and the named owner before a pilot.
- Students: use it to practise query writing and evaluation on synthetic records, and check facts against textbooks and guidelines.
- Security and compliance teams: map data flows, retention and access, and check the rules that apply to medical software where you work.
What should you measure before a pilot?
| Measure | Question it answers |
|---|---|
| Correct on your test set | Does it do the task? |
| Made-up values per 100 cases | How often does it invent? |
| Correct refusals | Does it say when data is missing? |
| Citation accuracy | Does the cited text support the claim? |
| Reviewer time per case | Does it save work after checking? |
| Results by patient group | Is anyone served worse? |
Sources were read on 4 December 2026. We have not benchmarked or run MedGemma 2 ourselves, and tags, sizes and terms can change, so check the linked originals.
Frequently asked questions
- What is MedGemma 2 used for? Building health software that queries records, runs calculations, grounds answers in sources, extracts data and reads some kinds of medical image.
- Can it write orders into a record? Only if your software lets it. Keep write actions behind explicit human approval.
- Can I fine-tune it? Google publishes fine-tuning notebooks at github.com/google-health/medgemma.
Related reading
Sources and further reading
- Google Research. Fereshteh Mahvar and Maddie Traverse. Introducing MedGemma 2: Our most capable open model for health AI developers. 3 December 2026. https://research.google/blog/introducing-medgemma-2-our-most-capable-open-model-for-health-ai-developers/
- Google. Gaurav Mohta and Daniel Golden. Introducing MedGemma 2: our most advanced open model for healthcare. 3 December 2026. https://blog.google/innovation-and-ai/technology/health/medgemma-2/
- Ollama. medgemma2 library page and tags. https://ollama.com/library/medgemma2
- Ollama documentation: tool calling. https://docs.ollama.com/capabilities/tool-calling
- Google Health. MedGemma notebooks. https://github.com/google-health/medgemma
- Google. Health AI Developer Foundations terms of use. https://developers.google.com/health-ai-developer-foundations/terms
Cite this article
Go deeper: AIP™ credential · the TPBOK™ standard · Domain: Applied AI & Emerging Tech Integration · Check your experience
IICTP is an independent technical credentialing body.
Practitioners on Contour
New guides in your inbox
Plain-language guides on technical practice, now and then. You confirm your address first, and you can unsubscribe at any time.