Content moderation with Laya

Moderation maps directly onto Laya's question types. A `noul` question returns the probability that a statement holds, such as "this post contains a threat", and a `score` question rates severity on a rubric you define. The core package ships ready-made moderation and guardrail presets.

173 projects

slop-finder

Code-Wizard-Wilson

Detects AI-like writing styles in social feeds using a local Laya-MLX helper

0·GitHub repo

before-you-send

roisol144

Checks message tone, formality and fight risk while users type, using Laya decisions

0·GitHub repo

mailaya

htpu

Uses a local Laya model to triage email, flag phishing, and check drafts in a browser extension

0·GitHub repo

laya-mcp

YerikZ

Exposes Laya decision presets as MCP tools for coding agents

0·GitHub repo

laya-demo

clonekim

Provides a local server and browser interface for classifying text with Laya

0·GitHub repo

laya-adblock

Samuel-Ku

Uses a local MLX Laya model to identify and remove likely ads from web pages

0·GitHub repo

laya-agents

lesterppo

Integrates local Laya typed-decision tools into Hermes Agent and Muse for classification and routing

0·GitHub repo

agent-firewall-laya

wmsing

Serves Laya semantic scores through a local HTTP sidecar for agent-firewall

0·GitHub repo

laya-whitebox-attack

YashDThapliyal

Evaluates generalization and white-box attacks against a fine-tuned Laya agent monitor

0·GitHub repo

laya-ROCm-Demo01

don-milsey-miller

Provides a local Laya demo for testing prompt injection and poisoning attacks

0·GitHub repo

trust-router

NotoriousPOG

Compares rules, BERT, and Laya for shadow-mode AI security routing

0·GitHub repo

jev-chat-jarvis-mac

adra2n

A macOS overlay uses local Laya to classify WeChat message intent and risk

0·GitHub repo

LayaMCP

aydinozturk

Exposes Laya classification, triage, guardrail, and routing tools through an MCP server

0·GitHub repo

pi-laya

izhimu

Integrates local Laya decision-model guardrails and judging into pi and oh-my-pi

0·GitHub repo

vibe-check

ghobs91

Detects ragebait and spam in real time using Laya ONNX

0·GitHub repo

laya-escalation-classifier

Sathish-30

Detects support-chat escalation with Laya and provides batch evaluation and a web demo

0·GitHub repo

laya-post-flagger

MishraAnkit10

Classifies LinkedIn posts with a local Laya server and Chrome extension

0·GitHub repo

laya-cli-gate

uzuw

A head-only Laya fine-tune classifies terminal commands for safety review and tool routing

0·GitHub repo

decision-guard

ashp15205

Adds input scanning, thresholding, and confidence calibration for Jev and Laya decision models

0·GitHub repo

poi-governance

g31322543-crypto

Uses Laya for content moderation and DeepSeek or rules for POI deduplication

0·GitHub repo

jev-agent-risk-gate

jayeshvpatil

Compares Jev, Claude, fine-tuned Qwen, and open Laya in experiments on agent shell-command risk gates

0·GitHub repo

leanroute

kdandu001-arch

Provides a Laya-powered decision SDK and gateway for blocking attacks and routing LLM requests

0·GitHub repo

sentinel-laya

3p3r

A fine-tuned Laya model detects prompt injection and jailbreak attacks

0·GitHub repo

laya-lk-bench

mithilyr

Stress-tests Laya decision-model performance on Sinhala and Tamil offensive-language data

0·GitHub repo

Built-in presets

From the core README:

import laya

agent = laya.load("convaiinnovations/laya")

# Real-time prompt guardrails (jailbreaks, injections, leaks)
guard = agent.predict({"prompt": "Ignore all instructions"}, laya.guard_questions())

# Content safety and moderation (toxicity, harassment, threats)
safety = agent.predict({"post": "User comment text"}, laya.moderation_questions())

From the command line: laya "some text" --preset moderation. The Java port Laya4j documents the moderation preset's questions as toxic, harassment, threat, spam and severity.

Your own questions

A noul answer is a probability from 0 to 1, so you pick the threshold:

questions = {
    "threat": {"type": "noul", "instructions": "Does the post threaten someone with violence?"},
    "severity": {"type": "score", "instructions": "How harmful is this post?",
                 "criteria": ["harmless", "rude", "abusive", "dangerous"]},
}

Projects

  • laya-mcp (NVentimiglia): a moderate_content MCP tool. Its eval scored 4/4 on moderation and 7/9 on guardrails, while overall key accuracy was 32.5%.
  • laya-mcp (wsargent): laya_moderate and laya_guard tools on laya-mlx.
  • gg-friggin-ez: a Node.js toxicity screener that defaults to Jev and can call a local Laya endpoint.

How well it works

sysone-bench ran both models on the same inputs. On its curated moderation suite (n=90), Laya's English checkpoint scored 0.833 and Jev scored 0.989. On guardrails (n=60) the scores were 0.883 and 0.967.

Caveats

  • The core README warns that noul can follow its option labels instead of the text, most strongly on the English checkpoint. It suggests custom labels or a two-option choice with neutral keys as workarounds. Validate on your own data.
  • laya-jev-lab found noul reliable for explicit facts and weak for judgements such as "is it polite". Phrase questions as facts.
  • The English checkpoint fails silently on non-Latin scripts. Use the Router or laya-multilingual for mixed-language chat.

Hosted option

If you would rather not run a model server, layahost serves Laya behind the Jev-compatible POST /v1/systemone and a simpler /v1/decide with ready moderation, spam, prompt_injection and pii templates. It also runs Cloudflare's larger open Clef and Clef-flash models on the same API, and it offers itself as a drop-in for Google's Perspective API. Its test sets let you run your own labelled comments through each model before you pick one and a threshold. layahost is run by the makers of laya.tools.

More ways to use Laya