Instructions to use FreedomIntelligence/HuatuoGPT-3-7B-Pangu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FreedomIntelligence/HuatuoGPT-3-7B-Pangu with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FreedomIntelligence/HuatuoGPT-3-7B-Pangu", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("FreedomIntelligence/HuatuoGPT-3-7B-Pangu", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FreedomIntelligence/HuatuoGPT-3-7B-Pangu with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FreedomIntelligence/HuatuoGPT-3-7B-Pangu" # 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-7B-Pangu", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FreedomIntelligence/HuatuoGPT-3-7B-Pangu
- SGLang
How to use FreedomIntelligence/HuatuoGPT-3-7B-Pangu 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-7B-Pangu" \ --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-7B-Pangu", "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-7B-Pangu" \ --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-7B-Pangu", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FreedomIntelligence/HuatuoGPT-3-7B-Pangu with Docker Model Runner:
docker model run hf.co/FreedomIntelligence/HuatuoGPT-3-7B-Pangu
🩺 HuatuoGPT-3-7B-Pangu
Introduction
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.
HuatuoGPT-3-7B-Pangu is the Pangu-based variant in the HuatuoGPT-3 series. Different from the Qwen-based versions, it is built on FreedomIntelligence/openPangu-Embedded-7B and trained with Ascend NPUs.
For more information, visit our GitHub repository: https://github.com/FreedomIntelligence/HuatuoGPT-3
HuatuoGPT-3-7B-Pangu is set to thinking mode by default. Since it is based on openPangu, the generated reasoning content is placed between
[unused16]and[unused17], and the final response starts after[unused17].
Model Info
| Model | Description | Backbone | Link |
|---|---|---|---|
| HuatuoGPT-3-32B | 32B medical LLM trained with SeedRL | Qwen3-32B | HF Link |
| HuatuoGPT-3-8B | 8B medical LLM trained with SeedRL | Qwen3-8B-Base | HF Link |
| HuatuoGPT-3-7B-Pangu | 7B medical LLM trained with SeedRL | openPangu-Embedded-7B | HF Link |
Usage
You can use HuatuoGPT-3-7B-Pangu in the same way as FreedomIntelligence/openPangu-Embedded-7B.
When using this model, please note that the Pangu backbone requires trust_remote_code=True in Transformers, and --trust_remote_code when serving with vLLM.
- Direct inference:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "FreedomIntelligence/HuatuoGPT-3-7B-Pangu"
tokenizer = AutoTokenizer.from_pretrained(
model_name,
use_fast=False,
trust_remote_code=True
)
model = AutoModelForCausalLM.from_pretrained(
model_name,
trust_remote_code=True,
torch_dtype="auto",
device_map="auto"
)
messages = [
{"role": "user", "content": "What are the common causes of chest pain?"}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=4096,
eos_token_id=45892,
return_dict_in_generate=True
)
input_length = inputs.input_ids.shape[1]
generated_tokens = outputs.sequences[:, input_length:]
output_text = tokenizer.decode(generated_tokens[0])
thinking_content = output_text.split("[unused17]")[0].split("[unused16]")[-1].strip()
content = output_text.split("[unused17]")[-1].split("[unused10]")[0].strip()
print("thinking content:", thinking_content)
print("content:", content)
- You can also serve the model with vLLM. Make sure to include
--trust_remote_code:
CUDA_VISIBLE_DEVICES=0 \
vllm serve FreedomIntelligence/HuatuoGPT-3-7B-Pangu \
--served-model-name HuatuoGPT-3-7B-Pangu \
--trust_remote_code \
--port 8000
Or:
CUDA_VISIBLE_DEVICES=0 \
python -m vllm.entrypoints.openai.api_server \
--model FreedomIntelligence/HuatuoGPT-3-7B-Pangu \
--served-model-name HuatuoGPT-3-7B-Pangu \
--trust_remote_code \
--port 8000
📖 Citation
@article{huatuogpt3,
title={HuatuoGPT-3: RL-Only Domain Adaptation from Base Models via Off-Policy Seeding},
author={Coming soon},
journal={arXiv preprint},
year={2026}
}
- Downloads last month
- 20
Model tree for FreedomIntelligence/HuatuoGPT-3-7B-Pangu
Base model
FreedomIntelligence/openPangu-Embedded-7B