Text Generation
Transformers
Safetensors
English
Chinese
qwen3
medical
reasoning
conversational
text-generation-inference
Instructions to use FreedomIntelligence/HuatuoGPT-3-32B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FreedomIntelligence/HuatuoGPT-3-32B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FreedomIntelligence/HuatuoGPT-3-32B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FreedomIntelligence/HuatuoGPT-3-32B") model = AutoModelForCausalLM.from_pretrained("FreedomIntelligence/HuatuoGPT-3-32B") messages = [ {"role": "user", "content": "Who are you?"}, ] 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FreedomIntelligence/HuatuoGPT-3-32B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FreedomIntelligence/HuatuoGPT-3-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": "FreedomIntelligence/HuatuoGPT-3-32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FreedomIntelligence/HuatuoGPT-3-32B
- SGLang
How to use FreedomIntelligence/HuatuoGPT-3-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 "FreedomIntelligence/HuatuoGPT-3-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": "FreedomIntelligence/HuatuoGPT-3-32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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-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": "FreedomIntelligence/HuatuoGPT-3-32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FreedomIntelligence/HuatuoGPT-3-32B with Docker Model Runner:
docker model run hf.co/FreedomIntelligence/HuatuoGPT-3-32B
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
- zh
|
| 8 |
+
base_model:
|
| 9 |
+
- Qwen/Qwen3-32B
|
| 10 |
+
tags:
|
| 11 |
+
- medical
|
| 12 |
+
- reasoning
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
<div align="center">
|
| 16 |
+
<h1>🩺 HuatuoGPT-3-32B</h1>
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
<div align="center">
|
| 20 |
+
<a href="https://github.com/FreedomIntelligence/HuatuoGPT-3" target="_blank">🏠 GitHub</a>
|
| 21 |
+
|
|
| 22 |
+
<a href="" target="_blank">📄 Paper</a>
|
| 23 |
+
</div>
|
| 24 |
+
|
| 25 |
+
# <span>Introduction</span>
|
| 26 |
+
|
| 27 |
+
**HuatuoGPT-3** is an open-source medical LLM trained with **SeedRL**, an RL-only domain adaptation paradigm that transforms a base model into a medical expert in a single RL stage.
|
| 28 |
+
|
| 29 |
+
For more information, visit our GitHub repository:
|
| 30 |
+
[https://github.com/FreedomIntelligence/HuatuoGPT-3](https://github.com/FreedomIntelligence/HuatuoGPT-3)
|
| 31 |
+
|
| 32 |
+
> [!IMPORTANT]
|
| 33 |
+
> **HuatuoGPT-3-32B is set to thinking mode by default.** The output contains a `<think>...</think>` reasoning block followed by the final response after `</think>`.
|
| 34 |
+
|
| 35 |
+
# <span>Model Info</span>
|
| 36 |
+
|
| 37 |
+
| Model | Description | Backbone | Link |
|
| 38 |
+
| --- | --- | --- | --- |
|
| 39 |
+
| **HuatuoGPT-3-32B** | 32B medical LLM trained with SeedRL | Qwen3-32B | [HF Link](https://huggingface.co/FreedomIntelligence/HuatuoGPT-3-32B) |
|
| 40 |
+
| **HuatuoGPT-3-8B** | 8B medical LLM trained with SeedRL | Qwen3-8B-Base | [HF Link](https://huggingface.co/FreedomIntelligence/HuatuoGPT-3-8B) |
|
| 41 |
+
| **HuatuoGPT-3-7B-Pangu** | 7B medical LLM trained with SeedRL | openPangu-Embedded-7B | [HF Link](https://huggingface.co/FreedomIntelligence/HuatuoGPT-3-7B-Pangu) |
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
# <span>Usage</span>
|
| 45 |
+
|
| 46 |
+
You can use HuatuoGPT-3-8B in the same way as `Qwen3-32B`. You can deploy it with tools like [vLLM](https://github.com/vllm-project/vllm) or [SGLang](https://github.com/sgl-project/sglang), or perform direct inference:
|
| 47 |
+
|
| 48 |
+
```python
|
| 49 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 50 |
+
|
| 51 |
+
model_name = "FreedomIntelligence/HuatuoGPT-3-32B"
|
| 52 |
+
|
| 53 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 54 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 55 |
+
model_name,
|
| 56 |
+
torch_dtype="auto",
|
| 57 |
+
device_map="auto"
|
| 58 |
+
)
|
| 59 |
+
|
| 60 |
+
messages = [
|
| 61 |
+
{"role": "user", "content": "A patient has fever, cough, and shortness of breath. What should be considered first?"}
|
| 62 |
+
]
|
| 63 |
+
|
| 64 |
+
text = tokenizer.apply_chat_template(
|
| 65 |
+
messages,
|
| 66 |
+
tokenize=False,
|
| 67 |
+
add_generation_prompt=True
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 71 |
+
outputs = model.generate(**inputs, max_new_tokens=4096)
|
| 72 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
# <span>📖 Citation</span>
|
| 76 |
+
|
| 77 |
+
```bibtex
|
| 78 |
+
@article{huatuogpt3,
|
| 79 |
+
title={HuatuoGPT-3: RL-Only Domain Adaptation from Base Models via Off-Policy Seeding},
|
| 80 |
+
author={Coming soon},
|
| 81 |
+
journal={arXiv preprint},
|
| 82 |
+
year={2026}
|
| 83 |
+
}
|
| 84 |
+
```
|