Downloads · 30 days
13
2% of all-time downloads
CMLM/Dao1-30b-a3b
Dao1-30b-a3b is a machine learning model from CMLM. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
13
2% of all-time downloads
All-time downloads
765
Public
Parameters
30.5B
61.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors61.1 GB · 100%
From the Hugging Face model README
医哲未来人工智能研究院
IMPF-AI — Institute of Medical Philosophy & Future AI
</div>以道御术,智汇岐黄,承古开新,济世惠民
Guided by the Tao, uniting classical wisdom with modern intelligence — to inherit the ancient and open the new, for the benefit of all.
小道(Dao1-30b-a3b) 是由 医哲未来人工智能研究院(IMPF-AI) 自主研发的专业中医知识大语言模型,英文名 Tao,取义于"道"——中医理论体系之根本。
| 属性 | 详情 |
|---|---|
| 模型 ID | CMLM/Dao1-30b-a3b |
| 基础模型 | Qwen3-30B-A3B(稀疏混合专家,激活参数 3B) |
| 参数量 | 30B 总参数 / 3B 激活参数(MoE) |
| 推理模式 | 非 Thinking 模式(节约 tokens,提升响应速度) |
| 语言 | 中文(优先)/ 英文 |
| 专项能力 | 中医经典理论、本草方剂、辨证论治、古籍解读 |
| 精度 | float16 |
| 许可证 | 非商业、非医疗研究用途 |
医哲未来人工智能研究院(IMPF-AI,Institute of Medical Philosophy & Future AI) 致力于在硅基芯片中重构碳基生命的医学智慧,构建可信医疗 AI 系统。
研究院核心研究方向涵盖:
研究院已荣获国家卫健委第二届全国数字健康创新应用大赛一等奖、英特尔中国学术峰会 Best Demo Award、百川·亚马逊云科技医疗大赛黑客松大赛亚军等奖项。
Dao1-30b-a3b 基于 Qwen3-30B-A3B(阿里云通义团队)进行专项后训练。Qwen3-30B-A3B 采用稀疏混合专家(Sparse MoE)架构,全量参数 30B,每次推理仅激活约 3B 参数,在保持高性能的同时大幅降低推理开销。
本模型经过大批量中医古籍与专业文献数据的监督微调(SFT),数据来源包括但不限于:
为节约推理 tokens、提升响应速度,Dao1-30b-a3b 默认采用非 Thinking 模式,不输出中间推理链(<think>...</think> 块),直接生成高质量答案。如有需要深度推演的研究场景,可在 system prompt 中显式引导模型输出思维链。
| 参数 | 推荐值 | 说明 |
|---|---|---|
temperature | 0.6 – 0.8 | 控制输出多样性,建议中医问答使用 0.7 |
top_p | 0.85 – 0.95 | 核采样,推荐 0.9 |
max_new_tokens | 256 – 8192 | 根据任务复杂度调整 |
do_sample | True | 开启采样以获得更自然输出 |
repetition_penalty | 1.05 – 1.15 | 适当惩罚重复,推荐 1.1 |
pip install torch transformers accelerate
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
MODEL_ID = "CMLM/Dao1-30b-a3b"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype=torch.float16,
trust_remote_code=True,
device_map="auto",
attn_implementation="eager",
)
SYSTEM_PROMPT = (
"你是小道(英文名 Tao),由医哲未来人工智能研究院自主研发的专业中医知识助手。"
"请基于中医理论,以专业、准确、条理清晰的方式回答问题。"
)
user_prompt = "请从中医角度简要说明肾主骨的含义。"
text = (
f"<|im_start|>system\n{SYSTEM_PROMPT}<|im_end|>\n"
f"<|im_start|>user\n{user_prompt}<|im_end|>\n"
"<|im_start|>assistant\n"
)
inputs = tokenizer(text, return_tensors="pt", add_special_tokens=False).to(model.device)
streamer = TextStreamer(tokenizer, skip_prompt=True)
_ = model.generate(
**inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1,
use_cache=True,
streamer=streamer,
)
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
from threading import Thread
MODEL_ID = "CMLM/Dao1-30b-a3b"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype=torch.float16,
trust_remote_code=True,
device_map="auto",
attn_implementation="eager",
)
SYSTEM_PROMPT = (
"你是小道(英文名 Tao),由医哲未来人工智能研究院自主研发的专业中医知识助手。"
"请基于中医理论,以专业、准确、条理清晰的方式回答问题。"
)
def build_prompt(history: list[dict], user_input: str) -> str:
text = f"<|im_start|>system\n{SYSTEM_PROMPT}<|im_end|>\n"
for turn in history:
text += f"<|im_start|>{turn['role']}\n{turn['content']}<|im_end|>\n"
text += f"<|im_start|>user\n{user_input}<|im_end|>\n<|im_start|>assistant\n"
return text
def chat(history: list[dict], user_input: str) -> str:
prompt = build_prompt(history, user_input)
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
thread = Thread(target=model.generate, kwargs=dict(
**inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1,
use_cache=True,
streamer=streamer,
))
thread.start()
response = ""
for token in streamer:
print(token, end="", flush=True)
response += token
thread.join()
print()
return response
# 使用示例
history = []
while True:
user_input = input("用户: ").strip()
if not user_input:
continue
if user_input in ("退出", "exit", "quit"):
break
reply = chat(history, user_input)
history.append({"role": "user", "content": user_input})
history.append({"role": "assistant", "content": reply})
from transformers import pipeline
import torch
pipe = pipeline(
"text-generation",
model="CMLM/Dao1-30b-a3b",
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True,
)
messages = [
{"role": "system", "content": "你是小道,由医哲未来人工智能研究院研发的专业中医知识助手。"},
{"role": "user", "content": "五行与五脏的对应关系是什么?"},
]
output = pipe(messages, max_new_tokens=512, temperature=0.7, top_p=0.9, do_sample=True)
print(output[0]["generated_text"][-1]["content"])
⚠️ 严重声明
本模型及其所有衍生物:
使用本模型即表示您已阅读、理解并同意以上条款。
如您在研究中使用了本模型,请引用以下文献:
@misc{dao1-30b-a3b-2025,
title = {Dao1: Achieving Expert-Level Traditional Chinese Medicine Reasoning},
author = {Yanlan Kang and Xin Li and Yue Chen and Yide Fang},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/CMLM/Dao1-30b-a3b}},
note = {Institute of Medical Philosophy \& Future AI (IMPF-AI)}
}
Dao1-30b-a3b (Chinese name: 小道 Xiǎo Dào, English name: Tao) is a professional Traditional Chinese Medicine (TCM) large language model developed by the Institute of Medical Philosophy & Future AI (IMPF-AI). The name Tao (道) — meaning "the Way" — reflects the philosophical foundation of TCM theory.
| Attribute | Details |
|---|---|
| Model ID | CMLM/Dao1-30b-a3b |
| Base Model | Qwen3-30B-A3B (Sparse MoE, 3B activated parameters) |
| Parameters | 30B total / 3B activated (MoE architecture) |
| Inference Mode | Non-Thinking (token-efficient, faster response) |
| Languages | Chinese (primary) / English |
| Specialization | Classical TCM theory, materia medica, syndrome differentiation, classical texts |
| Precision | float16 |
| License | Non-commercial, non-clinical research only |
The Institute of Medical Philosophy & Future AI (IMPF-AI 医哲未来人工智能研究院) is dedicated to reconstructing the wisdom of carbon-based life within silicon-based chips — building trustworthy medical AI systems that bridge ancient philosophy with cutting-edge computation.
Core research pillars:
IMPF-AI has received the 1st Prize at the National Health Commission's 2nd National Digital Health Innovation Competition, Best Demo at the Intel China Academic Summit, and 2nd Place at the AWS Healthcare Hackathon. The institute operates a 10PB+ de-identified medical data platform and simulates 10M+ virtual cells daily.
Official website: https://impfai.github.io
Dao1-30b-a3b is built upon Qwen3-30B-A3B (Alibaba Cloud Tongyi Team), a Sparse Mixture-of-Experts (MoE) architecture with 30B total parameters and approximately 3B activated parameters per forward pass — achieving high performance while substantially reducing inference cost.
The model underwent Supervised Fine-Tuning (SFT) on a large-scale corpus of classical TCM texts and professional medical literature, including but not limited to:
To reduce token consumption and improve response latency, Dao1-30b-a3b defaults to Non-Thinking mode — suppressing intermediate chain-of-thought blocks (<think>...</think>) and generating high-quality answers directly. For research scenarios requiring deep multi-step reasoning, chain-of-thought can be explicitly prompted via the system prompt.
pip install torch transformers accelerate
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
MODEL_ID = "CMLM/Dao1-30b-a3b"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype=torch.float16,
trust_remote_code=True,
device_map="auto",
attn_implementation="eager",
)
SYSTEM_PROMPT = (
"You are Tao (小道), a professional TCM knowledge assistant developed by "
"the Institute of Medical Philosophy & Future AI (IMPF-AI). "
"Please answer questions based on Traditional Chinese Medicine theory "
"in a professional, accurate, and well-organized manner."
)
user_prompt = "Briefly explain the TCM concept that 'the kidney governs bones'."
text = (
f"<|im_start|>system\n{SYSTEM_PROMPT}<|im_end|>\n"
f"<|im_start|>user\n{user_prompt}<|im_end|>\n"
"<|im_start|>assistant\n"
)
inputs = tokenizer(text, return_tensors="pt", add_special_tokens=False).to(model.device)
streamer = TextStreamer(tokenizer, skip_prompt=True)
_ = model.generate(
**inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1,
use_cache=True,
streamer=streamer,
)
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
from threading import Thread
MODEL_ID = "CMLM/Dao1-30b-a3b"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype=torch.float16,
trust_remote_code=True,
device_map="auto",
attn_implementation="eager",
)
SYSTEM_PROMPT = (
"You are Tao (小道), a professional TCM knowledge assistant developed by IMPF-AI."
)
def build_prompt(history: list[dict], user_input: str) -> str:
text = f"<|im_start|>system\n{SYSTEM_PROMPT}<|im_end|>\n"
for turn in history:
text += f"<|im_start|>{turn['role']}\n{turn['content']}<|im_end|>\n"
text += f"<|im_start|>user\n{user_input}<|im_end|>\n<|im_start|>assistant\n"
return text
def chat(history: list[dict], user_input: str) -> str:
prompt = build_prompt(history, user_input)
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
thread = Thread(target=model.generate, kwargs=dict(
**inputs, max_new_tokens=512, do_sample=True,
temperature=0.7, top_p=0.9, repetition_penalty=1.1,
use_cache=True, streamer=streamer,
))
thread.start()
response = ""
for token in streamer:
print(token, end="", flush=True)
response += token
thread.join()
print()
return response
history = []
while True:
user_input = input("User: ").strip()
if not user_input or user_input in ("exit", "quit"):
break
reply = chat(history, user_input)
history.append({"role": "user", "content": user_input})
history.append({"role": "assistant", "content": reply})
| Parameter | Recommended | Notes |
|---|---|---|
temperature | 0.6 – 0.8 | Use ~0.7 for TCM Q&A |
top_p | 0.85 – 0.95 | Nucleus sampling, recommend 0.9 |
max_new_tokens | 256 – 8192 | Adjust by task complexity |
do_sample | True | Enable for natural output |
repetition_penalty | 1.05 – 1.15 | Recommend 1.1 to reduce repetition |
Well-suited for:
Limitations:
⚠️ Important Notice
This model and all its derivatives:
By using this model, you confirm that you have read, understood, and agreed to the above terms.
If you use this model in your research, please cite:
@misc{dao1-30b-a3b-2025,
title = {Dao1: Achieving Expert-Level Traditional Chinese Medicine Reasoning},
author = {Yanlan Kang and Xin Li and Yue Chen and Yide Fang},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/CMLM/Dao1-30b-a3b}},
note = {Institute of Medical Philosophy \& Future AI (IMPF-AI).
Non-Thinking mode SFT on large-scale classical TCM corpora,
based on Qwen3-30B-A3B.}
}
医哲未来人工智能研究院 · IMPF-AI
Institute of Medical Philosophy & Future AI
https://impfai.github.io
以道御术,智汇岐黄,承古开新,济世惠民
© 2025 IMPF-AI. All rights reserved. Non-commercial research use only.
</div>