Run this model with HF Jobs
Run OpenMed/OpenMed-Medical-27B-Preview-01 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/OpenMed/OpenMed-Medical-27B-Preview-01. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OpenMed/OpenMed-Medical-27B-Preview-01 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/OpenMed/OpenMed-Medical-27B-Preview-01. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/OpenMed/OpenMed-Medical-27B-Preview-01. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use OpenMed/OpenMed-Medical-27B-Preview-01 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMed/OpenMed-Medical-27B-Preview-01 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenMed/OpenMed-Medical-27B-Preview-01") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("OpenMed/OpenMed-Medical-27B-Preview-01") model = AutoModelForMultimodalLM.from_pretrained("OpenMed/OpenMed-Medical-27B-Preview-01", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenMed/OpenMed-Medical-27B-Preview-01 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenMed/OpenMed-Medical-27B-Preview-01" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenMed/OpenMed-Medical-27B-Preview-01", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/OpenMed/OpenMed-Medical-27B-Preview-01
- SGLang
How to use OpenMed/OpenMed-Medical-27B-Preview-01 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 "OpenMed/OpenMed-Medical-27B-Preview-01" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenMed/OpenMed-Medical-27B-Preview-01", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "OpenMed/OpenMed-Medical-27B-Preview-01" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenMed/OpenMed-Medical-27B-Preview-01", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use OpenMed/OpenMed-Medical-27B-Preview-01 with Docker Model Runner:
docker model run hf.co/OpenMed/OpenMed-Medical-27B-Preview-01
OpenMed Medical 27B Preview 01
An experimental preview of OpenMed's medical fine-tune of Qwen3.8-27B. It thinks a medical question through before it answers, and it runs on your own hardware as one standalone checkpoint. We are releasing three preview checkpoints from the same line of work so that people can try them on real questions and tell us what works and what does not. Preview 01 is the lightest touch of the three and stays closest to Qwen3.8-27B.
| Developed by | OpenMed |
|---|---|
| Base model | Qwen3.8-27B by the Qwen team (Apache-2.0) |
| Status | Experimental preview, shared for feedback |
| The previews | Preview 01 (this one) ยท Preview 02 ยท Preview 03 |
| Size | 27B parameters, FP16 safetensors in 18 shards, about 55.6 GB |
| Input | English text. The base model's vision components are included but were not tested in this preview. |
| Output | A reasoning block, then the answer |
| License | Apache-2.0 |
About OpenMed
OpenMed builds open models and open-source tools for clinical and biomedical text that run on your own hardware.
- 2,300+ open models on Hugging Face for clinical NER, de-identification, clinical trials and more.
- The OpenMed Python SDK, Apache-2.0:
pip install openmedfor de-identification, clinical NER, and FHIR and HL7 tooling, all local. - New models every week: follow OpenMed on Hugging Face and @OpenMed_AI on X.
Quick start
pip install -U transformers accelerate torch torchvision pillow
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer, set_seed
model_id = "OpenMed/OpenMed-Medical-27B-Preview-01"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id, dtype=torch.float16, device_map="auto"
).eval()
messages = [{"role": "user", "content": "A patient on lisinopril asks if they can take ibuprofen for a few days of knee pain. What should their clinician weigh?"}]
inputs = tokenizer.apply_chat_template(
messages, tokenize=True, add_generation_prompt=True,
enable_thinking=True, return_dict=True, return_tensors="pt",
).to(model.device)
set_seed(38241)
with torch.inference_mode():
output_ids = model.generate(
**inputs, max_new_tokens=4096, do_sample=True, temperature=1.0, top_p=0.95, top_k=20,
eos_token_id=[248046, 248044], pad_token_id=248044,
)
completion = output_ids[0, inputs["input_ids"].shape[-1]:]
print(tokenizer.decode(completion, skip_special_tokens=True))
These are the sampling settings we use, and the checkpoint's generation_config.json sets the same ones by default. Give it room to think: the answers in this card took 352 to 1,953 new tokens, so 4,096 is plenty here, and harder questions can use 8,192 or more.
One real answer
The answer this preview gave to the question above, in our run of this code (the reasoning block is left out here):
The clinician should weigh whether short-term ibuprofen is safe for this patient, since ibuprofen can interact with lisinopril in ways that are usually acceptable for healthy adults but can be significant in higher-risk patients.
Key considerations:
Kidney function risk
- NSAIDs like ibuprofen can reduce prostaglandin-mediated kidney blood flow.
- Combined with an ACE inhibitor like lisinopril, this can lower glomerular filtration rate and precipitate acute kidney injury, especially if:
- The patient has chronic kidney disease
- They are older
- They are dehydrated or volume depleted
- They are also taking a diuretic โ this โtriple whammyโ of ACE inhibitor + NSAID + diuretic carries the highest AKI risk
Blood pressure control
- NSAIDs can blunt the effect of antihypertensives.
- Ibuprofen may cause salt and water retention, raising blood pressure even over a few days.
Gastrointestinal bleeding/ulcer risk
- NSAIDs increase GI bleeding risk, particularly in older adults, people with prior ulcer/bleeding, or those also using aspirin, anticoagulants, antiplatelets, corticosteroids, or SSRIs/SNRIs.
Cardiovascular risk
- NSAIDs can increase cardiovascular risk, especially in people with established heart disease, heart failure, or uncontrolled hypertension.
- Short, low-dose use is usually lower risk, but the patientโs baseline risk matters.
Need for NSAID vs safer alternatives
- For knee pain, safer or less systemic options may include:
- Acetaminophen, if appropriate
- Topical NSAID such as diclofenac gel
- Ice/heat, compression, activity modification, or physical therapy
- Short course of topical agents rather than oral ibuprofen, if pain is localized
If ibuprofen is used
- Use the lowest effective dose for the shortest duration.
- Take with food and adequate fluids.
- Avoid if dehydrated, vomiting, febrile, or on a diuretic unless specifically cleared.
- Monitor blood pressure and watch for reduced urine output, swelling, dizziness, or GI symptoms.
- Avoid combining with other NSAIDs, aspirin for pain, or alcohol unnecessarily.
In short: for a healthy, well-hydrated patient with normal kidneys and controlled blood pressure, a few days of low-dose ibuprofen may often be reasonable. But the clinician should specifically assess renal function, blood pressure, heart/kidney disease, dehydration risk, GI bleeding risk, and whether a topical or non-NSAID option would be safer.
The three previews
- Preview 01 stays closest to Qwen3.8-27B.
- Preview 02 is tuned further. Start here.
- Preview 03 is the most strongly tuned.
Try the same question on two of them and tell us which answer you would rather give a colleague.
Tell us what you find
Open a discussion in the Community tab of this page with the question, the answer and what was right or wrong about it. Good answers, wrong answers and strange answers all help shape the next version.
Before you use it
- A preview. Shared for hands-on testing and feedback, not for leaderboard comparisons.
- Research and prototyping only. Answers can be wrong, incomplete or out of date, and long answers can run out of tokens. Do not use it for diagnosis, treatment or any decision about a patient.
- English text. Other languages and image input were not tested.
Built on
OpenMed fine-tuned this model from Qwen3.8-27B by the Qwen team (Apache-2.0). Thank you to the Qwen team for releasing it openly. See LICENSE and NOTICE.
OpenMed ยท Hugging Face ยท GitHub ยท PyPI ยท X
- Downloads last month
- 55
Model tree for OpenMed/OpenMed-Medical-27B-Preview-01
Base model
Qwen/Qwen3.8-27B