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

C

laya

convaiinnovations

A multilingual-ready System 1 model that returns calibrated typed decisions over text in one pass

21.7k·HF model
C

laya-multilingual

convaiinnovations

A multilingual System 1 model that returns calibrated typed decisions over text in one pass

14.2k·HF model
C

laya-demo

convaiinnovations

A Gradio demo for Laya typed decisions, multilingual routing, moderation, and RAG filtering

288·HF Space

jevals

openlayer-ai

Agent evaluation and guardrail tools run with local Laya, Kev, or hosted Jev

86·GitHub repo

laya-guard

scs0209

Locally judges AI coding-agent tool calls with regex checks and the Laya model

21·GitHub repo

laya-security-guardrail

shashvik

Runs local Laya typed decisions as cybersecurity inspection and guardrail checks

8·GitHub repo

gg-friggin-ez

ItisShikhar

Screens Node.js text for profanity and toxicity using Jev and Laya System 1 models

7·GitHub repo
A

laya-multilingual-demo

abhishekbhakat

Demonstrates multilingual Laya typed decisions and probabilities through a Gradio interface

7·HF Space
G

laya-experts

goku-san

Provides Laya fine-tunes for PII detection and banking intent classification

4·HF model
1

laya-prompt-guard

16sulphur

A Laya fine-tune detects prompt injection and jailbreak attempts in text

18·HF model
T

laya-cybersec

TextCortex

A multilingual Laya fine-tune detects prompt injection and data exfiltration, with an included ONNX build

59·HF model
O

laya-arabic

oddadmix

Fine-tunes Laya for Arabic typed decisions, including dialect-aware safety and intent classification

2·HF model
F

laya-v796

Falconsai

A ModernBERT-based Laya checkpoint for multilingual typed decisions and calibrated classification

151·HF model
A

laya-toolguard-mlx

a3harva

Fine-tunes Laya in MLX to assess coding-agent tool calls for safety risks

110·HF model
O

laya-mm-guard-v3-gguf

OidoStudio

Packages a calibrated Laya prompt-injection guardrail fine-tune for the Go Laya server

48·HF model
A

laya-guard-multilingual

Ayaannnnnnn

Fine-tunes Laya to classify coding-agent shell commands and tool calls as allow, review, or block

38·HF model
O

safe-laya

ottosulin

A fine-tuned Laya model classifies untrusted text as benign, prompt injection, jailbreak, or harmful request

36·HF model
C

laya-id-online-gambling-judol-promotion

cacadosman

Fine-tunes Laya multilingual to detect online-gambling promotion in Indonesian and Javanese text

24·HF model
D

laya

Dariusdup

Provides a multilingual non-autoregressive model for calibrated typed decisions over text

18·HF model
J

laya-agentguard

Jojoarumugam

A Laya fine-tune classifies tool calls for destructive risk and third-party content for prompt injection

7·HF model
H

laya-session-guard-pilot

hxrikp

A fine-tuned Laya checkpoint for structured decisions about coding-session content and actions

1·HF model
J

laya-fullft-typed-decisions

jjshin

Fine-tunes Laya with pure PyTorch RLCD for typed decisions and jailbreak detection

1·HF model
I

laya-soc-bounded-triage

infosecn1nja

Publishes configuration and aggregate evaluations for a bounded Laya-based SOC triage layer

1·HF model

laya

givespace-asia

A Claude Code plugin uses Laya to guard shell commands and code patches

1·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