y0sif/GutWise
09
GutWise — IBS Education Assistant (LoRA adapter)
A QLoRA adapter for `unsloth/gemma-4-E4B-it`, fine-tuned on 659 audited Irritable Bowel Syndrome Q&A pairs grounded in Rome IV, ACG 2021, NICE CG61, BSG 2021, StatPearls, NHS, and MedlinePlus.
Built for the Kaggle Gemma 4 Good Hackathon (Health & Sciences track).
Educational only — not medical advice, not a diagnostic tool. Red-flag symptoms (rectal bleeding, unintentional weight loss, fever, nocturnal symptoms, onset after age 50, family history of colorectal cancer or IBD) require evaluation by a clinician.
Quick start
from peft import PeftModel
from transformers import AutoModelForImageTextToText, AutoTokenizer
import torch
base_id = "unsloth/gemma-4-E4B-it"
adapter_id = "y0sif/GutWise"
tok = AutoTokenizer.from_pretrained(base_id)
base = AutoModelForImageTextToText.from_pretrained(
base_id, torch_dtype=torch.bfloat16, device_map="auto"
)
model = PeftModel.from_pretrained(base, adapter_id)
device = next(model.parameters()).device # robust on PeftModel; model.device can be unreliable
messages = [
{"role": "system", "content": "You are GutWise, an IBS health education assistant. ..."},
{"role": "user", "content": "What is the low-FODMAP diet?"},
]
prompt = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
batch = tok(prompt, return_tensors="pt").to(device)
out = model.generate(
**batch,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9,
pad_token_id=tok.eos_token_id,
)
print(tok.decode(out[0, batch["input_ids"].shape[-1]:], skip_special_tokens=True))Eval results (v2, 3-run mean ± σ)
Per-category gains: redflag +0.22, safetyrefusal +0.19, doctorfollowup +0.13. Single regression: mythbusting −0.08 (within σ).
Eval protocol: 50 held-out IBS questions × 3 seeds (42/43/44) = 150 paired prompts, judged side-by-side with the baseline in a single Haiku judge batch (no judge-calibration drift). Full numbers in the GitHub repo.
Training recipe
Intended use
- IBS education for patients and curious lay readers
- Demonstrating that small medical fine-tunes can ship safely with disciplined methodology
Out of scope
- Diagnosis, prescribing, dosing
- Pediatric IBS (criteria differ)
- Non-English use
- Any clinical decision-making
Known limitations
- Some hallucinations are inherited from base Gemma 4 (e.g., the "L. rhamnosus GC69" pattern — canonical strain is GG). v3 anti-hallucination pairs are planned.
- One category, myth_busting, regressed slightly (−0.08, within σ); v3 adds targeted training pairs.
- Held-out eval is 50 questions across 6 categories — a vibe check rather than a clinical trial. Earlier notes flagged
eval_049/eval_050as duplicate red-flag prompts, but they cover distinct red flags (family-history vs. fever + nocturnal symptoms).
Sources
- Rome IV Criteria
- ACG Clinical Guideline 2021 (Lacy et al.)
- NICE CG61 (Open Government Licence v3.0)
- BSG Guidelines on IBS 2021
- StatPearls (CC-BY 4.0)
- NHS IBS pages (OGL v3.0)
- MedlinePlus (Public Domain)
- 24 open-access PubMed abstracts
Citation
@misc{gutwise2026,
author = {y0sif},
title = {GutWise — IBS Education Assistant on Gemma 4 E4B},
year = {2026},
howpublished = {Hugging Face Hub},
url = {https://huggingface.co/y0sif/GutWise}
}License
Apache-2.0
