Run this model with HF Jobs

Run TCMLLM/Lingdan-4B-Base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/TCMLLM/Lingdan-4B-Base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/TCMLLM/Lingdan-4B-Base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/TCMLLM/Lingdan-4B-Base. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/TCMLLM/Lingdan-4B-Base. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

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

Lingdan-V2 paper on arXiv Hugging Face models ModelScope models LingLan benchmark Model scales: 4B, 8B, and 14B Apache License 2.0

Paper ยท 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

Please 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},
  eprint = {2610.14705},
  archivePrefix = {arXiv},
  primaryClass = {cs.CL},
  url    = {https://arxiv.org/abs/2610.14705}
}

@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

Paper ยท GitHub ยท Hugging Face collection ยท ModelScope collection ยท LingLan benchmark

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

Downloads last month
33
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

Paper for TCMLLM/Lingdan-4B-Base