A Streamlit-based web UI for physician medical documentation assistance using OpenAI API compatible LLM and ASR endpoints.
- Scribe Mode: Record patient encounters or dictations and generate clinical notes automatically
- Note Edit Mode: Edit physician notes with AI assistance
- Synthesize Mode: Combine information from multiple sources (H&P, Consults, Studies, Progress Notes) to write comprehensive notes
- Session Persistence: Sessions are saved automatically and can be restored
- Configurable Endpoints: Connect to your custom OpenAI API compatible LLM and ASR endpoints
- Template System: Customizable note templates (H&P, Progress Note, Consultation, Discharge Summary)
- Sampling Controls: Adjust temperature, top_k, top_p, and min_p for LLM output
- Editable System Prompt: Customize LLM behavior through the Settings UI
- Python 3.9+
- Streamlit
- PyYAML
- aiohttp
# Create virtual environment (recommended)
python -m venv venv
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txtEdit config.yaml to configure your endpoints and LLM parameters:
server:
host: "0.0.0.0" # Listen on all interfaces
port: 8501
llm:
endpoint: "http://localhost:8080"
api_key: "" # Optional: Bearer token for authenticated endpoints
model: "google/medgemma-27b-text-it"
system_prompt: "You are a medical documentation assistant..."
max_tokens: -1 # -1 for unlimited
temperature: 0.8
top_k: 40
top_p: 0.95
min_p: 0.05
stt:
endpoint: "http://localhost:8000"
api_key: "" # Optional: Bearer token for authenticated endpoints
model: "google/medasr"
session:
max_history: 100
storage_file: "sessions/session_data.json"Many settings can be adjusted through the Settings UI:
- Endpoints (LLM and STT)
- System prompt for the LLM
- Model names
- Sampling parameters (temperature, top_k, top_p, min_p)
- Session management
# Run the app
streamlit run app.py
# Or with custom host/port
streamlit run app.py --server.host 0.0.0.0 --server.port 8501Note templates are stored as .txt files in the templates/ folder. Edit these files to customize the system prompts for each note type.
- Select a note template from the dropdown
- Record audio using the browser's audio input OR upload a file
- Click "Transcribe Audio" to convert speech to text
- Review/edit the transcript if needed
- Optionally add context/instructions
- Click "Generate Note" to create the clinical note
- Download the recording if needed
- Paste your original clinical note in the left panel
- Optionally select a template for context
- Enter revision instructions (e.g., "Summarize to 3 bullet points")
- Click "Generate Edited Note"
- Enter synthesis instructions (optional)
- Fill in source information fields:
- History and Physical
- Consult Note(s)
- Studies and Procedures
- Progress Note(s)
- Select a note template
- Click "Generate Synthesized Note" to create a comprehensive clinical note from multiple sources
- Configure endpoints for LLM and STT servers
- Edit system prompt for LLM behavior
- Adjust sampling parameters (temperature, top_k, top_p, min_p)
- View, create, or clear sessions
- Each browser maintains its own selected session via URL parameters (
?session_id=xxx) - Use the session picker dropdown at the top to switch between sessions
- Bookmark the URL to return to your active session after closing the browser
- "New Session" button creates a fresh session for the current browser
- Session history shows all sessions with ability to switch or delete
When running on your home server:
- Local:
http://localhost:8501 - Remote (VPN):
http://<server-ip>:8501