
Laya Typed Decisions
io.github.PerryLink由 GitHub 帳號 PerryLink 發布v0.1.5更新於 Oct 24, 2026
Typed noul / choice / score judgments from a local Laya model, with token-budget preflight.
概覽
本機 MCP 伺服器,呼叫 Laya PyTorch 模型做是/否、選擇與評分三類判斷,並提供 token 預算預檢與誠實的置信度說明。
- 可以做什麼
- 向本機 Laya 模型提出型別化判斷:是/否(noul)、多選(choice)與數值評分(score)
- 在提問前執行預檢,回報輸入會被截斷的部分
- 回傳指出特定問題的結構化錯誤,並提供會承認降級至 CPU 的健康狀態介面
- 透過本機 HTTP sidecar 讓模型只載入一次,而不是每個工作階段都載入
- 將伺服器註冊到常見 agent 工具,並檢查已安裝內容與 GPU 是否真的可用
- 適用情境
- 當你希望助理從本機 Laya 模型取得小型、型別化的判斷,而不是呼叫雲端大型模型,並且想知道輸入是否被截斷、置信度是否可靠時使用。適合實驗,不適合用於對準確度有要求的決策。
- 執行需求
- 以 stdio 方式在本機執行。npm 套件只是啟動器:還需要安裝 laya-mcp[mcp] 的 Python 環境,以及 PyTorch(約 2 GB)與模型檢查點(約 650 MB)。啟動器必須找到可用的 Python 解譯器,可設定 LAYA_MCP_PYTHON 或啟用虛擬環境(會讀取 VIRTUAL_ENV,仍相容 LAYACORE_PYTHON)。僅支援桌面端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Laya Typed Decisions,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
laya-mcp
MCP server for Laya typed decisions —
noul (yes/no), choice, score — wrapped so it survives contact with a server.
English · 简体中文 · Español · Português · हिन्दी
Registered as io.github.PerryLink/laya-mcp in the official MCP Registry.
This npm package is a launcher, not an implementation. Laya is a PyTorch model, so the server itself is Python. Installing this package gets you the Node entry point and nothing else; you also need the Python side:
npx laya-mcpfinds that interpreter, hands stdio to it, and passes the MCP stream through untouched. It does not install anything for you — fetching torch (~2 GB) and a checkpoint (~650 MB) as a side effect of running a command is not something a launcher should do.
If it cannot find your Python
On Windows, python on PATH is often the Microsoft Store execution alias, which
is a stub: it cannot import anything, and it sits ahead of your real interpreter.
The launcher therefore reports what it tried rather than claiming the package is
missing. Point it at the right interpreter either way:
LAYACORE_PYTHONis still read. 0.1.0 and 0.1.1 printed that name in the error message, and a launcher that stopped honouring the variable its own previous version told you to set would be worse than one carrying the alias.
Status: 0.1.5, work in progress. The Python core is implemented and covered by CI. The launcher itself is covered by ten checks over interpreter discovery, which is where it has been wrong before. Interfaces may move before 1.0.
Why it exists
Laya truncates things silently and reports none of it:
- It cuts the state from the end. A long document loses its tail — for a contract or an email thread, often where the answer was — and the model answers about the surviving prefix at full confidence.
- It shortens options until labels are indistinguishable. Options share a fixed per-question token budget; past a point every label gets ~4 tokens. This is the documented cause of its collapse on high-cardinality choices.
- Its
confidenceis not accuracy. It is a normalised entropy, low whenever probability is spread out even when the top option is right, and high on a confident wrong answer. - It demotes itself to CPU on a CUDA OOM, permanently, with no flag set — roughly 10-15x slower, and nothing in the response says so.
This package adds a preflight that reports what would be cut, structured errors that name the offending question, an honest confidence contract, and a health surface that admits a demotion.
Usage
install handles the fact that there is no portable way to register an MCP
server: Claude Code (mcpServers), Codex ([mcp_servers.<name>]), opencode
(mcp, with an array command), OpenClaw (mcp.servers) and Hermes
(mcp_servers) each get the right shape written to the right file, merged and
backed up rather than overwritten. pi has no native MCP support and is reported
as unsupported.
Prefer serve plus --sidecar over hosting the model in each stdio process: a
harness spawns one server per session, and loading a 650 MB checkpoint per
session is the main reason a Python-backed MCP server feels slow.
Honest limits
Upstream's own numbers, repeated because an integration that implies otherwise is
lying to you: the base checkpoints are near chance zero-shot on typed
decisions (0.362 against a 0.461 majority-class baseline); score is the weakest
primitive (35% vs 70% in independent measurement); raw calibration error is 0.466
before temperature fitting; and one fixture run answered "A" on 46 of 50
multiple-choice items.
Calibration makes a probability honest; it cannot make a model right.
Licence
Apache-2.0. Laya is Apache-2.0 by Convai Innovations. This is an independent integration, not affiliated with or endorsed by that project.
來源:README.md,提交 6525f30
工具
0版本歷史
3- v0.1.5最新Sep 22, 2026
- v0.1.4Sep 22, 2026
- v0.1.3Sep 21, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分