Downloads · 30 days
51
2% of all-time downloads
Rumiii/LlamaMed-3.1-8B-Reasoner
LlamaMed-3.1-8B-Reasoner is a text generation model from Rumiii. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
51
2% of all-time downloads
All-time downloads
2.8K
Public
Parameters
8B
24.8 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors16.1 GB · 65%
From the Hugging Face model README

LlamaMed-3.1-8B-Reasoner is a fine-tune of Llama-3.1-8B-Instruct trained on ReasonMed, a dataset of chain-of-thought medical reasoning over multiple-choice clinical questions. The model works through a question step by step — considering each answer option in turn — before giving a final answer, in the same structured reasoning style as its training data.
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
import torch
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
)
tokenizer = AutoTokenizer.from_pretrained("Rumiii/LlamaMed-3.1-8B-Reasoner")
model = AutoModelForCausalLM.from_pretrained(
"Rumiii/LlamaMed-3.1-8B-Reasoner",
device_map={"": 0},
quantization_config=bnb_config,
)
messages = [
{"role": "user", "content": "A 45-year-old man presents with polyuria, polydipsia, and weight loss. Fasting blood glucose is 210 mg/dL. What is the most likely diagnosis?\nA. Type 1 Diabetes Mellitus\nB. Type 2 Diabetes Mellitus\nC. Diabetes Insipidus\nD. Cushing's Syndrome"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1500, temperature=0.6, top_p=0.95)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Trained on a single Tesla T4 GPU using Unsloth for memory-efficient QLoRA fine-tuning, with periodic adapter checkpoints saved during training.
This model is a research checkpoint intended for exploring medical reasoning fine-tunes. It is not validated for clinical use and should not be used to inform real medical decisions.