Instructions to use yasserrmd/MedScholar-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yasserrmd/MedScholar-1.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yasserrmd/MedScholar-1.5B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yasserrmd/MedScholar-1.5B") model = AutoModelForCausalLM.from_pretrained("yasserrmd/MedScholar-1.5B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yasserrmd/MedScholar-1.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yasserrmd/MedScholar-1.5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yasserrmd/MedScholar-1.5B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/yasserrmd/MedScholar-1.5B
- SGLang
How to use yasserrmd/MedScholar-1.5B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "yasserrmd/MedScholar-1.5B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yasserrmd/MedScholar-1.5B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "yasserrmd/MedScholar-1.5B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yasserrmd/MedScholar-1.5B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio
How to use yasserrmd/MedScholar-1.5B with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for yasserrmd/MedScholar-1.5B to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for yasserrmd/MedScholar-1.5B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for yasserrmd/MedScholar-1.5B to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="yasserrmd/MedScholar-1.5B", max_seq_length=2048, ) - Docker Model Runner
How to use yasserrmd/MedScholar-1.5B with Docker Model Runner:
docker model run hf.co/yasserrmd/MedScholar-1.5B
🧠 MedScholar-1.5B
MedScholar-1.5B is a compact, instruction-aligned medical question-answering model fine-tuned on 1 million randomly selected examples from the MIRIAD-4.4M dataset. It is based on the Qwen/Qwen2.5-1.5B-Instruct model and designed for efficient, in-context clinical knowledge exploration — not diagnosis.
📌 Model Details
- Base Model: Qwen2.5-1.5B-Instruct-unsloth-bnb-4bit
- Fine-tuning Dataset: MIRIAD-4.4M
- Samples Used: 1,000,000 examples randomly selected from the full set
- Prompt Style: Minimal QA format (see below)
- Training Framework: Unsloth with QLoRA
- License: Apache-2.0 (inherits from base model); dataset is ODC-By 1.0
📋 Prompt Format
### Question:
What is the role of LDL in cardiovascular health?
### Answer:
LDL plays a central role in the development of atherosclerosis by delivering cholesterol to peripheral tissues...
- The model expects the prompt to end with
### Answer:, and will generate only the answer text. - Do not include the answer in the prompt during inference.
🔒 Dataset Consent & License
This model was fine-tuned using randomly selected 1 million examples from the MIRIAD-4.4M dataset, which is released under the ODC-By 1.0 License.
The MIRIAD dataset is intended exclusively for academic research and educational exploration. As stated by its authors:
“The outputs generated by models trained or fine-tuned on this dataset must not be used for medical diagnosis or decision-making involving real individuals.”
⚠️ Intended Use
This model is for research, educational, and exploration purposes only. It is not a medical device and must not be used to provide clinical advice, diagnosis, or treatment.
💡 Example Inference (Python)
from transformers import pipeline
pipe = pipeline("text-generation", model="yasserrmd/MedScholar-1.5B", device=0)
prompt = """### Question:
What are the symptoms of acute pancreatitis?
### Answer:
"""
response = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7)
print(response[0]["generated_text"])
🤝 Acknowledgements
- MIRIAD Dataset by Zheng et al. (2025) – https://huggingface.co/datasets/miriad/miriad-4.4M
- Qwen2.5 by Alibaba – https://huggingface.co/Qwen
- Training infrastructure: Unsloth
📄 Citation
@misc{yasser2025medscholar,
title = {MedScholar-1.5B: Compact medical QA model fine-tuned on MIRIAD},
author = {Mohamed Yasser},
year = {2025},
howpublished = {\url{https://huggingface.co/yasserrmd/MedScholar-1.5B}},
}
This qwen2 model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 20