πŸ₯ ClinicFlow AI

A medical triage and patient intake assistant fine-tuned on Llama 3.2 3B using LoRA adapters.


πŸ“Ί Demo Video

ClinicFlow AI Demo


πŸš€ Live Demo

πŸ‘‰ Try ClinicFlow AI on HuggingFace Spaces


πŸ“Œ What is ClinicFlow AI

ClinicFlow AI is a responsible clinic triage and patient intake assistant. It conducts multi-turn conversations to collect patient symptoms, asks focused follow-up questions, and generates a structured clinical summary at the end.


πŸ”§ Model Details

Detail Info
Base Model unsloth/Llama-3.2-3B-Instruct
Fine-tuning Method LoRA (PEFT)
Training Loss 0.107
Task Medical Triage & Patient Intake
Language English
License MIT

πŸ› οΈ Tech Stack

  • Python + PyTorch
  • HuggingFace Transformers
  • TRL 1.3.0 + PEFT + LoRA
  • Trained on Google Colab A100 GPU
  • Gradio UI

πŸ’¬ How to Use

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch

base_model_name = "unsloth/Llama-3.2-3B-Instruct"
adapter_name = "bilalchawdhary/clinic_flow"

tokenizer = AutoTokenizer.from_pretrained(base_model_name)

base_model = AutoModelForCausalLM.from_pretrained(
    base_model_name,
    torch_dtype=torch.float16,
    device_map="auto"
)

model = PeftModel.from_pretrained(base_model, adapter_name)

prompt = """<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are ClinicFlow AI, a responsible clinic triage
and patient intake assistant.<|eot_id|>
<|start_header_id|>user<|end_header_id|>

I have a headache and fever since 2 days<|eot_id|>
<|start_header_id|>assistant<|end_header_id|>

"""

inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
input_length = inputs["input_ids"].shape[1]

outputs = model.generate(
    **inputs,
    max_new_tokens=300,
    temperature=0.7,
    top_p=0.9,
    repetition_penalty=1.2,
    do_sample=True,
    pad_token_id=tokenizer.eos_token_id,
)

new_tokens = outputs[0][input_length:]
response = tokenizer.decode(new_tokens, skip_special_tokens=True)
print(response)

βœ… Capabilities

  • Multi-turn patient intake conversations
  • Focused symptom follow-up questions
  • Never diagnoses or prescribes
  • Structured clinical summary at end
  • Recommends consulting a real doctor

⚠️ Disclaimer

ClinicFlow AI is for demonstration purposes only. It is NOT a replacement for a real doctor. Always consult a qualified medical professional for diagnosis and treatment.


πŸ‘¨β€πŸ’» Built By

Bilal Chawdhary β€” Software Engineering Graduate building AI products and sharing the journey.

Downloads last month
1
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for bilalchawdhary/clinic_flow

Adapter
(428)
this model

Space using bilalchawdhary/clinic_flow 1