laya-integration skill
A skill that adds the local Laya model to a project: it classifies text and returns probabilities with no LLM call.
- 195 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The skill leads the agent to install the `laya` package, which pulls torch and downloads model weights.
- `SKILL.md` is downloaded from the author's site through `curl`.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/laya-integrationDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The skill leads the agent to install the `laya` package, which pulls torch and downloads model weights.
- `SKILL.md` is downloaded from the author's site through `curl`.
This is third-party code. Review the repository files before installing.
What it does
Laya answers typed questions about text: the input is a state, meaning the text itself, and a set of questions, and the output is a probability for every option in one forward pass. The 322 to 421 million parameter model generates nothing, runs inside your process, answers in about 20 to 35 ms on a laptop GPU and sends no data out. The `laya-integration` skill explains to the agent how to wire in `pip install laya`, how to build questions, where the model goes wrong and how to choose a checkpoint: English, multilingual or `typed-decisions`. It covers three question types, `choice`, `score` and `noul`, thresholds, calibration and a cascade pattern: a cheap Laya pass before an LLM. The repository also holds a demo site with games and a reproducible benchmark.
Who it is for. Developers who need to decide fast and locally where to route a request, whether an email is spam or when an agent should stop.
Good fit when
- Support emails must be routed to department queues by urgency with no LLM call.
- An agent needs a fast guard: should it stop and call a person.
- Text moderation is added with calibrated probabilities rather than a bare yes or no.
- An expensive LLM follows a cheap first Laya pass that filters out easy cases.
Not a fit when
- You need multi-step reasoning, arithmetic or text generation.
- You need to extract free-form values from text.
- The machine has no Python and no room for 2.3 GB of weights.
Example request
Add Laya to my support service: emails must be split by department and urgency and flagged when the customer threatens to cancel.Limitations
Loading takes 25 to 35 seconds, so load the model once at startup while a call takes milliseconds. The multilingual checkpoint ships uncalibrated and readily reports 100 and 0 percent, which is not certainty. A state is cut from the end: the English checkpoint reads 512 tokens, the others 1024. The public demo has no model behind it and replays recordings; a live run needs a clone of the repository. In the benchmark the hosted Jev is more accurate out of the box.
How to disable. Delete `.claude/skills/laya-integration/SKILL.md` and the package with `pip uninstall laya`. Downloaded weights sit in the Hugging Face cache and are removed separately.
FAQ
How do I install the skill?
Use the README command: create `.claude/skills/laya-integration` and download `SKILL.md` from brainfunctioncollapse.com with `curl`. Claude Code reads that directory itself.
Which three question types does Laya support?
`choice` picks an option with probabilities, `score` rates a level on an ordered scale and `noul` returns the probability of a statement.
Which checkpoint should I use?
English for English text, `multilingual` for other languages and `typed-decisions` only for tasks similar to its training.
How do I run the demo locally?
Clone the repository and run `uv venv --python 3.12 && uv pip install laya` and `.venv/bin/python server.py`. The first start downloads 2.3 GB of weights.
How should I write questions?
Ask about what the text says, not about the action. Put numbers into words and describe every answer option.
Discussion
No questions or reviews yet.
Related
SkillsThe CLI scaffolds language-model training projects with tokenization, data preparation, checkpoints and evaluation.
Twelve standalone skills for development: an agent loop with planning and review, pull request handling, TDD and email triage.
Lattice: composable skills for AI assistants covering requirements, design before code, standards-based work and review
Yandex AI Studio skill for Laravel
yandex-ai-laravel skill
A Claude Code skill for the yandex-ai-laravel SDK: Responses API, Vision OCR across 12 models, embeddings and known differences from OpenAI
Skills and a CLI with a product graph: roles, states and failures checked before code, the live product after the build
Methods for an agent in one CLI: comparing options, solving problems and changing code in steps, 20 slash commands in all.
README in short
The repository combines a site, three games, a benchmark and this skill. Another author created the Laya model: the repository installs its package and keeps the skill in a separate `skills/laya-integration/SKILL.md` file.
README badge
Original SKILL.md
---
name: laya-integration
description: Add fast, local, typed decisions to any project with Laya, an open-source non-generative decision model (pip install laya). It classifies, routes, scores and answers yes/no questions about a piece of text, returning calibrated probabilities in roughly 20-35 ms on a laptop GPU, with no LLM call and no data leaving the machine. Use this skill whenever the user wants to classify or route text, triage tickets or emails, detect spam, phishing, toxicity or intent, put a guardrail in front of an agent or LLM, score something against a rubric, or replace an LLM-based classifier to cut latency or cost. Also use it when they mention Laya, Jev, a "System 1 model", "typed decisions" or a "decision model", even if they never name Laya.
metadata:
author: brain function collapse
source: https://brainfunctioncollapse.com/laya
version: "1.1"
---
# Integrating Laya
Laya answers typed questions about a piece of text. You give it a `state` (the text) and a dict
of questions; it returns a probability for every option of every question in one forward pass.
It never generates text, so it cannot answer off-schema, and it is small enough (322M-421M
parameters) to run inside the user's own process.
Reach for it when the project needs a **decision**, not a sentence: which queue, is this spam,
how urgent, should the agent stop. Do not reach for it when the task needs reasoning over
several steps, arithmetic, extraction of free-form values, or any generated text. For those,
keep the LLM and use Laya in front of it as a cheap first pass (see "Cascade" below).
## Install and first call
```bash
pip install laya # pulls torch, transformers, safetensors, huggingface_hub
```
```python
import laya
agent = laya.load("convaiinnovations/laya") # English checkpoint
result = agent.predict(
{"subject": "Charged twice", "body": "Refund the duplicate today or we cancel."},
{
"department": {
"type": "choice",
"instructions": "Which department should handle this request?",
"criteria": {
"billing": "invoices, payments, refunds",
"technical": "bugs, outages, system errors",
"other": "everything else",
},
},
"urgency": {