PromptDoctor is an experimental platform designed to study the impact of explainability features on medical professionals' interaction with AI language models for clinical reasoning tasks. The system implements an A/B testing framework where users are divided into two groups:
The platform collects comprehensive interaction data, including prompts, responses, feedback, and survey responses to evaluate how explainability features affect trust, understanding, and effectiveness in medical AI applications.
The PromptDoctor system is built with a modular architecture consisting of several key components:

User Interface Layer: Streamlit-based web application with:
Processing Layer:
Model Layer:
Storage Layer:
Tracking System:
git clone https://github.com/yourusername/PromptDoctor_MA.git
cd PromptDoctor_MA
# Install Poetry if not installed
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies
poetry install
# Activate the virtual environment
poetry shell
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Install Ollama:
# macOS
curl -fsSL https://ollama.com/install.sh | sh
# Linux
curl -fsSL https://ollama.com/install.sh | sh
# Windows
# Download from https://ollama.com/download
Pull medical models:
ollama pull llama2:7b-medical
ollama pull nous-hermes2:8b-med
export TOGETHER_API_KEY="your_api_key_here"
pip install transformers accelerate bitsandbytes
# Set model cache location (optional)
export TRANSFORMERS_CACHE="/path/to/model/cache"
# Download model (will occur automatically on first use)
python -c "from transformers import AutoModelForCausalLM, AutoTokenizer; \
model_name='meta-llama/Llama-2-7b-chat-hf'; \
tokenizer = AutoTokenizer.from_pretrained(model_name); \
model = AutoModelForCausalLM.from_pretrained(model_name)"
Note: The HuggingFace Endpoint Provider is currently a placeholder and not fully implemented. Use local HuggingFace models or other providers for production use.
python -m src.core.db_utils --init
# Using the convenience script
./run.sh
# Manual start
streamlit run src/Home.py
The application will be available at http://localhost:8501 by default.
PromptDoctor supports the following activation modes:
# Default mode - lets user choose a LLM
streamlit run src/Home.py
# Study mode - enables full experimental protocol and preselects TogetherAI Model meta-llama/Llama-3.3-70B-Instruct-Turbo-Free
streamlit run src/Home.py --study
These modes can be combined with Streamlit's server options for greater flexibility.
streamlit run src/Home.py --server.runOnSave True
streamlit run src/Home.py --server.enableCORS False --server.enableXsrfProtection False
PromptDoctor guides users through a structured experimental process:
Consent and Introduction:
Pre-Study Questionnaire:
Group Assignment:
Clinical Case Tasks (3 total):
Post-Task Surveys (after each task):
Final Feedback Questionnaire:
Data Collection:
ollama_provider.py: Local Ollama model integrationtogether_provider.py: Together AI API integrationhuggingface_provider.py: Local HuggingFace modelshuggingface_endpoint_provider.py: Remote HuggingFace endpointsContributions to PromptDoctor are welcome. Please follow these steps:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)Problem: "Model failed to load" error message.
Solutions:
ollama serve)Problem: UI components not rendering correctly.
Solutions:
Problem: "Database connection failed" errors.
Solutions:
python -m src.core.db_utils --initLog files are stored in the logs/ directory:
app.log: General application logserror_log.txt: Error logsstorage.log: Data storage logsfrom src.models.model_handler import ModelHandler
# Initialize handler
handler = ModelHandler()
# Get response
response = handler.get_response(prompt, model_type, model_name)
from src.medical.medical_processor import MedicalTermProcessor
# Initialize processor
processor = MedicalTermProcessor()
# Get highlighted terms
highlighted_text = processor.highlight_medical_terms(text)
from src.LIME.lime_processor import LIMEProcessor
# Initialize processor
processor = LIMEProcessor()
# Get explanation
explanation = processor.explain_text(text, model_type)
from src.core.data_storage import DataStorage
# Initialize storage
storage = DataStorage()
# Save interaction
storage.save_interaction(user_id, prompt, response, model)
This documentation is maintained by Antonia Fuchs. For questions or support, please open an issue on the repository.
Last updated: July 23, 2025
PromptDoctor is an experimental platform designed to study the impact of explainability features on medical professionals' interaction with AI language models for clinical reasoning tasks. The system implements an A/B testing framework where users are divided into two groups:
The platform collects comprehensive interaction data, including prompts, responses, feedback, and survey responses to evaluate how explainability features affect trust, understanding, and effectiveness in medical AI applications.
The PromptDoctor system is built with a modular architecture consisting of several key components:

