MedGemma 2 26B-A4B: Agentic Clinical Vision & FHIR Guide

MedGemma 2 26B-A4B (google/medgemma-2-26B-A4B-it) is a Mixture-of-Experts clinical vision-language model built on Gemma 4 with 25.2B total parameters and 3.8B active parameters per token. Validated up to 128K context (256K max), it reaches 86.3% on MedAgentBench and 72.8% on MedCalc-Bench-Verified for hospital EHR and imaging workflows.
MedGemma 2 26B-A4B: Agentic Clinical Vision & FHIR Guide: MedGemma 2 26B-A4B (google/medgemma-2-26B-A4B-it) is a Mixture-of-Experts clinical vision-language model built on Gemma 4 with 25.2B total parameters and 3.8B active parameters per token. Validated up to 128K context (256K max), it reaches 86.3% on MedAgentBench and 72.8% on MedCalc-Bench-Verified for hospital EHR and imaging workflows. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 3.8B Active Compute Across 25.2B Weights: Runs in ~58 GB BF16 VRAM on a single 80 GB A100/H100 or RTX Pro 6000 while keeping sparse MoE token latency low.
- Agentic EHR & FHIR Native Tuning: Completes 86.3% of MedAgentBench tasks (+5.0 pp over Gemma 4 26B) and delivers a +31% relative F1 boost on SQL-based AgentEHR.
- Verified Clinical Calculation Accuracy: Scores 72.8% on MedCalc-Bench-Verified versus 66.2% for Gemma 4 26B base by pairing structured reasoning with code-verified scoring.
- Canonical Gemma 4 Tool-Calling Template: Ships deterministic turn closures, thinking-block ordering, and nested parameter schema declarations without tool-loop hangs.
import { createAgent } from '@smoke-monkey/harness';// On-premises clinical triage & FHIR lookup agent backed by MedGemma 2 26B-A4Bconst agent = createAgent({agentId: 'medgemma2-clinical-verifier',provider: 'openai-compatible',baseUrl: 'http://127.0.0.1:8000/v1',model: 'google/medgemma-2-26B-A4B-it',workspacePath: process.cwd(),mcpServers: {fhirSandbox: {command: 'npx',args: ['-y', '@modelcontextprotocol/server-postgres', process.env.FHIR_READONLY_DSN || 'postgres://localhost:5432/fhir_dev'],},},permissions: {read_file: 'allow',write_file: 'ask',run_command: 'ask',},});async function main() {const result = await agent.run('Query the synthetic FHIR observation table for latest creatinine labs, compute CKD-EPI eGFR, and cite KDIGO guidelines.');console.log('Clinical Summary:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
MedGemma 1.5: Google's Open-Source Medical AI with 3D Imaging (Tutorial)
Introducing MedGemma 2
What Is MedGemma 2 26B-A4B and How Does Its Gemma 4 MoE Architecture Work?
MedGemma 2 26B-A4B is Google's open-weights clinical Mixture-of-Experts model (google/medgemma-2-26B-A4B-it) built directly on the Gemma 4 decoder-only transformer layout. Containing ~25.2B total parameters while activating only 3.8B parameters per token, it transitions medical AI from passive question-answering into multi-step EHR tool calling and imaging analysis.
Unlike the smaller 4B-E4B variant that includes native audio encoding, MedGemma 2 26B-A4B specializes in high-throughput text, 2D radiographs, 3D volumetric scans (CT/MRI series), and clinical video frames across a 256K-token architectural ceiling (validated to 128K tokens). Full BF16 weights occupy roughly 58 GB of memory, fitting cleanly on an 80 GB A100/H100 or 96 GB RTX Pro 6000 workstation inside hospital firewalls.
| Benchmark / Specification | MedGemma 2 26B-A4B | Gemma 4 26B Base | Operational Significance |
|---|---|---|---|
| Total / Active Parameters | ~25.2B total / 3.8B active | ~25.2B total / 3.8B active | 4B-class decode latency with 25B capacity |
| MedAgentBench (EHR Tasks) | 86.3% | 81.3% | +5.0 pp end-to-end FHIR workflow completion |
| AgentEHR (SQL F1 Gain) | +31% relative F1 | Baseline | Higher schema adherence on clinical joins |
| MedCalc-Bench-Verified | 72.8% | 66.2% | Stronger multi-step clinical score computation |
| BF16 Memory Footprint | ~58 GB (80 GB+ GPU target) | ~58 GB | Single-GPU on-prem deployment without NVLink |
Serving MedGemma 2 26B-A4B Locally With vLLM and HAI-DEF Guardrails
Because MedGemma 2 26B-A4B is gated under Google's Health AI Developer Foundations (HAI-DEF) terms, production clusters authenticate via Hugging Face tokens and serve the model over an internal vLLM instance using the July 2026 Gemma 4 canonical Jinja chat template. That updated template fixes turn-closure markers and separates internal reasoning blocks from structured declaration:name{...} tool arguments.
# 1. Authenticate with HAI-DEF license accepted on Hugging Face
export HF_TOKEN="hf_your_hospital_token"
# 2. Launch vLLM on a single 80GB H100/A100 with 128K validated context
vllm serve "google/medgemma-2-26B-A4B-it" \
--dtype bfloat16 \
--max-model-len 131072 \
--enable-auto-tool-choice \
--tool-call-parser gemma4 \
--port 8000
# 3. Smoke-test structured tool declaration output
curl -s http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "google/medgemma-2-26B-A4B-it",
"messages": [{"role": "user", "content": "Compute Wells score for DVT given active cancer and calf swelling > 3cm."}],
"temperature": 0.1
}'Mandatory HAI-DEF Clinical Verification Gate
MedGemma 2 weights are not certified as an autonomous Software as a Medical Device (SaMD). Always enforce read-only EHR permissions, deterministic SQL/FHIR validators, and clinician sign-off before mutating patient records.
Frequently Asked Questions
Q:How much VRAM is required to run MedGemma 2 26B-A4B locally?
At native 16-bit bfloat16 precision, the 25.2B parameter checkpoint occupies roughly 58 GB of VRAM, requiring an 80 GB A100/H100 or 96 GB RTX Pro 6000 GPU once KV cache buffers for 32K-128K context are allocated.
Q:Does MedGemma 2 26B-A4B support audio inputs like MedGemma 2 4B-E4B?
No. The 26B-A4B MoE variant handles text, 2D medical images, 3D image volumes, and video frames, whereas native audio encoding is reserved for the smaller 4B-E4B model.
Q:How does MedGemma 2 improve over MedGemma 1.5 for AI agents?
MedGemma 2 shifts from passive multimodal QA to agentic tool execution, scoring 86.3% on MedAgentBench, 72.8% on MedCalc-Bench-Verified, and +31% relative F1 on SQL-based AgentEHR benchmarks.
Q:Which chat template fix ships inside google/medgemma-2-26B-A4B-it?
It embeds the Google Gemma 4 Canonical Chat Template (published 2026-07-09), which resolves multi-turn tool-calling loops, strict turn closures, and thinking-token ordering.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.