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.
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
python
1from peft import PeftModel
2from transformers import AutoModelForImageTextToText, AutoTokenizer
3import torch
45base_id ="unsloth/gemma-4-E4B-it"6adapter_id ="y0sif/GutWise"78tok = AutoTokenizer.from_pretrained(base_id)9base = AutoModelForImageTextToText.from_pretrained(10 base_id, torch_dtype=torch.bfloat16, device_map="auto"11)12model = PeftModel.from_pretrained(base, adapter_id)13device =next(model.parameters()).device # robust on PeftModel; model.device can be unreliable1415messages =[16{"role":"system","content":"You are GutWise, an IBS health education assistant. ..."},17{"role":"user","content":"What is the low-FODMAP diet?"},18]19prompt = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)20batch = tok(prompt, return_tensors="pt").to(device)21out = model.generate(22**batch,23 max_new_tokens=512,24 do_sample=True,25 temperature=0.7,26 top_p=0.9,27 pad_token_id=tok.eos_token_id,28)29print(tok.decode(out[0, batch["input_ids"].shape[-1]:], skip_special_tokens=True))
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.
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_050 as 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}
}