One question, one continuous answer
OClinic Overview
Patients onboard through the clinic app with verified identity and consent. Clinicians start secure, timed sessions and query the Apertus-powered longitudinal record with XAI and CEAI transparency. Every answer is source-linked and every data movement is consent-gated.
Patients
GSynthetic Data Generation
Generate realistic but entirely fake psychiatric EHR-style records for research and prototyping. No real patient data is used.
| Patient ID | Institution | Age | Gender | Primary Diagnosis | Consent | Created |
|---|
Ask a patient-specific question
On-premise, consent-gated support
How to use the Patient Chat
- Your records stay local. SHRUNK runs on the clinic's controlled on-premise system.
- Provide or update consent before your visit. The application records your preference.
- This chat is for general support and non-urgent questions. It is not a diagnosis.
- Your clinician sees the conversation only with consent and an active secure session.
Secure clinician session with XAI + CEAI
Sovereign LLM pipeline status
Teacher (Base)
Teacher (Instruct)
Mental-Health LoRA
Current Apertus LLM
Kaggle Apertus 70B
Distilled Student
SSovereign Actions
Teacher & Student Models
Teacher (Apertus 8B / 70B)
swiss-ai/Apertus-8B-2509 or unsloth/Apertus-70B-Instruct-2509-GGUF
Mental-Health Adapter
Low-rank adapter on synthetic psychiatric EHR notes
Student (SmolLM)
HuggingFaceTB/SmolLM-135M-Instruct for edge / 4 GB GPUs
TTeacher Model
- Base: swiss-ai/Apertus-8B-2509
- Instruct: swiss-ai/Apertus-8B-Instruct-2509
- Role: Generates high-quality clinical interpretation with safety guardrails.
- Deployment: Runs on Kaggle for 70B demos; local CPU mode for 8B requires ≥16 GB RAM.
SStudent Model
- Base: HuggingFaceTB/SmolLM-135M-Instruct
- Role: A small, efficient model that can run on the local 4 GB GPU for edge inference.
- Training: Distilled from the adapter-tuned teacher using synthetic psychiatric instruction data.
Why the model said what it said
AAttention Weights
Visualize which note segments, symptoms, risk terms, and medication names the model attended to during generation.
FFeature Importance
Gradient-based importance scores note count, diagnosis variety, medication burden, risk level, and query complexity.
RRationale Generation
Produces a chain-of-thought, clinician-readable explanation that traces the path from retrieved evidence to interpretation.
CConfidence Scoring
Uncertainty quantification reports model certainty and flags low-confidence regions requiring verification.
XTry XAI
Evidence alignment, not blind confidence
Strong alignment between retrieved evidence and clinical interpretation.
Tier: Green · Actionable
RReasoning Trace
- Retrieve longitudinal notes and patient-chat context.
- Rank evidence by recency, source type, and risk relevance.
- Compare interpretation against retrieved evidence.
- Flag missing data and safety thresholds.
- Generate clinician review recommendations.
Intelligence moves, PHI stays sealed
NNode Network
Only de-identified, consent-gated clinical insights cross the airlock. Raw notes, identifiers, and free-text patient context never leave the originating clinic.
MMetrics
Multi-User Chatbot Simulation
Available Users
How SHRUNK keeps PHI inside the clinic
1. Privacy & Compliance Active
Consent gating, audit logging, de-identification, and institutional access controls. PHI stays sealed inside the clinic.
2. Federated Retrieval Active
Local FAISS + sentence-transformers retrieve patient, similar-patient, and guideline notes. Cross-clinic sharing only transfers model updates.
3. Clinical Routing Active
Classifies queries and escalates high-risk cases to the clinician.
4. Decision Support Active
Evidence-based recommendations from Apertus, grounded in retrieved notes and clinical guidelines.
5. Knowledge Distillation Active
Teacher (Apertus 8B/70B) fine-tunes a small student (SmolLM) for safe, edge-deployable inference.
6. Edge Deployment Active
Resource-aware model selection: local Apertus, GGUF, or secure Kaggle 70B offloading — retrieval and routing remain local.
Settings
System Configuration
Consent & Access
Danger Zone
Clear Database
In the live Flask app this calls /api/clear_database. In this static demo it resets the local patient data to defaults.