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

laya-finetuning

mohanvarmaa22

Fine-tunes Laya as a prompt-safety classifier and reports evaluation results

0·GitHub repo

laya-telegram-mod

Romay777

A self-hosted Telegram bot uses Laya or Jev to classify messages for group moderation

0·GitHub repo

canvastty-plugin-assistant

BIackFIame

Adds a CanvasTTY assistant for command review, task triage, and orchestration advice

0·GitHub repo
G

laya-demo

gen24AI

Demonstrates Laya decision workflows for routing, triage, guardrails, RAG filtering, and moderation

0·HF Space
S

laya-demo

Slothwolf

Demonstrates typed decisions, multilingual routing, triage, guardrails, RAG filtering, and moderation with Laya

0·HF Space

laya-classifier

gabe-santana

Screens emails for phishing using Laya, code-based signals, and policy rules

0·GitHub repo

laya-scam-detector

chaceli

Fine-tunes and serves Laya as an ONNX scam-phrase detector with a FastAPI playground

0·GitHub repo

laya-claude-code

anshc022

A Claude Code plugin runs Laya locally for prompt checks, task hints, and typed decisions

0·GitHub repo

testing_arena_jev_vs_laya

Shadowsweep

Compares Jev and Laya in an automated security attack-detection and defense system

0·GitHub repo

ai-sec-lab

shsingh

A Mac-based Kubernetes lab demonstrates prompt-security defenses using Laya and NOVA

0·GitHub repo

layalog

gugaucb

Analyzes streamed logs with Laya decisions to classify severity and suggest mitigations

0·GitHub repo
U

laya-demo

uulonger

Demonstrates typed Laya decisions for triage, moderation, guardrails, RAG filtering, and routing

0·HF Space
L

laya-scam-detector

LiChace

Detects Chinese and English scam messages with a fine-tuned Laya model in the browser

0·HF Space

gmr_golpe_pix

GumerJr

Fine-tunes Laya to detect Pix payment scams and evaluates local CPU inference

0·GitHub repo

laya-guard

PS061188

Evaluates and fine-tunes Laya as a safety guard for commands issued to a coding agent

0·GitHub repo

laya-warden

Gjusev

Combines Laya decisions and deterministic rules to supervise agent tool calls

0·GitHub repo

laya-pii-scanner

martijnvanderkamp

Scans Dutch and English text for personal data using patterns and Laya

0·GitHub repo

laya-prompt-injection-model

sangam14

Notebook that fine-tunes Laya for prompt-injection detection on Apple Silicon

0·GitHub repo

linkedin-bullshit-o-meter

PhunkyBob

A browser extension that classifies LinkedIn posts using Jev or a local Laya server

0·GitHub repo

GLaDOS

bearcut

Routes LLM requests using Laya-based security, intent, and complexity decisions

0·GitHub repo

laya-hate-speech-benchmark

jasontiw

A reproducible benchmark compares Laya hate-speech detection with other classifiers

0·GitHub repo
H

laya-demo

huggyf

Demonstrates Laya's typed decisions and calibrated probabilities across common workflows

0·HF Space
V

laya-moderation-demo

Vinay57

Scores text for toxicity using a fine-tuned Laya model and exposes moderation endpoints

0·HF Space

laya-test

devikaxminds

Tests Laya decision checkpoints on routing, review scoring, and content moderation tasks

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