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
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 (.litertlm) with LiteRT-LM in an agentic configuration, runnable comfortably on devices with 12 GB+ of memory. See the on-device quickstart on GitHub for architecture, tests, and sample data.
| Recipe | Technical problem it solves | Supporting models |
|---|---|---|
| Deterministic calculator tools | Keep arithmetic out of the model: extract typed inputs from text, call deterministic Python functions, and report their results | None |
| Rule-table tool calling | 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 | Serve a rule-table tool call, a direct image prompt, and human-reviewed transcript text in one offline process | MedASR |
| Local guideline retrieval | Retrieve passages from a local SQLite vector index by on-device cosine similarity, quote them with printed page numbers, and abstain below a threshold | EmbeddingGemma 2 (Apache 2.0) |
| Read a table from a photo | Transcribe printed table rows verbatim from a document photograph using vision input alone, with no tool calls | None |
| Document → JSON | 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 | 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 | 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 |
Demo apps
These demos span multiple HAI-DEF model releases. Check each card's badges for the models used.






