PerryLink/dsh-laya

Plugin插件 Native原生 ⭐ 6 Apache-2.0 Dev Workflow开发与代码工作流Models & Routing模型与路由

Laya decision engine as a first-class Cordis service and model-visible tools for DeepSeek Harness.

Project Overview项目介绍

dsh-laya is a PerryLink-authored Cordis plugin built specifically for DeepSeek Harness: it surfaces the Laya typed-decision model (noul/choice/score) as a first-class ctx.laya service and as two model-visible tools, laya_ask and laya_plan. Because Laya is a PyTorch runtime and cannot live inside a Node plugin, this repo deliberately installs nothing and downloads nothing; instead it acts as a client of a separate process, which the user starts manually with pip install "laya-mcp[mcp]" followed by laya-mcp serve, by default on 127.0.0.1:8787. The plugin itself is then mounted with dsh plugin --profile <profile> add dsh-laya, and the operator is told to confirm the row is active rather than failed and to read the startup line, which states in plain terms whether state stays on this machine. The supported target is DSH only.

The intended user is a developer who wants host code, sibling plugins, or pre-model pipelines to obtain a judgment without paying a full LLM round-trip. They call ctx.get('laya') and use ask, plan, health, capabilities, sidecarUrl, and loopback; plan performs the same arithmetic as /ask but skips the forward pass, so it doubles as a precheck of token budget and state truncation before spending compute. Configuration lives under a YAML id: laya / name: dsh-laya block, with sidecarUrl, requestTimeoutMs, lifecycle (never, attach, spawn), spawnCommand, spawnTimeoutMs, and logLevel; never assumes something else manages the sidecar, attach runs a one-shot /health reachability check, and spawn launches the sidecar when nothing is listening.

Dependencies are laya-mcp[mcp] and a local PyTorch stack; the sidecar has been verified end-to-end on an RTX 5060 (load 9.8 s, 411 ms for three questions on CUDA). Limits are spelled out honestly: oversized states are silently truncated from the end and reported under truncated, with strict: true causing the sidecar to return HTTP 400 carrying state_truncated and a max_len hint; confidence is a probability-concentration statistic, not accuracy, so a noul also exposes a no/uncertain/yes band; and silent CPU fallback is exposed only through health.degraded plus a (degraded) suffix on the tool card. License is Apache-2.0; status is work in progress, version 0.1.4, not yet exercised through a live model turn in CI.

dsh-laya 是 PerryLink 为 DeepSeek Harness 编写的原生 Cordis 插件,把 Laya 的类型化决策能力(noul、choice、score)注册为 ctx.laya 服务以及 laya_ask、laya_plan 两个模型可见的工具。由于 Laya 基于 PyTorch 而无法嵌入 Node 插件,本仓库本身不安装模型,只作为本地 sidecar 客户端存在;用户需先 pip install "laya-mcp[mcp]" 并执行 laya-mcp serve(默认监听 127.0.0.1:8787),再通过 dsh plugin --profile <profile> add dsh-laya 装载,并在启动日志中确认状态为 active 而非 failed,并留意是否声明状态仅停留在本机。

典型用法面向需要把决策前置到 host 代码或其他插件的开发者:通过 ctx.get('laya') 调用 ask、plan、health、capabilities、sidecarUrl、loopback 等接口,plan 可在不消耗 forward pass 的前提下预估 token 预算;适合做路由评分、计划预选、候选裁剪等流水线。配置文件支持 lifecycle: never | attach | spawn 三个策略,分别对应由外部托管、加载时附加一次健康检查、以及在 sidecar 缺席时由插件执行 spawnCommand 拉起进程,全部遵循“插件自身绝不 pip install 也绝不下载 650 MB checkpoint”的原则。

依赖方面包含 laya-mcp[mcp] 与本机 PyTorch;README 强调 Laya 会从末尾截断超大 state,且 confidence 是概率集中度而非准确率,laya_plan 可在询问前发现截断,调用方可传 strict: true 让 sidecar 返回 HTTP 400 并附 state_truncated。当前版本 0.1.4 仍标注 work in progress,尚未在 CI 跑过 live model turn;CPU fallback 不会被 Laya 自身披露,需要看 health.degraded。许可为 Apache-2.0,本仓库与上游 Laya 项目相互独立,未获其认可或赞助。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 6 stars - very few users, little community feedback星标只有 6,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-laya

把 PerryLink/dsh-laya 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-laya

dshfind

Laya typed decisions — noul (yes/no), choice, score — as a first-class Cordis service and model-visible tools for DeepSeek Harness.

English · 简体中文 · Español · Português · हिन्दी

Status: 0.1.4, work in progress. The plugin mounts and activates in the Harness, and the sidecar contract it speaks is verified end-to-end on an RTX 5060 (load 9.8 s, 411 ms for three questions on CUDA). It has not yet been exercised through a live model turn in CI.


Install

Two pieces, because Laya is PyTorch and therefore cannot live inside a Node plugin.

1. The sidecar — this is what actually holds the model:

pip install "laya-mcp[mcp]"
laya-mcp serve                      # loads once, listens on 127.0.0.1:8787

2. This plugin:

dsh plugin --profile <profile> add dsh-laya

Then confirm the row is active, not failed, and read the startup line — it says in as many words whether state stays on this machine.

Why the sidecar is separate

A plugin that shelled out to pip install and then downloaded a 650 MB checkpoint behind your back would be hostile, however convenient. So this plugin installs nothing and downloads nothing. It is a client of a process you start, and when that process is not running it says so rather than failing obscurely at the first tool call.

The split also buys the warm model: Laya's cold build costs seconds to tens of seconds, and its default lazy router rebuilds a checkpoint on every language switch. laya-mcp serve pays that once.

What it contributes

One service, ctx.laya — so Host code and other plugins can ask for a judgment directly, without a model round-trip:

const laya = ctx.get('laya')
const result = await laya.ask({ state, questions })

It exposes ask, plan, health, capabilities, sidecarUrl, and loopback — the last being whether state stays on this machine, as a fact rather than a policy. plan is the preflight: the same arithmetic /ask reports, with no forward pass.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev awesome-dsh-bridges 下一个 Next dsh-codex-workflow →