Ingest clinical documents, extract structured medical entities, and generate validated FHIR R4/R5 bundles - with intelligent multi-provider AI routing and built-in agent interoperability.
Watch FhirFlame process a clinical document end-to-end: from raw text ingestion through AI entity extraction to a validated FHIR R4 bundle.
Healthcare data is locked in unstructured formats. Converting it to interoperable standards manually is slow, expensive, and error-prone.
Clinical notes, lab reports, discharge summaries, and imaging reports arrive as free text, scanned PDFs, and proprietary formats. EHR systems need structured, coded data to be useful.
FhirFlame auto-extracts entities and structures them into FHIR bundlesBuilding a compliant FHIR bundle by hand requires deep HL7 expertise. One missing field or wrong reference breaks downstream systems. Validation is tedious and easy to get wrong.
100% schema-validated output, zero dummy data, every field traced to sourceCloud AI APIs cost money per call. Many healthcare teams can't justify API spend for development and testing. Existing tools require expensive enterprise licenses.
Run entirely local with Ollama at $0 cost, scale to cloud only when neededLLM-based agents (Claude, GPT, custom) lack purpose-built medical tools. There's no standard way for an AI agent to process a clinical document and get back structured FHIR data.
MCP server gives any agent instant access to medical processingFrom document ingestion to FHIR-compliant output, every component is designed for medical data processing at scale.
Generate and validate HL7 FHIR R4/R5 bundles with 100% compliance scoring. Seamless EHR integration with structured, standards-conformant output.
Intelligent cost-aware routing across Ollama (local/free), Modal Labs L4 GPU, HuggingFace inference, and Mistral Vision with automatic fallback.
Built-in Model Context Protocol server with two healthcare-specific tools for seamless integration with Claude, GPT, and other LLM-based agents.
Mistral Vision OCR for medical document processing with high-accuracy entity extraction across clinical notes, lab reports, and radiology reports.
Extract and process medical imaging metadata via pydicom. Map DICOM data to FHIR ImagingStudy resources for radiology and diagnostic workflows.
Langfuse-powered tracing and monitoring with PostgreSQL persistence, ClickHouse analytics, and comprehensive audit trails for compliance.
FhirFlame is not just a tool you use manually. It implements the Model Context Protocol so any LLM agent (Claude, GPT, custom) can call its healthcare functions programmatically. The A2A REST API enables system-to-system integration with EHRs, labs, and other services.
{
"tool": "process_medical_document",
"input": {
"document_content": "Patient presents with
acute chest pain, BP 142/91,
HR 98. History of hypertension.
Started on Metoprolol 50mg.",
"document_type": "clinical_note",
"extract_entities": true,
"generate_fhir": true
}
}
The routing engine selects the optimal AI provider for each request based on cost, latency, and availability. Start free with local Ollama, then seamlessly scale to GPU cloud when you need production throughput. If a provider goes down, the system automatically falls back.
Router Decision Engine ├─ Priority 1: Ollama (local) │ ├─ Cost: $0 │ ├─ Latency: ~2.3s │ └─ Status: ● healthy ├─ Priority 2: Modal Labs (GPU) │ ├─ Cost: usage-based │ ├─ Latency: ~1.1s │ └─ Status: ● standby ├─ Priority 3: HuggingFace │ ├─ Cost: free tier / paid │ ├─ Latency: ~3.0s │ └─ Status: ● healthy └─ Priority 4: Mistral Vision ├─ Cost: usage-based ├─ Latency: ~2.8s (OCR) └─ Status: ● healthy
Every output bundle is validated against official HL7 FHIR schemas. The engine enforces a zero-dummy-data policy — every resource field maps directly to extracted clinical entities. Bundles are ready for EHR integration without post-processing.
{
"resourceType": "Bundle",
"type": "collection",
"entry": [
{
"resource": {
"resourceType": "Patient",
"name": [{"given": ["John"]}],
"birthDate": "1965-03-15"
}
},
{
"resource": {
"resourceType": "Condition",
"code": {
"text": "Hypertension"
},
"clinicalStatus": "active"
}
}
]
}
A multi-stage pipeline that transforms unstructured medical documents into validated, standards-compliant healthcare data.
PDF, DICOM, clinical text, and lab reports are ingested and pre-processed with OCR via Mistral Vision and text extraction via pydicom and PyMuPDF.
The MCP server selects the appropriate tool, routes to the optimal AI provider based on cost and availability, and tracks job state in PostgreSQL.
Medical NLP models extract conditions, medications, vitals, and patient information. Scaling flows automatically from local Ollama to Modal L4 GPU.
Extracted entities are mapped to HL7 FHIR R4/R5 schemas, validated for 100% compliance, and output as EHR-ready structured bundles.
FhirFlame is built for anyone who needs to turn medical text into structured, standards-compliant healthcare data.
Automate the conversion of clinical notes, discharge summaries, and lab reports into FHIR bundles for EHR ingestion. Reduce manual data entry and transcription errors.
Add FHIR-compliant document processing to your product without building a validation engine from scratch. Ship interoperable features faster with the A2A API.
Give your Claude, GPT, or custom LLM agent healthcare capabilities instantly. The MCP server exposes two tools that turn any agent into a medical document processor.
Process medical datasets for research analysis. Use as a teaching tool for FHIR standards, medical NLP, and healthcare interoperability concepts. Runs locally for full data privacy.
FhirFlame accepts diverse medical document formats and produces standards-compliant structured output.
Container-orchestrated services connected via Docker Compose for reproducible, healthcare-grade deployments.
Run the full stack with Docker or start lightweight with a local Python environment.
git clone https://github.com/leksval/fhirflame.git cd fhirflame cp .env.example .env docker compose -f docker-compose.local.yml up -d
| Gradio UI | localhost:7860 |
| A2A API | localhost:8000 |
| Langfuse | localhost:3000 |
| Ollama | localhost:11434 |
git clone https://github.com/leksval/fhirflame.git cd fhirflame python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt cp .env.example .env python app.py
On Windows use .venv\Scripts\activate instead.
No API keys required - Ollama runs locally at zero cost.
Configure providers via environment variables. Start free with Ollama and add cloud providers as needed.
No API keys required. Run CodeLlama 13B Instruct locally for development and testing.
USE_REAL_OLLAMA=true
Medical domain models (BioBERT, ClinicalBERT) and HF Spaces hosting with enterprise inference endpoints.
HF_TOKEN
Serverless L4 GPU auto-scaling for production workloads with automatic provider fallback.
MODAL_TOKEN_ID
Multimodal AI for medical document OCR and text extraction from imaging and scanned documents.
MISTRAL_API_KEY
LLM observability and analytics with real-time job tracking, backed by PostgreSQL and ClickHouse.
LANGFUSE_SECRET_KEY
Deploy and host FhirFlame directly on HuggingFace Spaces with public or private access.
HF_TOKEN
Security patterns designed for healthcare environments with defense-in-depth principles.
Open-source technologies chosen for reliability, performance, and healthcare-grade standards.
Try the live demo instantly, or deploy locally in under 5 minutes with Docker. No API keys required to get started.