How to use from
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 "FreedomIntelligence/HuatuoGPT-3-9B" \
    --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": "FreedomIntelligence/HuatuoGPT-3-9B",
		"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 "FreedomIntelligence/HuatuoGPT-3-9B" \
        --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": "FreedomIntelligence/HuatuoGPT-3-9B",
		"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"
						}
					}
				]
			}
		]
	}'
Quick Links

🩺 HuatuoGPT-3-9B

🏠 GitHub | 📄 Paper

Introduction

HuatuoGPT-3-9B is a medical LLM built on Qwen3.5-9B with One-stage Policy Optimization (OnePO). OnePO adapts language models to medicine in a single reinforcement-learning stage, without preceding domain-specific supervised fine-tuning. Teacher responses provide temporary guidance and are retired as the model improves.

We release the training code, medical RL dataset, and 8B rubric grader.

HuatuoGPT-3 requires thinking mode. Keep enable_thinking=True during inference. The model generates reasoning before providing its final answer after </think>.

Model Info

Model Backbone Purpose Access
HuatuoGPT-3-9B Qwen3.5-9B Medical reasoning HF Link
HuatuoGPT-3-27B Qwen3.8-27B Medical reasoning HF Link

Usage

The included generation config enables sampling with temperature=0.2. Override these settings in model.generate() when needed.

HuatuoGPT-3-9B can be used like Qwen3.5-9B and deployed with vLLM or SGLang.

For direct text inference, use a Transformers version with Qwen3.5 support (transformers>=5.4.0) and accelerate:

from transformers import AutoModelForImageTextToText, AutoProcessor

model_id = "FreedomIntelligence/HuatuoGPT-3-9B"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
    model_id,
    dtype="auto",
    device_map="auto",
).eval()

messages = [{
    "role": "user",
    "content": [{"type": "text", "text": "What are the common causes of chest pain?"}],
}]
inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    enable_thinking=True,
    return_dict=True,
    return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=4096)
response = outputs[0, inputs["input_ids"].shape[-1]:]
print(processor.decode(response, skip_special_tokens=True))

📖 Citation

@inproceedings{chen2026onepo,
  title={OnePO: Direct One-stage Policy Optimization for SFT-free Domain Adaptation},
  author={Chen, Junying and Xie, Xinyuan and Li, Ziniu and Wang, Benyou},
  booktitle={Proceedings of the 43rd International Conference on Machine Learning},
  year={2026}
}
Downloads last month
337
Safetensors
Model size
9B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 1 Ask for provider support

Model tree for FreedomIntelligence/HuatuoGPT-3-9B

Finetuned
Qwen/Qwen3.5-9B
Finetuned
(992)
this model
Merges
1 model
Quantizations
2 models