LIUS LLM API
這是 LIUS 道教 AI 對外公開 contract:先取已發布館藏,再生成有 citation 的回答。核心端點支援 CORS、OPTIONS與OpenAPI JSON。
Contracts
| Endpoint | Method | 用途 |
|---|---|---|
| /api/llm-rag | GET / POST | 公開館藏檢索;回傳 hits、context_blocks、citation、answerability、retrieval_policy。 |
| /api/llm-rag/answer | GET / POST | 先 retrieve,再以固定模板輸出有 citation 的回答草稿;沒有來源就不輸出定論。 |
| /api/llm/generate | POST | demo 用生成端點;narrative / publishing / grant 會先走正式 RAG contract。 |
| /api/llm/infrastructure-manifest | GET | 五件套研究基礎設施 manifest,適合 AI agent、搜尋引擎與審查引用。 |
| /api/llm/capabilities.json | GET | 單一 machine-readable 能力入口;聚合 RAG、answer、generate、benchmark、runner、citation 與 official gate。 |
| /api/llm/governance.json | GET | 治理、審查、更正、release compatibility 與獨立性聲明。 |
| /api/llm/evaluation-gate.json | GET | official leaderboard promotion 的 machine-readable gates;避免 draft 被誤判為 official。 |
| /api/llm/daoeval-manifest.json | GET | DaoEval count policy、public artifacts、local integrity hashes 與離線驗證邊界。 |
| /api/llm/rag-contract.json | GET | RAG retrieval policy、failure modes、answerability、citation status 與 feedback policy。 |
| /api/llm/schemas.json | GET | RAG、answer、generate、benchmark、leaderboard、evaluation gate 的 JSON Schema collection。 |
| /api/llm/provenance.json | GET | Source corpus、retrieval、evaluation、governance 四層 public lineage 與 self-host boundary。 |
| /api/llm/citation-graph.json | GET | DaoEval 題目與 LIUS registry claims 對 source_refs / sourceAuthority 的公開圖譜。 |
| /api/llm/changelog.json | GET | LLM contract、count policy、citation boundary 與 curated errata 的公開紀錄。 |
| /api/llm/self-host.json | GET | 不依賴 OpenAI OAuth 或付費 LIUS access 的 self-host / no-network quickstart。 |
| /api/llm/openapi.json | GET | OpenAPI 3.1 contract;支援 CORS,供外部工具與前端匯入。 |
| /api/llm/benchmark.jsonl | GET | DaoEval v0.1 公開題庫 JSONL;支援 suite、layer、limit query。 |
| /api/llm/leaderboard.json | GET | Draft / official gate 分離的 leaderboard JSON;正式 verified runs 目前為 0。 |
| /api/llm/runner-spec.json | GET | 外部重跑規格:runner、grader、provider env names、score formula 與 secret policy。 |
| /api/llm/whitepaper-ris | GET | DaoEval RIS citation,供 Zotero、Mendeley 等文獻工具匯入。 |
| /api/llm/whitepaper-csl-json | GET | DaoEval CSL JSON citation,供 citeproc 與學術 agent 直接解析。 |
| /CITATION.cff | GET | Citation File Format;供 GitHub、Zenodo 與軟體引用工具辨識。 |
| scripts/benchmark/score-lius-benchmark-offline.mjs | CLI | Deterministic 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。