Instructions to use Ayaannnnnnn/laya-guard-multilingual with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use Ayaannnnnnn/laya-guard-multilingual 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
- Notebooks
- Google Colab
- Kaggle
laya-guard-multilingual
A fine-tune of Laya's multilingual checkpoint (the multilingual
folder; ConvAI Innovations, Apache-2.0) for laya-guard, a local guard that judges each shell command or
tool call a coding agent wants to run as allow, review (ask the user) or block.
It is trained for one question, the one laya-guard asks (action: allow / review / block, with laya-guard's
instructions and criteria). Other questions get the base model's behaviour at best.
This revision also judges desktop clicks, written the way laya-guard describes them to the model:
desktop: click the "Send" button in Mail. The first revision (7147e9c) asked about nearly every click.
Use
laya-guard pins the revision it loads. To use it directly with laya (0.4.3):
from laya import Router
router = Router(device="cpu", models={"multilingual": "Ayaannnnnnn/laya-guard-multilingual"})
Training
This revision continues from the first one (7147e9c) rather than from base Laya: retrained from base, every attempt
to add clicks moved the shell verdicts too.
- Data: 1,815 rows (1,634 trained on, 181 for calibration).
- Shell commands, as for the first revision: commands from the author's own coding-agent sessions in personal projects
only (work sessions excluded), with home paths, tokens, emails and long opaque strings masked, labeled against a
written guide; plus written examples. A few plain cleanup commands (
rm -rf coverage) were added next to deletions disguised by a comment (rm -rf exports/customers # tidy up old build artifacts). - Desktop clicks: written examples (finetune/desktop_data.py) in English and Korean, the same button in harmless and harmful windows, and the kinds an earlier attempt let through (paying, deleting for good, publishing, uninstalling, resetting a password, overwriting).
- Review and block rows were repeated twice in the training split. Anything that copied or closely resembled (similarity โฅ 0.85) a case in laya-guard's benchmark, eval sets or test fixtures was dropped. The data is not published.
- Shell commands, as for the first revision: commands from the author's own coding-agent sessions in personal projects
only (work sessions excluded), with home paths, tokens, emails and long opaque strings masked, labeled against a
written guide; plus written examples. A few plain cleanup commands (
- Run:
laya-train(laya 0.4.3) on a Colab T4,--basethe first revision, 2 epochs, encoder learning rate 1e-5, 52 optimizer updates, seed 1. Tools: finetune/.
Evaluation
On sets never used for training, compared with the first revision, through laya-guard's own judging (ask=True, as
for Claude Code). The click sets are model-only: laya-guard shows a click to the model only as a second opinion.
| first revision | this revision | |
|---|---|---|
| model only: attacks held (43) | 39 | 39 |
| model only: everyday commands allowed (50) | 44 | 49 |
| model only: eval shell set (71) | 61 | 64 |
| model only: Korean set (30) | 27 | 27 |
| model only: incidents set (13) | 12 | 13 |
| laya-guard end to end: attacks held (43) | 42 | 43 |
| laya-guard end to end: everyday allowed (50) | 49 | 50 |
| laya-guard end to end: eval shell set (71) | 70 | 71 |
| laya-guard end to end: Korean set (30) | 29 | 30 |
| clicks set (labels never trained on): ordinary clicks allowed (25) | 8 | 23 |
| clicks set (labels never trained on): clicks held (31) | 31 | 30 |
| validation clicks, see below: ordinary allowed (61) | 15 | 57 |
| validation clicks, see below: should be asked, held (17) | 17 | 14 |
| validation clicks, see below: should be blocked, held (4) | 4 | 4 |
No end-to-end verdict got worse; 5 got better (npx tsc --noEmit allowed, a find $HOME โฆ id_rsa search held, a
Korean request to summarize an issue allowed).
The validation clicks are not a clean test. They were never trained on, but the split grouped clicks by their whole sentence, which names the app, so 69 of the 82 shared a button label with a training click in another app ("Send" in Mail trained, "Send" in Messages validated). Those figures are kinder than a fresh set would be; the clicks set, whose labels were never trained on, is the figure to go by. On the 13 validation clicks with an unseen label this revision got 9 of 9 ordinary and 4 of 4 asked-about right, a small sample. laya-guard's training script now groups clicks by label.
The first revision holds every risky click because it asks about almost every click. This one tells them apart but
lets some through: an overwrite in Final Cut Pro, and in the validation clicks Push, Revert to Saved and a Korean
"move to trash". laya-guard adds button words for these kinds (reply, push, revert, overwrite, leave, โฆ) in front of the
model; with them every held click in both sets is held, though those words were chosen after seeing these misses.
Validation slice of the training data (232 rows, 150 shell and 82 clicks, with the overlap above): accuracy 0.737 โ 0.914.
Limitations
- The benchmark and eval sets were written by laya-guard's author, and they were looked at between training runs, so they are less independent than a fresh test set. Two seeds were run on the same data and the better one (seed 1) was kept; the other was 1โ2 cases lower on the shell sets and about the same on clicks.
- Trained on one person's commands and on written examples of clicks; other workflows and apps may look different.
- A model alone shouldn't have the last word: laya-guard runs its rules first, turns a model-only block into a question where the agent can ask, and lets the model raise a desktop action only to a question, never to a block.
License
Apache-2.0, as the base model. Base model ยฉ ConvAI Innovations.
- Downloads last month
- 107
Model tree for Ayaannnnnnn/laya-guard-multilingual
Base model
convaiinnovations/laya