鼎稔道學館
← 開源 LLM/API

LIUS LLM API

這是 LIUS 道教 AI 對外公開 contract:先取已發布館藏,再生成有 citation 的回答。核心端點支援 CORS、OPTIONSOpenAPI JSON

Contracts

EndpointMethod用途
/api/llm-ragGET / POST公開館藏檢索;回傳 hits、context_blocks、citation、answerability、retrieval_policy。
/api/llm-rag/answerGET / POST先 retrieve,再以固定模板輸出有 citation 的回答草稿;沒有來源就不輸出定論。
/api/llm/generatePOSTdemo 用生成端點;narrative / publishing / grant 會先走正式 RAG contract。
/api/llm/infrastructure-manifestGET五件套研究基礎設施 manifest,適合 AI agent、搜尋引擎與審查引用。
/api/llm/capabilities.jsonGET單一 machine-readable 能力入口;聚合 RAG、answer、generate、benchmark、runner、citation 與 official gate。
/api/llm/governance.jsonGET治理、審查、更正、release compatibility 與獨立性聲明。
/api/llm/evaluation-gate.jsonGETofficial leaderboard promotion 的 machine-readable gates;避免 draft 被誤判為 official。
/api/llm/daoeval-manifest.jsonGETDaoEval count policy、public artifacts、local integrity hashes 與離線驗證邊界。
/api/llm/rag-contract.jsonGETRAG retrieval policy、failure modes、answerability、citation status 與 feedback policy。
/api/llm/schemas.jsonGETRAG、answer、generate、benchmark、leaderboard、evaluation gate 的 JSON Schema collection。
/api/llm/provenance.jsonGETSource corpus、retrieval、evaluation、governance 四層 public lineage 與 self-host boundary。
/api/llm/citation-graph.jsonGETDaoEval 題目與 LIUS registry claims 對 source_refs / sourceAuthority 的公開圖譜。
/api/llm/changelog.jsonGETLLM contract、count policy、citation boundary 與 curated errata 的公開紀錄。
/api/llm/self-host.jsonGET不依賴 OpenAI OAuth 或付費 LIUS access 的 self-host / no-network quickstart。
/api/llm/openapi.jsonGETOpenAPI 3.1 contract;支援 CORS,供外部工具與前端匯入。
/api/llm/benchmark.jsonlGETDaoEval v0.1 公開題庫 JSONL;支援 suite、layer、limit query。
/api/llm/leaderboard.jsonGETDraft / official gate 分離的 leaderboard JSON;正式 verified runs 目前為 0。
/api/llm/runner-spec.jsonGET外部重跑規格:runner、grader、provider env names、score formula 與 secret policy。
/api/llm/whitepaper-risGETDaoEval RIS citation,供 Zotero、Mendeley 等文獻工具匯入。
/api/llm/whitepaper-csl-jsonGETDaoEval CSL JSON citation,供 citeproc 與學術 agent 直接解析。
/CITATION.cffGETCitation File Format;供 GitHub、Zenodo 與軟體引用工具辨識。
scripts/benchmark/score-lius-benchmark-offline.mjsCLIDeterministic offline baseline scorer;輸出 type=grade,可接 combine script,但不能升 official leaderboard。

Retrieve

curl -sS https://lius.cc/api/llm-rag \
  -H 'content-type: application/json' \
  -H 'X-Request-ID: demo-001' \
  -d '{"q":"城隍 職司","n":5,"types":["deity","concept"]}'

Answer

curl -sS https://lius.cc/api/llm-rag/answer \
  -H 'content-type: application/json' \
  -d '{"q":"三朝醮的流程重點是什麼?","n":4,"types":["ritual","scripture"]}'

Capabilities

curl -sS https://lius.cc/api/llm/capabilities.json

OpenAPI

curl -sS https://lius.cc/api/llm/openapi.json

Authority

curl -sS https://lius.cc/api/llm/provenance.json
curl -sS https://lius.cc/api/llm/changelog.json

Response Contract

X-Request-ID

每次請求的追蹤 id;可由 client 指定,也會在 response header 回傳。

hits

原始 top-N 已發布 LIUS 節點,含 url、type、score 與 citation。

context_blocks

可直接注入模型的引用文本,每段以 [1]、[2] 標號。

answerability

檢索結果是否足以回答;低信心時應保留疑問。

retrieval_policy

公開檢索策略與限制,目前 visibility 為 published_only。

公開 API 只檢索 published 非 paper 知識節點,並排除 junk;論文資料維持在論文書目索引,不作為 RAG 內文 corpus。RAG 排序不是學術定論。正式論文、法務、醫療、祭儀或個人重大決策仍需回到原始來源與合格專業者確認。
LIUS LLM API · RAG / Answer / Generate · 鼎稔道學館