Source repositories: docgemma-connect (FastAPI backend) | docgemma-frontend (Vue 3 UI)
Competition: The MedGemma Impact Challenge on Kaggle
Agentic medical AI assistant powered by MedGemma, with autonomous tool calling for clinical decision support. Designed for resource-limited healthcare environments. Compatible with MedGemma 27B and MedGemma 1.5 4B.
DocGemma combines a Vue 3 web interface with a FastAPI/LangGraph agent backend that can query drug safety databases, search medical literature, manage electronic health records, and analyze medical images — all with human-in-the-loop approval for safety-critical actions.
Try DocGemma instantly on Google Colab — no local setup required. The notebook provisions an A100 GPU, deploys the full stack (vLLM + backend + frontend), and generates a public URL. Just provide a HuggingFace token with MedGemma access.
For local GPU inference (optional):
- NVIDIA GPU — 48 GB+ VRAM for MedGemma 27B (e.g., A100, A6000) or 8 GB+ for MedGemma 1.5 4B
- NVIDIA Container Toolkit
- A HuggingFace account with access to MedGemma
For remote inference:
- A running vLLM-compatible endpoint (e.g., RunPod, Together AI)
For GPU cloud instances (RunPod, Vast.ai, Lambda, Paperspace, AWS/GCP/Azure) or bare metal with an NVIDIA GPU. Installs everything directly on the host — no containers needed.
git clone https://github.com/galinilin/docgemma-app.git
HF_TOKEN=hf_your_token_here bash docgemma-app/run-native.shThe script auto-detects GPU VRAM (falls back to MedGemma 4B if < 40 GB), installs dependencies (Node.js, UV, vLLM), builds the frontend, and starts vLLM + the app on a single port.
| Variable | Default | Description |
|---|---|---|
HF_TOKEN |
— | HuggingFace token (required) |
DOCGEMMA_MODEL |
google/medgemma-27b-it |
Auto-selected based on VRAM |
APP_PORT |
8080 |
Web UI port |
VLLM_PORT |
8000 |
vLLM API port |
WORKDIR |
/workspace/docgemma |
Clone/build directory |
git clone https://github.com/galinilin/docgemma-app.git
cd docgemma-app
cp .env.example .envEdit .env and set your endpoint credentials:
DOCGEMMA_ENDPOINT=https://your-vllm-endpoint.example.com
DOCGEMMA_API_KEY=your-api-key-heredocker compose --profile remote upgit clone https://github.com/galinilin/docgemma-app.git
cd docgemma-app
cp .env.example .envEdit .env and set your HuggingFace token:
HF_TOKEN=hf_your_token_heredocker compose --profile gpu upNote: The first run downloads model weights (~54 GB for MedGemma 27B, ~8 GB for MedGemma 1.5 4B). The vLLM health check allows up to 10 minutes for the model to load.
Both profiles work with Podman. For the remote profile, use the default compose file:
podman compose --profile remote upFor the gpu profile, use the Podman-specific compose file (uses CDI instead of Docker's deploy.resources for GPU passthrough):
podman compose -f docker-compose.podman.yml --profile gpu upRequires NVIDIA Container Toolkit with CDI configured for Podman.
Open http://localhost:8080 in your browser.
Browser ──→ Vue 3 SPA ──→ FastAPI + LangGraph Agent ──→ vLLM / MedGemma
│ │
│ ├── Drug safety (OpenFDA)
│ ├── Drug interactions (RxNav)
│ ├── Medical literature (PubMed)
│ ├── Clinical trials (ClinicalTrials.gov)
│ ├── FHIR R4 EHR (local store)
│ └── Medical image analysis (vision API)
│
└── Patient management, imaging upload, clinical notes
The Docker image bundles everything into a single container:
- Frontend: Vue 3 + TypeScript + Tailwind CSS, built and served as static files
- Backend: Python/FastAPI with a 7-node LangGraph agent workflow
- Model: MedGemma 27B or 1.5 4B via vLLM (OpenAI-compatible API)
| Variable | Required | Default | Description |
|---|---|---|---|
DOCGEMMA_ENDPOINT |
remote profile | — | vLLM endpoint URL |
DOCGEMMA_API_KEY |
remote profile | — | API key for the endpoint |
HF_TOKEN |
gpu profile | — | HuggingFace token (with MedGemma access) |
DOCGEMMA_MODEL |
no | google/medgemma-27b-it |
Model ID — also supports google/medgemma-1.5-4b-it |
DOCGEMMA_PORT |
no | 8080 |
Host port for the web UI |
VLLM_MAX_MODEL_LEN |
no | 8192 |
Maximum context length |
VLLM_GPU_UTIL |
no | 0.90 |
GPU memory utilization (0.0–1.0) |
Patient records (FHIR R4) and chat session history are stored in a Docker volume (docgemma-data). On first run, sample patient records are seeded automatically.
To reset all data to defaults:
docker compose down -vPin the backend and frontend to specific branches or tags:
docker compose build \
--build-arg BACKEND_REF=v1.0.0 \
--build-arg FRONTEND_REF=v1.0.0Available build args:
| Arg | Default | Description |
|---|---|---|
BACKEND_REPO |
https://github.com/galinilin/docgemma-connect.git |
Backend repo URL |
BACKEND_REF |
main |
Branch, tag, or commit |
FRONTEND_REPO |
https://github.com/galinilin/docgemma-frontend.git |
Frontend repo URL |
FRONTEND_REF |
main |
Branch, tag, or commit |
For development, clone the source repositories directly:
- Backend: galinilin/docgemma-connect
- Frontend: galinilin/docgemma-frontend
vLLM takes a long time to start
First run downloads model weights (~54 GB for MedGemma 27B, ~8 GB for MedGemma 1.5 4B). Subsequent runs use the cached weights in the vllm-cache Docker volume.
GPU out of memory
Reduce VLLM_GPU_UTIL (e.g., 0.80) or VLLM_MAX_MODEL_LEN (e.g., 4096) in your .env.
Connection refused on remote profile
Verify DOCGEMMA_ENDPOINT is reachable and includes the correct port (e.g., https://host:8000).
Rebuilding after source updates Force a fresh build to pull latest source code:
docker compose build --no-cache| Repository | Description |
|---|---|
| docgemma-connect | FastAPI backend with LangGraph agent, FHIR R4 EHR, and medical tool integrations |
| docgemma-frontend | Vue 3 web interface with real-time chat, EHR management, and tool approval UI |
DocGemma is a research and educational tool. It is not certified for clinical use. Do not use for real patient care decisions.