Lingdan-4B-Base

Lingdan-V2 logo

Lingdan-V2: Large Language Models for Clinically Grounded Reasoning in Traditional Chinese Medicine

Open the Lingdan-V2 online demo

Hugging Face models ModelScope models LingLan benchmark Model scales: 4B, 8B, and 14B Apache License 2.0

Model · Quickstart · vLLM · Citation

Model Details

Lingdan-4B-Base is a Qwen3-based TCM model in the Lingdan-V2 family.

Field Value
Parameter scale 4B
Architecture family Qwen3 causal language model
Training stage Continued pretraining (CPT)
Starting checkpoint / backbone Qwen3 4B backbone
Intended use Text completion, domain research, and further fine-tuning
Platform model ID TCMLLM/Lingdan-4B-Base

Training History

This checkpoint includes the following training stages, in order:

Stage Objective Training data
CPT — continued pretraining TCM-domain knowledge acquisition 16.62B tokens

Quickstart

Use Transformers ≥4.51.0; see the Qwen3 quickstart.

pip install -U torch transformers accelerate
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "TCMLLM/Lingdan-4B-Base"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto",
).eval()

# Base checkpoints are intended for completion and further fine-tuning.
text = "中医辨证论治的基本概念是"
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(
    **inputs,
    max_new_tokens=1024,
    do_sample=True,
    temperature=0.6,
    top_p=0.95,
    top_k=20,
)
new_tokens = outputs[0, inputs.input_ids.shape[1]:]
print(tokenizer.decode(new_tokens, skip_special_tokens=True))

vLLM Deployment

Install vLLM in a GPU environment with compatible CUDA/PyTorch; see the Qwen3 vLLM guide.

pip install -U "vllm>=0.9.0" openai

Start the Server

Hugging Face:

export VLLM_USE_MODELSCOPE=false
vllm serve TCMLLM/Lingdan-4B-Base \
  --served-model-name Lingdan-4B-Base \
  --host 127.0.0.1 \
  --port 8000 \
  --max-model-len 16384

Replace the repository ID with a local model directory to reuse downloaded files. For two GPUs, append --tensor-parallel-size 2. Adjust the 16,384-token context limit (input + output) to available GPU memory.

Completion Client

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="EMPTY")
response = client.completions.create(
    model="Lingdan-4B-Base",
    prompt="中医辨证论治的基本特点是",
    max_tokens=512,
    temperature=0.6,
    top_p=0.95,
    extra_body={"top_k": 20},
)
print(response.choices[0].text)

EMPTY is a placeholder for the local server started without API-key authentication.

Data Privacy and Responsible Use

Lingdan-V2 is for research and does not replace qualified clinical judgment. Private clinical data are not released. Retrospective prescription agreement is not evidence of clinical safety or effectiveness; use de-identified inputs and professional review for any clinical application.

License

Lingdan-V2 model weights and project-owned documentation and images are released under the Apache License 2.0. See NOTICE for attribution notices. Third-party data and materials remain subject to their original terms.

Citation

Cite Lingdan-V2 and the earlier Lingdan work:

@misc{hua2026lingdanv2,
  title  = {{Lingdan-V2}: Large language models for clinically grounded reasoning in traditional Chinese medicine},
  author = {Hua, Rui and Wei, Yu and Jin, Ziri and Sun, Zhuo and Chang, Kai and Xia, Jianan and Shu, Zixin and Li, Xiaodong and Jia, Dongmei and Dong, Fei and Zhang, Runshun and Yu, Jian and Xu, Hao and Yu, Haibin and Li, Jiansheng and Liu, Baoyan and Wang, Wenjia and Zhou, Xuezhong},
  year   = {2026},
  url    = {https://github.com/TCMAI-BJTU/Lingdan-V2}
}

@article{hua2024lingdan,
  title={Lingdan: enhancing encoding of traditional Chinese medicine knowledge for clinical reasoning tasks with large language models},
  author={Hua, Rui and Dong, Xin and Wei, Yu and Shu, Zixin and Yang, Pengcheng and Hu, Yunhui and Zhou, Shuiping and Sun, He and Yan, Kaijing and Yan, Xijun and others},
  journal={Journal of the American Medical Informatics Association},
  volume={31},
  number={9},
  pages={2019--2029},
  year={2024},
  publisher={Oxford University Press}
}

Related Links

GitHub · Hugging Face collection · ModelScope collection · LingLan benchmark

For task prompts and thinking-mode chat, see the SFT/R1 guide.

Downloads last month
29
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for TCMLLM/Lingdan-4B-Base

Finetunes
1 model
Quantizations
1 model

Collection including TCMLLM/Lingdan-4B-Base