TL; DR: dhti-cli is for quick prototyping, developing, sharing and testing of Gen AI applications, models, and UI elements within the context of an electronic health record. Paper coming soon!
Gen AI can transform medicine. But it needs a framework for collaborative research and practice. DHTI is a reference architecture and an implementation for such a framework that integrates an EMR (OpenMRS), :link: Gen AI application server (LangServe), self-hosted LLMs for privacy (Ollama), tools on MCP server, vector store for RAG (redis), monitoring (LangFuse), π₯ FHIR repository with CQL support (HAPI) and graph utilities (Neo4j) in one docker-compose! DHTI is inspired by Bahmni and aims to facilitate GenAI adoption and research in areas with low resources. The MCP server hosts pluggable, agent-invokable tools (FHIR query, summarization, terminology lookup, custom analytics, etc.) that you can extend without modifying core services.
The essence of DHTI is modularity with an emphasis on configuration! It is non-opinionated on LLMs, hyperparameters and pretty much everything. DHTI supports installable Gen AI routines through LangChain templates (which we call :curry: elixir) and installable UI elements through OpenMRS O3 React container (which we call :shell: conch). π₯ FHIR is used for backend and CDS-Hooks for frontend communication, decoupling conches from OpenMRS, making them potentially usable with any health information system. We have a fork of the cds-hook sandbox for testing that uses the order-select hook, utilizing the contentString from the FHIR CommunicationRequest within the cds-hook context for user inputs (recommended).
π dhti-cli is a CLI tool for quick prototyping and testing of elixirs and conches. You can create a new docker-compose with required modules, start/stop services, install Elixirs and conch, create Docker images for them, and more. π This helps to test new ideas and share them with others quickly. π Once tested, you can transition them to the production team for deployment. Adoption of standards makes this transition easier!
βοΈ Pitched at Falling Walls Lab Illinois and released on 09/12/2025.
Why | How |
---|---|
I know LangChain, but I donβt know how to build a chain/agent based on data in our EHR. | This template adopts FHIR and cds-hooks as standards for data retrieval and display. The base class provides reusable artifacts |
I need a simple platform for experimenting. | This repository provides everything to start experimenting fast. The command-line tools help to virtualize and orchestrate your experiments using Docker |
I am a UI designer. I want to design helpful UI for real users. | See this template. It shows how to build interface components (conches) for OpenMRS an open-source EMR used by many. Read more about OpenMRS UI |
We use another EMR | Your EMR may support CDS-Hook for displaying components. In that case, you can use cds-hooks-sandbox for testing |
Our IT team is often unable to take my experiments to production. | Use DHTI, follow the recommended patterns, and you will make their lives easier. |
Developers can build elixirs and conchs for DHTI.
:curry: Elixirs are LangChain templates for backend GenAI functionality. By convention, Elixirs are prefixed with dhti-elixir- and all elixirs depend on dhti-elixir-base which provides some base classes and defines dependencies. You can use this template to build new elixirs, and license it the way you want (We :heart: open-source!).
:shell: Conches are OpenMRS O3s and follow the standard naming convention openmrs-esm-. A separate OpenMRS independant container for conchs is on our roadmap for use outside OpenMRS. You can use this template to build new conches.
:white_check_mark:
DHTI provides a platform to deploy language models and Gen AI applications in the context of an electronic health record.
DHTI serves as a platform for testing prompts, chains and agents in healthcare applications. Since the stack uses the :fire: FHIR data model, it is easy to load synthetic data.
Tools to fine-tune language models for the stack are on our roadmap. We encourage all language models built for this platform to be open sourced on HuggingFace with the names starting with dhti-.
:white_check_mark:
π Join us to make the Gen AI equitable and help doctors save lives!
dhti-cli help
dhti-cli compose --help
You only need:
git clone https://github.com/dermatologist/dhti.git && cd dhti
npm install
npm run build
npm link
dhti-cli help
This will show the available commands.~/dhti
(Customizable)Create a new docker-compose file: dhti-cli compose add -m openmrs -m langserve
The docker-compose.yml is created with the following modules:
Other available modules: ollama, langfuse, cqlFhir, redis, neo4j and mcpFhir
(Documentation in progress)
You can read the newly created docker-compose by: dhti-cli compose read
dhti-cli docker -u
It may take a while to download the images and start the services. (OpenMRS may take upto 45 mins the first time to setup the database)
http://localhost/openmrs/spa/home
localhost:8001/docs
(Empty Swagger UI)dhti-cli docker -d
:running:
dhti-cli elixir install -g https://github.com/dermatologist/dhti-elixir-template.git -n dhti-elixir-template
.
You may also install from PyPi or a wheel file!
cat ~/dhti/elixir/app/bootstrap.py
This is where you can override defaults in the elixir for LLM, embedding model, hyperparameters etc that are injected at runtime. Refer to each elixir for the available options. You may check out how to inject a real LLM using Google Gemini!
dhti-cli docker -n beapen/genai-test:1.0 -t elixir
(You may replace beapen/genai-test:1.0
with your own image name)
While developing you can copy the app folder to a running container for testing (provided there are no changes in dependencies). Read more here.
:shell: dhti-cli conch install -g https://github.com/dermatologist/openmrs-esm-dhti-template.git -n openmrs-esm-dhti-template
We can also install from a dev folder after cloning the repository. While developing you can copy the dist folder to a running container for testing. Read more here.
dhti-cli docker -n beapen/conch-test:1.0 -t conch
dhti-cli docker -u
http://localhost/openmrs/spa/home
You will see the new conch in the left margin. Click on Dhti app to see the UI. This is just a template, though. You can build your own conchs!
Add some text to the text area and click on Submit. You will see the text above the textbox.
You can remove the services by: dhti-cli docker -d
:hugs: Thank you for trying out DHTI!
If you find this project useful, give us a star. It helps others discover the project.