Instructions to use QingboKang/SonoReasoner-32B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QingboKang/SonoReasoner-32B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="QingboKang/SonoReasoner-32B") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("QingboKang/SonoReasoner-32B") model = AutoModelForMultimodalLM.from_pretrained("QingboKang/SonoReasoner-32B", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use QingboKang/SonoReasoner-32B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QingboKang/SonoReasoner-32B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QingboKang/SonoReasoner-32B", "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/QingboKang/SonoReasoner-32B
- SGLang
How to use QingboKang/SonoReasoner-32B 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 "QingboKang/SonoReasoner-32B" \ --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": "QingboKang/SonoReasoner-32B", "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 "QingboKang/SonoReasoner-32B" \ --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": "QingboKang/SonoReasoner-32B", "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 QingboKang/SonoReasoner-32B with Docker Model Runner:
docker model run hf.co/QingboKang/SonoReasoner-32B
SonoReasoner-32B
Model Summary
SonoReasoner-32B is an ultrasound vision-language model for anatomy-grounded ultrasound reasoning. It is initialized from Qwen/Qwen3-VL-32B-Instruct and post-trained using SonoCorpus supervised reasoning initialization followed by GRPO-based clinical task alignment.
Model Details
- Model name: SonoReasoner-32B
- Base model: Qwen/Qwen3-VL-32B-Instruct
- Model type: vision-language model
- Primary modality: ultrasound images and text
- Release type: full model weights
- License: Apache-2.0, following the base Qwen3-VL license
Training Data
- SonoCorpus was used for supervised reasoning initialization.
- A multi-task ultrasound mixture was used for GRPO alignment, covering SonoVQA-based clinical VQA, diagnosis classification, lesion localization, and report generation.
- SonoVQA annotations are released separately at QingboKang/SonoVQA.
- Source ultrasound images are not redistributed due to third-party copyright restrictions.
Training Procedure
SonoReasoner-32B was post-trained in two stages. Stage 1 performs supervised fine-tuning on SonoCorpus, a large-scale corpus of anatomy-grounded ultrasound reasoning examples, to initialize hierarchical reasoning capabilities across protocol, system, and organ levels. Stage 2 applies Group Relative Policy Optimization (GRPO) on a multi-task ultrasound mixture to align the model with clinical task preferences, including VQA, diagnosis classification, lesion localization, and report generation. SFT was conducted with DeepSpeed ZeRO-3 and bfloat16 mixed precision, and GRPO alignment used FSDP full sharding with bfloat16 precision.
Intended Use
Research use in ultrasound VQA, multimodal reasoning, and medical image analysis. The model may be used to study hierarchical ultrasound reasoning, protocol-system-organ grounding, ultrasound VQA, and ultrasound report generation.
Out-of-Scope Use
This model is not intended for clinical diagnosis, treatment planning, patient triage, or autonomous medical decision-making. Outputs should not be used as medical advice. The model has not been validated in clinical settings and must not be deployed as a medical device. Use in direct patient care or as a substitute for professional medical judgment is strictly out of scope.
Evaluation
SonoReasoner was evaluated on SonoVQA and downstream ultrasound tasks including diagnosis classification, lesion localization, and report generation. Full results are reported in the associated manuscript.
Limitations
- The model is trained exclusively on ultrasound images and may not generalize to other medical imaging modalities (e.g., CT, MRI, X-ray).
- Performance may degrade on rare pathological findings or ultrasound protocols underrepresented in the training data.
- The model reflects the annotation distributions in SonoVQA and SonoCorpus; biases in these datasets may propagate to model outputs.
- As with all large vision-language models, the model may produce plausible-sounding but factually incorrect responses.
Ethical and Safety Considerations
This model is intended for research purposes only. This model is not intended for clinical diagnosis, treatment planning, patient triage, or autonomous medical decision-making. Outputs should not be used as medical advice. Users should ensure compliance with applicable healthcare regulations and ethical guidelines when using this model in research contexts. The source ultrasound images used for training are not redistributed, in accordance with third-party data use agreements and patient privacy considerations.
How to Use
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
repo_id = 'QingboKang/SonoReasoner-32B'
processor = AutoProcessor.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
repo_id,
torch_dtype=torch.bfloat16,
device_map='auto',
trust_remote_code=True,
)
# Load an ultrasound image and prepare the input
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": "path/to/ultrasound_image.png"},
{"type": "text", "text": "Describe the anatomical structures visible in this ultrasound image."},
],
}
]
inputs = processor.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt",
)
inputs = inputs.to(model.device)
# Generate a response
generated_ids = model.generate(**inputs, max_new_tokens=512)
response = processor.batch_decode(
generated_ids[:, inputs["input_ids"].shape[1]:],
skip_special_tokens=True,
)[0]
print(response)
The exact multimodal input formatting may depend on the installed transformers and Qwen3-VL implementation. Please follow the official Qwen3-VL inference utilities if needed.
Citation
If you use SonoReasoner, please cite our associated manuscript. The formal citation will be updated after publication.
@article{sonoreasoner2026,
title={SonoReasoner: Hierarchical Clinical Reasoning for Ultrasound Vision-Language Models},
author={...},
journal={...},
year={2026}
}
Contact
For questions, please open an issue on the model repository or contact the authors via the Hugging Face community.
- Downloads last month
- 14
Model tree for QingboKang/SonoReasoner-32B
Base model
Qwen/Qwen3-VL-32B-Instruct