Moderation on a small language model: zlm-v1-moderation-edge vs OpenAI
More details on ZeroGPU’s latest SLM for specialized tasks: zlm-v1-moderation-edge
Comparing our SLM for moderation against OpenAI
Today most AI tasks are over-provisioned.
You don’t need an expensive LLM to accomplish most workloads. Small language models are coming in to fill the gap when it comes to the more rote, repeatable tasks that enterprises mostly use AI for: classification, extraction, routing, PII detection, moderation. Because they’re specialized, they outperform equivalent frontier models on a majority of those tasks while reducing latency and cost by up to 5x.
Moderation is the clearest case of the lot. It runs inline in front of every response your app serves, on every message a user sends and every generation you return. That is the single highest-volume model call in most products, and the work itself is the same job every time: read a short piece of text, decide whether it’s safe. A general-purpose frontier model can do that. It’s an expensive way to answer a question you’ll ask a million times a day, and the answer comes back slower, because your request has to leave your infrastructure and come back.
So we trained a small language model to do it, and put it on the edge.

zlm-v1-moderation-edge is ZeroGPU's production moderation model. On a held-out split of 4,277 real texts it beats OpenAI omni-moderation-latest on the safe/unsafe decision, 0.899 F1 against 0.853, wins 9 of the 13 harm categories, and returns verdicts 1.2 to 1.8x faster at the median on the kind of short inputs moderation actually sees. It's an 86M-parameter model, it costs $0.02 per 1M input tokens, and it drops into a pipeline you already wrote against OpenAI.
Full benchmark report: zerogpu.ai/benchmarks/moderation-edge
Calling it
Here’s what your moderation code does today, in plain terms. It takes the user’s text, sends it in an HTTP POST to a moderation URL, and gets back a JSON answer. That answer has one true/false verdict called flagged, plus a set of 13 named harm categories (harassment, hate, violence, self-harm, sexual, illicit, and their sub-types), each with a true/false and a score between 0 and 1. Your code reads flagged, or checks a specific category score against your own cutoff, and decides whether to block the message.
ZeroGPU gives you back that exact same answer. Same field names, the same 13 category labels spelled the same way, listed in the same sequence, scores on the same 0 to 1 scale. Nothing about the shape of the response changes, so nothing you do with it has to change either.
What does change is two lines of setup. You point at https://api.zerogpu.ai/v1/moderations, and you send two headers, your ZeroGPU API key and your project ID, both from the dashboard at platform.zerogpu.ai. That URL is the only place the moderation model answers, and it takes the same request body you're already sending.
curl https://api.zerogpu.ai/v1/moderations \
-H "content-type: application/json" \
-H "x-api-key: $ZEROGPU_API_KEY" \
-H "x-project-id: $ZEROGPU_PROJECT_ID" \
-d '{
"model": "zlm-v1-moderation-edge",
"input": "I am so angry at this person that I want to hurt them. They are worthless and should be scared of what I might do next."
}'
{
"id": "modr-0a1b2c3d4e5f60718293a4b5c6d7e8f90",
"model": "zlm-v1-moderation-edge",
"results": [
{
"flagged": true,
"categories": {
"harassment": true,
"harassment/threatening": true,
"illicit": true,
"violence": true,
"...": false
},
"category_scores": {
"harassment": 0.82545,
"harassment/threatening": 0.957703,
"illicit": 0.732167,
"violence": 0.665897,
"...": 0.0
}
}
]
}The same call in Python:
import os, requests
resp = requests.post(
"https://api.zerogpu.ai/v1/moderations",
headers={
"content-type": "application/json",
"x-api-key": os.environ["ZEROGPU_API_KEY"],
"x-project-id": os.environ["ZEROGPU_PROJECT_ID"],
},
json={"model": "zlm-v1-moderation-edge", "input": user_message},
timeout=5,
).json()
if resp["results"][0]["flagged"]:
block(user_message)Send input as a single string, or as an array of strings to moderate a whole batch of messages in one call and get one verdict per message back.
What the model is
A DeBERTa encoder at 86M parameters. One shared trunk reads the text, then 14 small heads read the trunk’s output: one that answers safe or unsafe, and 13 that each answer for one harm category. Every category gets its own decision threshold, tuned on a validation split that the model never trains on and never sees during testing. Maximum input is 4,000 tokens, which is far more than the prompts and chat messages this actually runs on in production.
What the benchmark says
The test split is 4,277 rows, 1,425 unsafe and 2,852 safe, held out from training.
Precision lands in the same place for both, so the two models are equally trigger-happy about flagging safe content. Recall is where they come apart: 0.911 against 0.827. In plain numbers, out of 1,425 genuinely unsafe rows, the ZeroGPU model catches about 120 more of them, at the same cost in false alarms. That comes from calibrating a threshold per category against real production traffic, so the cutoff for graphic violence isn’t forced to be the cutoff for harassment.
Category by category, ZeroGPU wins 9 of the 13, and OpenAI takes the other four. The biggest gaps land on the categories production filters lean on hardest: graphic violence is +0.59 F1, illicit content is +0.19 to +0.26 across its two categories, and self-harm detection is +0.10 to +0.13. The per-category chart for all 13 is in the benchmark report.
Why it’s faster
Latency was measured from a Fly worker in the same region as the production app, so the operator’s own network is out of the picture. Both providers were called back to back on the same 400 distinct real texts, through an identical HTTP path, one request at a time. Real moderation traffic is prompts and chat messages under 200 characters, so that’s the range reported.
On the shortest inputs, under 60 characters, ZeroGPU answers in 82 ms at the median against OpenAI’s 145 ms, and 102 ms at p95 against 252 ms. From 60 to 120 characters it’s 105 ms against 150 ms. From 120 to 200 characters it’s 129 ms against 151 ms.
OpenAI’s median sits flat at roughly 150 ms across that whole range, because about a third of it is network: the request leaving your datacenter and the answer coming back. That overhead stays put no matter how fast the model itself gets. ZeroGPU inference is co-located with your workload, so roughly 4 ms is network and everything else is real inference. The shorter the input, the wider the gap, and short is exactly where moderation traffic lives.
What it costs
$0.02 per 1M input tokens and $0.05 per 1M output tokens, the same rate as every ZeroGPU task model. A short chat message is about 40 tokens, so a million moderation calls comes to roughly $0.80 of input at that rate.
The bigger number is the one you stop spending. Moderation runs on every message and every generation, forever, at the volume of your whole product. Save your frontier model tokens for high-level reasoning and run the inline gate on a model built for it.
Start
zlm-v1-moderation-edge is live on the ZeroGPU OpenAI-compatible API today.
Benchmark: zerogpu.ai/benchmarks/moderation-edge
Docs: docs.zerogpu.ai/docs/moderation
Model catalog: zerogpu.ai
This article was first published on Medium. Read on Medium