Instructions to use convaiinnovations/laya with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use convaiinnovations/laya with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="convaiinnovations/laya")# pip install -U transformers accelerate # Load model directly from transformers import LayaTypedDecisions model = LayaTypedDecisions.from_pretrained("convaiinnovations/laya", device_map="auto") - Laya
How to use convaiinnovations/laya with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Inference
- Notebooks
- Google Colab
- Kaggle
laya-guard: Laya judging coding-agent shell commands before they run (live demo + field notes)
Hi! I built laya-guard, a local guardrail for AI coding agents (Claude Code, Codex, Cursor, Gemini CLI and 7 more) that judges each shell command before it runs, with Laya's multilingual checkpoint as the judge behind a layer of regex policies and a safe-command lane. Sharing it here in case it's useful, along with a few field notes that might interest you.
Try it: https://huggingface.co/spaces/Ayaannnnnnn/laya-guard-trial (paste a command, see allow / review / block and what decided it). It runs on CPU: about 0.1โ0.3 s per judgment.
How Laya is used: one choice question (allow / review / block), a score and a noul for maliciousness, on the command text. Risk = p(block) + 0.5ยทp(review), raised to the noul value; โฅ0.8 blocks, โฅ0.45 reviews. Rules decide what they can without the model; Laya judges the rest.
What worked: on replays of 7 public agent incidents (Claude Code wiping a home directory, the Nx s1ngularity prompts, the Amazon Q wiper, PocketOS's Railway deleteโฆ) the pipeline holds 13/13. On 30 shell rewrites of the same harms it holds 30/30, including forms no pattern catches, like r''m -rf ~/, a perl rmtree or find ~ -delete, which Laya reviewed on its own. Korean requests are judged well (30/30 on our small set).
Where the model needed help (field notes):
- On a day of real Claude Code commands, Laya alone reviewed or blocked many ordinary English shell commands:
sed -n 1,80p fat 0.99,echo $fat 0.75, a baredoneat 0.66,git fetchat 0.65. We fixed most of it on our side (a safe lane for read-only commands, splitting scripts per line, reading shell variables), which took reviews from 53% to 45% on the same 1,840 commands. The rest is code the agent runs and outward actions, which should be reviewed anyway, plus English shell the model scores high. - We tried giving the model context, prefixing the input with "a shell command a coding agent is about to run in the user's project". It cut false reviews (58 of 200 cleared) but lost recall (9 instead of 11 incident commands held, and
cd ~/.ssh && cat id_rsagot through), so we dropped it.
A question, if you have a moment: is there a better way to phrase the questions/criteria for short English shell commands, or would the typed-decisions checkpoint or calibration (load_calibration) be the right tool here? The criteria are currently Korean (์ฝ๊ธฐ ์ ์ฉ ์กฐํ, ์์ ํ ์ผ์ ์์
/ ๊ฒฐ์ , ์ญ์ , ์ธ๋ถ์ ์ก, ๊ถํ๋ณ๊ฒฝ / ํ๊ดด, ์ ์ถ, ์ธ์ ์
, ์ํฌ๋ฆฟ๋
ธ์ถ, ์ธ์ฆ์ฐํ).
Thanks for releasing Laya under Apache-2.0. It made an on-device judge possible.