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
| library_name: transformers | |
| license: apache-2.0 | |
| pipeline_tag: text-generation | |
| language: | |
| - en | |
| - zh | |
| base_model: | |
| - Qwen/Qwen3-32B | |
| tags: | |
| - medical | |
| - reasoning | |
| <div align="center"> | |
| <h1>๐ฉบ HuatuoGPT-3-32B</h1> | |
| </div> | |
| <div align="center"> | |
| <a href="https://github.com/FreedomIntelligence/HuatuoGPT-3" target="_blank">๐ GitHub</a> | |
| | | |
| <a href="" target="_blank">๐ Paper</a> | |
| </div> | |
| # <span>Introduction</span> | |
| **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. | |
| For more information, visit our GitHub repository: | |
| [https://github.com/FreedomIntelligence/HuatuoGPT-3](https://github.com/FreedomIntelligence/HuatuoGPT-3) | |
| > [!IMPORTANT] | |
| > **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>`. | |
| # <span>Model Info</span> | |
| | Model | Description | Backbone | Link | | |
| | --- | --- | --- | --- | | |
| | **HuatuoGPT-3-32B** | 32B medical LLM trained with SeedRL | Qwen3-32B | [HF Link](https://huggingface.co/FreedomIntelligence/HuatuoGPT-3-32B) | | |
| | **HuatuoGPT-3-8B** | 8B medical LLM trained with SeedRL | Qwen3-8B-Base | [HF Link](https://huggingface.co/FreedomIntelligence/HuatuoGPT-3-8B) | | |
| | **HuatuoGPT-3-7B-Pangu** | 7B medical LLM trained with SeedRL | openPangu-Embedded-7B | [HF Link](https://huggingface.co/FreedomIntelligence/HuatuoGPT-3-7B-Pangu) | | |
| # <span>Usage</span> | |
| 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: | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_name = "FreedomIntelligence/HuatuoGPT-3-32B" | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_name, | |
| torch_dtype="auto", | |
| device_map="auto" | |
| ) | |
| messages = [ | |
| {"role": "user", "content": "A patient has fever, cough, and shortness of breath. What should be considered first?"} | |
| ] | |
| 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) | |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) | |
| ``` | |
| # <span>๐ Citation</span> | |
| ```bibtex | |
| @article{huatuogpt3, | |
| title={HuatuoGPT-3: RL-Only Domain Adaptation from Base Models via Off-Policy Seeding}, | |
| author={Coming soon}, | |
| journal={arXiv preprint}, | |
| year={2026} | |
| } | |
| ``` | |