Downloads · 30 days
10
13% of all-time downloads
wanglab/on-device-LLM-gpt-oss-20b
on-device-LLM-gpt-oss-20b is a text generation model from wanglab. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Downloads · 30 days
10
13% of all-time downloads
All-time downloads
80
Public
Repo size
2.5 GB
Likes
0
Public
Click a slice to open those files.
.safetensors2.4 GB · 99%
From the Hugging Face model README
Benchmarking and Adapting On-Device Large Language Models for Clinical Decision Support
</div> <div align="center"> <table align="center"> <tr> <td><a href="[arXiv link - to be added]" target="_blank"><img src="https://img.shields.io/badge/arXiv-Paper-FF6B6B?style=for-the-badge&logo=arxiv&logoColor=white" alt="Paper"></a></td> <td><a href="https://github.com/bowang-lab/on-device-LLM" target="_blank"><img src="https://img.shields.io/badge/GitHub-Code-181717?style=for-the-badge&logo=github&logoColor=white" alt="Code"></a></td> <td><a href="https://huggingface.co/wanglab/on-device-LLM-gpt-oss-20b" target="_blank"><img src="https://img.shields.io/badge/HuggingFace-Model-FFBF00?style=for-the-badge&logo=huggingface&logoColor=white" alt="HuggingFace Model"></a></td> <td><a href="https://huggingface.co/datasets/wanglab/eurorad-gpt-oss-training-data" target="_blank"><img src="https://img.shields.io/badge/HuggingFace-Dataset-28A745?style=for-the-badge&logo=huggingface&logoColor=white" alt="Dataset"></a></td> </tr> </table> </div>This model is a LoRA fine-tuned version of unsloth/gpt-oss-20b for medical radiology diagnosis, developed as part of a study benchmarking and adapting on-device large language models for clinical decision support. Trained on EuroRad clinical cases, it generates step-by-step diagnostic reasoning from patient history and imaging findings, mapping symptoms to differentials and converging on a final diagnosis with supporting evidence.
The model employs a systematic diagnostic framework: (1) relating clinical history to imaging findings, (2) mapping findings to each differential, (3) systematic elimination of alternatives, and (4) converging on a final diagnosis with confidence reasoning.
| Base Model | unsloth/gpt-oss-20b |
| Fine-tuning Method | LoRA (Low-Rank Adaptation) |
| Training Framework | Unsloth |
| Task | Medical diagnosis from radiology reports |
| Training Dataset | wanglab/eurorad-gpt-oss-training-data |
| Sequence Length | 4,096 tokens |
| Quantization | 4-bit |
| Adapter Size | 2.27 GB |
| License | Apache-2.0 (research use only) |
pip install unsloth peft transformers accelerate bitsandbytes
from unsloth import FastLanguageModel
from peft import PeftModel
# Load base model
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="unsloth/gpt-oss-20b",
dtype=None,
max_seq_length=4096,
load_in_4bit=True,
full_finetuning=False,
)
# Load LoRA adapter
model = PeftModel.from_pretrained(
model,
"wanglab/on-device-LLM-gpt-oss-20b",
is_trainable=False
)
# Enable inference mode
FastLanguageModel.for_inference(model)
# Example inference
prompt = """You are an expert radiologist demonstrating step-by-step diagnostic reasoning.
Case presentation:
{combined_description}
Differential diagnoses to consider:
{dd_formatted}
Generate systematic Chain-of-Thought reasoning that shows how clinicians think through cases:
1. **Connect symptoms to findings**: Link clinical presentation with imaging observations
2. **Map to differentials**: Show how findings support or contradict each differential diagnosis
3. **Systematic elimination**: Explicitly rule out less likely options with reasoning
4. **Converge to answer**: Demonstrate the logical path to the correct diagnosis"""
inputs = tokenizer(prompt.format(
combined_description="...", # clinical history + imaging findings
dd_formatted="Diagnosis A, Diagnosis B, Diagnosis C"
), return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=1024, temperature=0.1)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
| Framework | Unsloth |
| Dataset | wanglab/eurorad-gpt-oss-training-data |
| Cases | 1,894 EuroRad radiology cases |
| Input | Text only (clinical history + imaging report) |
| Optimization | 4-bit quantization + LoRA |
| Sequence Length | 4,096 tokens |
Citation will be updated upon arXiv submission and journal publication.
@article{munim2025ondevice,
title={Benchmarking and Adapting On-Device Large Language Models for Clinical Decision Support},
author={Munim, Alif and Ma, Jun and Ibrahim, Omar and Abdalla, Alhusain and Yin, Shuolin and Chen, Leo and Wang, Bo},
journal={},
year={2025}
}
For issues and questions, please open a discussion in this repository.
Corresponding author: Bo Wang — [email protected]
Disclaimer: This model is for research purposes only and has not been approved for clinical use. Always consult qualified healthcare professionals for medical decisions.