Daoism-Qwen3.5-9B
全球首個開源道教專業大語言模型 · 由台灣
鼎稔道學館 釋出於 2026-05-16。
This is a domain-adapted language model fine-tuned for Daoist (Taoist) knowledge , designed to be used as research infrastructure for digital humanities, religion studies, and Chinese cultural AI applications. We release the complete open-source stack — model + dataset + RAG API — so anyone can audit, deploy, fine-tune, or build upon this work.
🏛️ 關於釋出者 · About the Releaser
劉厝派鼎新門不是 AI 開發公司,而是一間道教教育機構。
我們的本業是道教知識的整理、傳承與教學——由台灣正一道道長創辦,長期累積經典考據、科儀紀錄、派別傳承等實務內容。
這次釋出 Daoism-Qwen3.5-9B,不是要做 AI 產品,而是把我們累積多年的道教知識資產,以最完整的形式交給有能力的開發者與研究者 ——模型權重、訓練資料、檢索 API 三件完整,Apache 2.0 開源、商用可、修改可、再發佈可。
「我們是道教教育機構,不是 AI 開發人員。
但我們把最完整的能力與資料,交給開發人員。」
"Liu Cuo School Dingxin Lineage is not an AI startup—it is a Daoist educational institution. We are not AI developers. But we hand the most complete capability and data to those who are."
這條路線比自己做封閉聊天 demo 困難,但更誠實、更尊重道教文化的開放精神。把刀交到開發者手中——讓道教 AI 真正成為社群共有的基礎設施,而非單一機構的壟斷。
🎁 完整開源三件套
License : Apache 2.0(商用可)
Why this model?
Mainstream LLMs (ChatGPT, Claude, Gemini) consistently fail on Daoist queries:
混淆道佛、儒道
編造科儀流程(補運、補財庫、安太歲)
不分正一 / 全真 / 閭山等派別差異
不知台灣民間信仰系統(城隍、王爺、媽祖)
無法判讀奇門遁甲 / 紫微斗數命盤
Daoism-Qwen3.5-9B 以鼎稔道學館 57.3 萬條道教專業語料 QLoRA 微調自
Qwen/Qwen3.5-9B,針對性填補此空缺。
🚀 Quick Start
1. Transformers (Python, fp16)
1 from transformers import AutoModelForCausalLM , AutoTokenizer
2 import torch
3
4 model_id = "lius-cc/Daoism-Qwen3.5-9B"
5 tokenizer = AutoTokenizer . from_pretrained ( model_id )
6 model = AutoModelForCausalLM . from_pretrained (
7 model_id ,
8 torch_dtype = torch . bfloat16 ,
9 device_map = "auto" ,
10 )
11
12 messages = [
13 { "role" : "system" , "content" : "你是道教智慧 AI,使用台灣繁體中文回答。" } ,
14 { "role" : "user" , "content" : "請說明正一道齋醮科儀中『金籙』『黃籙』『玉籙』三大齋的差異。" } ,
15 ]
16 text = tokenizer . apply_chat_template ( messages , tokenize = False , add_generation_prompt = True )
17 inputs = tokenizer ( text , return_tensors = "pt" ) . to ( model . device )
18 outputs = model . generate ( ** inputs , max_new_tokens = 1024 , temperature = 0.6 , top_p = 0.9 )
19 print ( tokenizer . decode ( outputs [ 0 ] [ inputs . input_ids . shape [ 1 ] : ] , skip_special_tokens = True ) )
2. Ollama (GGUF, 一行)
1 ollama pull hf.co/lius-cc/Daoism-Qwen3.5-9B-GGUF:Q4_K_M
2 ollama run hf.co/lius-cc/Daoism-Qwen3.5-9B-GGUF:Q4_K_M
3. LM Studio (no-code, GUI)
Install LM Studio
搜尋 lius-cc/Daoism-Qwen3.5-9B-GGUF
下載 Q4_K_M (5.3 GB) 或 Q5_K_M (6.1 GB)
載入 → 直接對話
4. llama.cpp (CLI)
./llama-cli -hf lius-cc/Daoism-Qwen3.5-9B-GGUF -p "你是道教智慧 AI..." -n 1024
5. vLLM (production serving, OpenAI 相容 API)
1 pip install vllm
2 vllm serve lius-cc/Daoism-Qwen3.5-9B \
3 --dtype bfloat16 \
4 --max-model-len 4096 \
5 --gpu-memory-utilization 0.85 \
6 --port 8000
⚠️ vLLM 0.21+ 才支援 Qwen3.5 config。
6. llama-cpp-python (推薦給 single-GPU 用戶)
1 CMAKE_ARGS = "-DGGML_CUDA=on" pip install llama-cpp-python [ server ]
2
3 python -m llama_cpp.server \
4 --model daoism-qwen3-5-9b.Q4_K_M.gguf \
5 --n_gpu_layers -1 \
6 --n_ctx 4096 \
7 --host 0.0 .0.0 --port 8000
🔍 RAG (推薦用法)
Daoism-Qwen3.5-9B 設計為與 RAG 配合使用以獲得最佳深度。 9B 規模在純 model 推理時有知識天花板,請務必搭配本 dataset 或 RAG API。
Option A: 用我們的公開 RAG API(最快)
1 import requests
2 from openai import OpenAI
3
4 client = OpenAI ( api_key = "dummy" , base_url = "http://localhost:8000/v1" )
5
6 def ask ( question ) :
7 # 1. Retrieve from lius.cc
8 r = requests . post (
9 "https://lius.cc/api/llm-rag" ,
10 json = { "q" : question , "n" : 5 } ,
11 timeout = 10 ,
12 )
13 hits = r . json ( ) . get ( "hits" , [ ] )
14 context = "\n\n---\n\n" . join (
15 f"### { h [ 'name' ] } \n { h [ 'summary' ] } \n\n { h [ 'content' ] [ : 1500] } \n來源: { h [ 'url' ] } "
16 for h in hits
17 )
18
19 # 2. Generate
20 response = client . chat . completions . create (
21 model = "Daoism-Qwen3.5-9B" ,
22 messages = [
23 { "role" : "system" , "content" : f"你是道教 AI。請以下列館藏資料為基礎深度回答(引用時附 URL):\n\n { context } " } ,
24 { "role" : "user" , "content" : question } ,
25 ] ,
26 max_tokens = 4096 ,
27 temperature = 0.6 ,
28 )
29 return response . choices [ 0 ] . message . content
30
31 print ( ask ( "城隍信仰與道教有什麼關係?" ) )
Option B: 離線自架 RAG(用我們的 dataset)
1 from datasets import load_dataset
2 from sentence_transformers import SentenceTransformer
3 import faiss
4 import numpy as np
5
6 # Load 95,919 entries
7 ds = load_dataset ( "lius-cc/daoism-knowledge-rag" , split = "train" )
8
9 # Embed
10 encoder = SentenceTransformer ( "BAAI/bge-m3" )
11 embeds = encoder . encode (
12 [ f" { x [ 'name' ] } : { x [ 'summary' ] } " for x in ds ] ,
13 batch_size = 64 ,
14 show_progress_bar = True ,
15 normalize_embeddings = True ,
16 )
17
18 # Index
19 index = faiss . IndexFlatIP ( embeds . shape [ 1 ] )
20 index . add ( embeds . astype ( np . float32 ) )
21
22 def retrieve ( query , k = 5 ) :
23 q_emb = encoder . encode ( [ query ] , normalize_embeddings = True )
24 _ , ids = index . search ( q_emb . astype ( np . float32 ) , k )
25 return [ ds [ int ( i ) ] for i in ids [ 0 ] ]
🔧 Fine-tuning (LoRA)
如果你想用自己資料繼續微調,建議走 QLoRA (與本 model 原訓練同方法):
pip install axolotl unsloth
1 # axolotl-config.yml
2 base_model : lius - cc/Daoism - Qwen3.5 - 9B
3 load_in_4bit : true
4 adapter : qlora
5 lora_r : 64
6 lora_alpha : 128
7 sequence_len : 2048
8 sample_packing : true
9 micro_batch_size : 2
10 gradient_accumulation_steps : 16
11 num_epochs : 3
12 optimizer : paged_adamw_8bit
13 learning_rate : 2.0e-4
14 bf16 : true
15 flash_attention : true
16 gradient_checkpointing : true
17 datasets :
18 - path : your - dataset - path
19 type : alpaca
accelerate launch -m axolotl.cli.train axolotl-config.yml
建議硬體:A100 40GB+ 或 RTX 4090 24GB。
📊 Training Details
項目 內容 Base model Qwen/Qwen3.5-9B Fine-tuning method QLoRA 4-bit (r=64, α=128, dropout=0.05) Training data 鼎稔道學館館藏 573k alpaca samples Epochs 3 (33,993 steps) Hardware 1× A100 80GB SXM4 Training time ~47 hours Final loss 1.04-1.07 (stable convergence) Compute provider vast.ai (community spot GPU)
📐 Specifications
Architecture Qwen3_5ForCausalLM Parameters 9B Context length 262,144 (training); recommended 4,096 for QLoRA inference Vocab size 256,000 Languages Traditional Chinese (Taiwan) primary; Simplified Chinese / English secondary Tokenizer GPT-2 style BPE (Qwen) Supports tool calling, thinking mode (<think>)
⚠️ Limitations & Responsible Use
9B 規模有知識天花板 :複雜學術問題建議搭配 RAG(見上方範例)
量化版 (Q4_K_M)犧牲約 5-10% 精度換 4× 速度,深度查詢請用 Q5_K_M 或 fp16
語言偏向 :Traditional Chinese (Taiwan) > Simplified Chinese > English
派別覆蓋 :正一道 / 閭山派 / 台灣民間信仰較完整;全真道 / 全真內丹較淺
不可取代真道長 :涉及法事、運勢判斷、個人重大決策請洽合格道士
學術引用 :引用文獻時請以 lius.cc 原條目為準,並交叉驗證
📜 Citation
1 @misc{daoism-qwen3-9b-2026,
2 author = {Liu, Chi-Ying and Dingren Daoxue Lab},
3 title = {Daoism-Qwen3.5-9B: An Open-Source Taoist Knowledge Language Model},
4 year = {2026},
5 month = {May},
6 publisher = {HuggingFace},
7 url = {https://huggingface.co/lius-cc/Daoism-Qwen3.5-9B},
8 note = {Apache 2.0 License; released with companion dataset and RAG API}
9 }
10
11 @dataset{daoism-rag-2026,
12 author = {Liu, Chi-Ying and Dingren Daoxue Lab},
13 title = {Daoism Knowledge RAG: Curated Taoist Knowledge Base for Retrieval-Augmented Generation},
14 year = {2026},
15 publisher = {HuggingFace},
16 url = {https://huggingface.co/datasets/lius-cc/daoism-knowledge-rag}
17 }
🙏 Acknowledgements
Base model: Alibaba Qwen team for Qwen3.5-9B (Apache 2.0)
Fine-tuning framework: Unsloth
GPU sponsorship: vast.ai community marketplace
Inspiration: All open-source efforts to digitize and preserve Daoist cultural heritage
🌐 Contact / Issues
Web: lius.cc · lius.cc/llm
Issues & discussions: HF Discussions
Email: chiyingliu@gmail.com
Maintained by: 劉啟穎 (Liu Chi-Ying), Dingren Daoxue Lab founder
「真正的開源精神,是把完整的能力交到開發者手中。」