正在自动登录…
← 返回项目列表NandhaKishorM/
NandhaKishorM/ laya
Laya 是一个多语言、非自回归的决策引擎,用于对文本进行类型化决策(如选择、评分、是非判断),支持100多种语言,通过路由器选择适当的检查点,适用于客服工单分类、意图识别等场景。
AI 中文解读 · 根据仓库描述与 README 生成 · 2026/10/11 15:26:35 · 查看原文
- 累计 Stars
- 32,210
- 当前热度
- 7~30 天 · 爆款
- 仓库创建时间
选用指南
AI 根据 README 整理 · 2026/10/11 15:26:35
- 使用方式
通过 Python 库或命令行使用,支持交互式模式、批量处理、自定义问题集。
查看 README 依据
Installing the package also installs a `laya` command for quick local testing, no script needed: ```bash laya "I was charged twice, please refund" # routing decision only; works offline, no download laya "Refactor this service" --predict # full answers (downloads the checkpoint on first use) laya "Mein Konto wurde zweimal belastet" --lang de # force a language instead of detecting it laya "My payment failed twice" --lang-guess en # a soft hint: nudge routing, still fall through to detection
laya "My payment failed twice" --model ml # pin a checkpoint: names, aliases and casing all resolve as the SDK resolves them laya "My payment failed twice" --preset triage # answer a ready-made preset (triage, email, guard, moderation, router) laya --batch tickets.txt --predict # score a file of requests, one per line, in one batch cat tickets.txt | laya --batch - --predict --json # stdin; one JSON line of answers per request laya "Where is my card" --questions intents.json # answer your own questions, written in a JSON file
- 部署要求
需要 Python 3.10 或更高版本,首次使用需从 Hugging Face 下载检查点。
查看 README 依据
Python 3.10 or newer. Optional extras: `laya[serve]` (HTTP server), `laya[mcp]` (MCP server), `laya[langchain]` (LangChain and LangGraph), `laya[llamaindex]` (LlamaIndex selectors), `laya[crewai]` (CrewAI routing), `laya[onnx]` (ONNX Runtime), `laya[fast]` (TileLang GPU fast path), `laya[structured]` (pydantic models in `decide`). Step-by-step setup for each platform, CPU-only or GPU PyTorch builds, and troubleshooting are in [Installation details](#installation-details).
If your application is a uv project, add Laya as a dependency instead: ```bash uv add laya uv run python -I -c "import laya; print(laya.__version__)" ``` `--torch-backend` applies to `uv pip` only; in a uv project, uv's PyTorch guide shows how to set the PyTorch index in `pyproject.toml`. **Model setup and troubleshooting** Continue with the [Router quickstart](#quickstart-route-mode-recommended) to run inference. Loading a Hub checkpoint requires access to Hugging Face on its first download; the quickstart's `Router(preload=True)` loads all three configured checkpoints at construction.
- 已知限制
长文档(超过约4000 tokens)准确性可能下降,需自行验证;默认检查点仅支持英文,多语言检查点需指定。
查看 README 依据
> In the table above, 16 to 18 of 20 requests were answered correctly with up to about 4,000 tokens of text before them; beyond that results vary (8 to 17 of 20), so check long-document accuracy on your own data. Short inputs give identical answers with `max_len=8192`, and speed follows the input's real length, not the limit: short inputs are unchanged, and a 4,000-token input takes about 1.7 s on an Apple GPU. Name the checkpoint with `model="multilingual"`, since long mostly-English text would otherwise route to the English checkpoint. ```python from laya import Router
README
正在加载 README…
收录信息
- 仓库创建时间
- 2026/9/18 12:46:33
- 首次达标收录
- 2026/10/9 11:44:24
- 统计更新时间
- 2026/10/11 15:45:35
按创建时长与累计 Stars 判断等级。首次达标收录后,即使未达当前门槛仍保留;累计 Stars 和仓库状态会定期更新。
模型评估
值得看加权总分 4.3 / 5
由 Jev 模型根据仓库描述与 README 评估,2026/10/10 13:53:10 生成。评分仅供参考,不是代码、安全或许可证审查;热度等级另按创建时长与累计 Stars 计算。
仓库信息
- 最近推送
- 2026/10/11 00:25:32
- 许可证标识
- Apache-2.0
- Fork 数
- 2,863
- 当前状态
- 未归档
收录记录
按创建时长与累计 Stars 首次收录:爆款
首次发现项目