User Interface Layer: Streamlit-based web application with:
Processing Layer:
Model Layer:
Storage Layer:
Tracking System:
git clone https://github.com/yourusername/PromptDoctor_MA.git
cd PromptDoctor_MA
# Install Poetry if not installed
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies
poetry install
# Activate the virtual environment
poetry shell
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Install Ollama:
# macOS
curl -fsSL https://ollama.com/install.sh | sh
# Linux
curl -fsSL https://ollama.com/install.sh | sh
# Windows
# Download from https://ollama.com/download
Pull medical models:
ollama pull llama2:7b-medical
ollama pull nous-hermes2:8b-med
export TOGETHER_API_KEY="your_api_key_here"
pip install transformers accelerate bitsandbytes
# Set model cache location (optional)
export TRANSFORMERS_CACHE="/path/to/model/cache"
# Download model (will occur automatically on first use)
python -c "from transformers import AutoModelForCausalLM, AutoTokenizer; \
model_name='meta-llama/Llama-2-7b-chat-hf'; \
tokenizer = AutoTokenizer.from_pretrained(model_name); \
model = AutoModelForCausalLM.from_pretrained(model_name)"
Note: The HuggingFace Endpoint Provider is currently a placeholder and not fully implemented. Use local HuggingFace models or other providers for production use.
python -m src.core.db_utils --init
# Using the convenience script
./run.sh
# Manual start
streamlit run src/Home.py
The application will be available at http://localhost:8501 by default.
PromptDoctor supports the following activation modes:
# Default mode - lets user choose a LLM
streamlit run src/Home.py
# Study mode - enables full experimental protocol and preselects TogetherAI Model meta-llama/Llama-3.3-70B-Instruct-Turbo-Free
streamlit run src/Home.py --study
These modes can be combined with Streamlit's server options for greater flexibility.
streamlit run src/Home.py --server.runOnSave True
streamlit run src/Home.py --server.enableCORS False --server.enableXsrfProtection False
PromptDoctor guides users through a structured experimental process:
Consent and Introduction:
Pre-Study Questionnaire:
Group Assignment:
Clinical Case Tasks (3 total):
Post-Task Surveys (after each task):
Final Feedback Questionnaire:
Data Collection:
ollama_provider.py: Local Ollama model integrationtogether_provider.py: Together AI API integrationhuggingface_provider.py: Local HuggingFace modelshuggingface_endpoint_provider.py: Remote HuggingFace endpointsContributions to PromptDoctor are welcome. Please follow these steps:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)Problem: "Model failed to load" error message.
Solutions:
ollama serve)Problem: UI components not rendering correctly.
Solutions:
Problem: "Database connection failed" errors.
Solutions:
python -m src.core.db_utils --initLog files are stored in the logs/ directory:
app.log: General application logserror_log.txt: Error logsstorage.log: Data storage logsfrom src.models.model_handler import ModelHandler
# Initialize handler
handler = ModelHandler()
# Get response
response = handler.get_response(prompt, model_type, model_name)
from src.medical.medical_processor import MedicalTermProcessor
# Initialize processor
processor = MedicalTermProcessor()
# Get highlighted terms
highlighted_text = processor.highlight_medical_terms(text)
from src.LIME.lime_processor import LIMEProcessor
# Initialize processor
processor = LIMEProcessor()
# Get explanation
explanation = processor.explain_text(text, model_type)
from src.core.data_storage import DataStorage
# Initialize storage
storage = DataStorage()
# Save interaction
storage.save_interaction(user_id, prompt, response, model)
This documentation is maintained by Antonia Fuchs. For questions or support, please open an issue on the repository.
Last updated: July 23, 2025