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

decide-gateway

thinx-pro

Routes typed decision requests to Jev, Laya, or language-model backends with confidence escalation and red-team testing

0·GitHub repo

unsloth-laya

smithysw7

A Python bridge calls the local Laya decision model through Unsloth Studio’s Decision API

0·GitHub repo

Laya-Phishing-Security-Auditor

DahoPao

Analyzes emails for phishing and returns structured security decisions using Laya

0·GitHub repo

Kirk-laya

Benjamacs1

Runs an ONNX fine-tune of Laya locally to classify Minecraft chat lines

0·GitHub repo

FaradayLayaBenchmark

kurtfi

Benchmarks local models for MCP and agent security with a fail-fast evaluation pipeline

0·GitHub repo

jev-pipeline-analysis

bogdancstrike

Enrich text locally with configurable GLiNER and Laya analysis engines

0·GitHub repo

bouncer

Faycall1l

Moderate live chat with programmable rules and typed decisions in a single model pass

0·GitHub repo

verdict

ashiksharonm

Fine-tunes Laya for multi-check LLM guardrails and evaluates it with open benchmarks

0·GitHub repo

triage-cascade

teddywinglee

Routes support tickets through a Laya classifier and escalates uncertain cases to a local LLM

0·GitHub repo
H

laya-multilingual-demo

hh616

Demonstrates multilingual typed decisions with the Laya model in a Gradio app

0·HF Space
L

layahost

Demo

Hosted Laya API, Jev-compatible, with Cloudflare Clef on the same endpoint

0·Demo

prompt-injection-laya

YuvrajVikramSingh-08

Fine-tunes Laya to detect prompt injection

0·GitHub repo

laya-mcp

Hypokoto

Runs the Laya ONNX decision model locally and exposes policy and code-analysis tools through MCP

0·GitHub repo

risk-detection-with-laya

aatifahmad123

Analyzes banking-call transcripts with Laya-based structured fraud-risk decisions

0·GitHub repo

RAG-Hallucination-Guard

karteeksai1

Uses Laya to assess RAG answer grounding and route responses to deliver, retry, or refuse

0·GitHub repo

laya-africa-evals

nakisisageorge

Evaluates Laya with African-language triage datasets and a prompt-injection robustness harness

0·GitHub repo

service-desk

boubakriibrahim

Assists field-service teams with sourced briefs, Laya safety screening, case scoring, and human approval

0·GitHub repo

laya-guard

chetas1208

Adds an advisory Laya classifier signal to deterministic guardrails for AI applications

0·GitHub repo
A

laya-guard-trial

Ayaannnnnnn

Lets users test Laya-based shell-command judgments for an agent safety hook

0·HF Space

laya-agent-guard

ankit-raj00

Classifies agent inputs as benign, prompt injection, jailbreak, or harmful using a fine-tuned Laya model

0·GitHub repo

Freelancer-Protection-Client-Scanner

MuhammadAsad29

Scans Upwork job posts with Laya to identify risks and display safety indicators

0·GitHub repo

laya-test

ALYREZA

Classifies SMS messages for spam, phishing, credentials requests, category, and risk using local Laya inference

0·GitHub repo

pi-laya-mlx

a3harva

Screens coding-agent tool calls with a fine-tuned Laya model running locally on Apple Silicon

0·GitHub repo

laya-phishing-detection

HarmonyFlow

Runs a local Laya-powered web app and API to score emails for phishing risk

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