<br />

Reference implementations provide educational examples built around Google's
Health AI Developer Foundations (HAI-DEF) models: narrow Python technical
building blocks in the open-source **HAI-DEF Cookbook** and single-task **demo
apps**. Each resource shows software techniques for specific technical problems
and is an educational starting point, not a complete or clinically validated
application.

### HAI-DEF Cookbook New

⚠ Caution **Educational starting points, not a complete or verified solution.** This codebase shows software techniques for narrow technical problems. The code is not production-grade nor validated for clinical use, and does not define a clinical workflow or intended use. To use the code, you need to set up your runtime environment, adapt it to your programming language (it is written in Python), harden and validate your application, and run it against your own instance of HAI-DEF models that you have separately fine-tuned, localized, and evaluated according to your requirements. Code is licensed under Apache 2.0 and provided "as is", without warranty; use of MedGemma or other HAI-DEF model weights remains governed by the [HAI-DEF Terms of Use](https://developers.google.com/health-ai-developer-foundations/terms.md.txt) and [Prohibited Use Policy](https://developers.google.com/health-ai-developer-foundations/prohibited-use-policy.md.txt).

The **HAI-DEF Cookbook** is an open-source (Apache 2.0) collection of narrow Python code scaffoldings built around open-weight HAI-DEF models, each showcasing one possible software technique for a specific technical problem. Every folder includes runnable examples, synthetic or openly licensed sample data, unit tests, and AI coding-agent guides (`AGENTS.md`).

#### On-device technical building blocks

Offline recipes built around [MedGemma 2 E4B 4/8-bit mixed precision](https://developers.google.com/health-ai-developer-foundations/medgemma.md.txt) ([`.litertlm`](https://huggingface.co/litert-community/medgemma-2-e4b-it-litert-lm)) with [LiteRT-LM](https://developers.google.com/edge/litert-lm/overview.md.txt) in an agentic configuration, runnable comfortably on devices with 12 GB+ of memory. See the [on-device quickstart on GitHub](https://github.com/Google-Health/cookbook/blob/main/edge_care/README.md) for architecture, tests, and sample data.

| Recipe | Technical problem it solves | Supporting models |
|---|---|---|
| [Deterministic calculator tools](https://github.com/Google-Health/cookbook/blob/main/edge_care/recipes/calculators.md) | Keep arithmetic out of the model: extract typed inputs from text, call deterministic Python functions, and report their results | None |
| [Rule-table tool calling](https://github.com/Google-Health/cookbook/blob/main/edge_care/recipes/rule_table_tool_calling.md) | Map free text onto a deterministic rule table's boolean arguments and relay its fixed label and text unchanged | None |
| [Three input paths in one session](https://github.com/Google-Health/cookbook/blob/main/edge_care/recipes/multi_input_session.md) | Serve a rule-table tool call, a direct image prompt, and human-reviewed transcript text in one offline process | [MedASR](https://developers.google.com/health-ai-developer-foundations/medasr.md.txt) |
| [Local guideline retrieval](https://github.com/Google-Health/cookbook/blob/main/edge_care/recipes/guideline_lookup.md) | Retrieve passages from a local [SQLite](https://www.sqlite.org/) vector index by on-device cosine similarity, quote them with printed page numbers, and abstain below a threshold | [EmbeddingGemma 2](https://huggingface.co/google/embeddinggemma-2) (Apache 2.0) |
| [Read a table from a photo](https://github.com/Google-Health/cookbook/blob/main/edge_care/recipes/lab_report_photo.md) | Transcribe printed table rows verbatim from a document photograph using vision input alone, with no tool calls | None |
| [Document → JSON](https://github.com/Google-Health/cookbook/blob/main/edge_care/recipes/document_extraction.md) | Extract a photographed or scanned image or PDF page into a fixed JSON schema locally, with no server or terminology lookup | None |
| [Document → FHIR R4](https://github.com/Google-Health/cookbook/blob/main/edge_care/recipes/mdt_document_to_fhir.md) | Run the open-source Medical Data Toolkit 4-stage pipeline (render, segment, extract Pydantic models, serialize HL7® FHIR® R4 Bundles) on-device | None |
| [Audio transcription hand-off](https://github.com/Google-Health/cookbook/blob/main/edge_care/recipes/medical_audio_transcription.md) | Transcribe English WAV audio with a separate ASR model, require human review of the transcript, and pass only reviewed text (never audio) to the LLM | [MedASR](https://developers.google.com/health-ai-developer-foundations/medasr.md.txt) |

[View the HAI-DEF Cookbook on GitHub ↗](https://github.com/Google-Health/cookbook#readme)

### Demo apps

Demo applications These first-party demo applications are designed to showcase what can be built with HAI-DEF tools, and they include interactive user interfaces and full code. They are for illustrative purposes and don't represent finished products. Any real-world applications would require additional development, training, and adaptation. The experiences highlighted in these demos showcase the baseline capabilities of HAI-DEF models for the displayed tasks, and are intended to inspire further innovation.

These demos span multiple HAI-DEF model releases. Check each card's badges for the models used.
[![](https://developers.google.com/static/health-ai-developer-foundations/showcase/images/ehr_nav.gif)
#### EHR navigation with MedGemma
MedGemma Hugging Face ↗](https://huggingface.co/spaces/google/ehr-navigator-agent-with-medgemma) [![](https://developers.google.com/static/health-ai-developer-foundations/showcase/images/appoint_ready.gif)
#### Pre-visit patient intake with MedGemma
MedGemmaGemini Hugging Face ↗](https://huggingface.co/spaces/google/appoint-ready) [![](https://developers.google.com/static/health-ai-developer-foundations/showcase/images/rad_explain.png)
#### Radiology explainer with MedGemma
MedGemma Hugging Face ↗](https://huggingface.co/spaces/google/rad_explain) [![](https://developers.google.com/static/health-ai-developer-foundations/showcase/images/rad_learning.png)
#### Radiology learning companion with MedGemma
MedGemmaMedSigLIP Hugging Face ↗](https://huggingface.co/spaces/google/rad_learning_companion) [![](https://developers.google.com/static/health-ai-developer-foundations/showcase/images/rad_extract.gif)
#### Radiology report structuring with LangExtract
GeminiLangExtract Hugging Face ↗](https://huggingface.co/spaces/google/radextract) [![](https://developers.google.com/static/health-ai-developer-foundations/images/path-foundation-logo.png)
#### Digital pathology outlier tissue detection \& classification
Path Foundation Hugging Face ↗](https://huggingface.co/spaces/google/path-foundation-demo) [![](https://developers.google.com/static/health-ai-developer-foundations/images/cxr-foundation-logo.png)
#### Chest X-ray classification
CXR Foundation Hugging Face ↗](https://huggingface.co/spaces/google/cxr-foundation-demo)