Views
No views yet
User Input → Llama Guard (input safety) → PCOS LLM + RAG → Llama Guard (output safety) → Response
↓
NeMo Guardrails (topic control, referral triggers)| Module | File | Description |
|---|---|---|
| Dataset Pipeline | pcos_health_ai/dataset_pipeline.py | Curates, synthesizes, and preprocesses training data |
| LoRA Fine-Tuning | pcos_health_ai/lora_finetuning.py | QLoRA + SFT training configuration |
| Safety Guardrails | pcos_health_ai/safety_guardrails.py | Llama Guard + rule-based medical safety |
| RAG Pipeline | pcos_health_ai/rag_pipeline.py | ChromaDB vector store + retrieval-augmented generation |
| Config | pcos_health_ai/config.py | Centralized configuration and constants |
| Model | Pros | Cons | USMLE Score |
|---|---|---|---|
| BioMistral-7B ⭐ | Medical pre-trained, AWQ available (4.68GB) | Slightly older base | ~75% |
| Llama-3-8B-Instruct | Best instruction following, strong GGUF support | No medical pre-training | ~70% (base) |
| MedGemma-4B-IT | Newest SOTA, multimodal ready | Gated access, newer ecosystem | ~84% |
BioMistral/BioMistral-7B for clinical accuracy, or meta-llama/Meta-Llama-3.1-8B-Instruct for best conversational quality.lavita/ChatDoctor-HealthCareMagic-100k — 100K real patient-doctor Q&Aruslanmv/ai-medical-chatbot — 250K+ patient-doctor exchangesmedalpaca/medical_meadow_wikidoc_patient_information — Clinical knowledgeAmod/mental_health_counseling_conversations — Empathetic counselingMalikeh1375/medical-question-answering-datasets — Unified medical QA bundle| Preset | Base Model | LoRA r | Epochs | Max Seq | Hardware |
|---|---|---|---|---|---|
| Quick Test | BioMistral-7B | 8 | 1 | 512 | a10g-small |
| Standard | BioMistral-7B | 16 | 3 | 2048 | a10g-large |
| High Quality | Llama-3.1-8B-Instruct | 64 | 5 | 4096 | a100-large |
| Maximum | Llama-3.1-8B-Instruct | 256 | 8 | 4096 | a100-large |
1pip install datasets transformers peft trl bitsandbytes accelerate sentence-transformers chromadb faker
2
3# 1. Generate dataset
4python -m pcos_health_ai.dataset_pipeline
5
6# 2. Run safety guardrails demo
7python -m pcos_health_ai.safety_guardrails
8
9# 3. Run RAG pipeline demo
10python -m pcos_health_ai.rag_pipeline
11
12# 4. View training configuration
13python -m pcos_health_ai.lora_finetuning