All Use Cases

Content Moderation

Moderate user-generated content in real time with 91.5% accuracy at 41ms.

The Challenge

Every platform with user-generated content faces the same dilemma: moderate too aggressively and you silence legitimate users; moderate too loosely and you expose your community to harm.

The technical challenge compounds this. Content moderation needs to be:

  • Fast — Users expect instant feedback when they post. A 500ms moderation delay feels broken.
  • Accurate — False positives drive users away. False negatives create liability.
  • Nuanced — Keyword filters can't distinguish "I'll kill it in the presentation" from an actual threat. Sarcasm, slang, coded language, and cultural context all matter.
  • Affordable at scale — Every message, every comment, every post needs moderation. At 100K+ items per day, per-call pricing adds up fast.

Rules engines catch obvious violations but miss nuance — typically 45-60% accuracy on text-heavy content. Direct LLM calls (GPT-4o, Claude) handle nuance brilliantly but add ~623ms of latency and ~$0.01 per call. At 50K messages per day, that's ~$15,000/month.

How Sparkient Solves It

Sparkient's compiled decision pipeline gives you the accuracy of an LLM with the speed of a rules engine.

The Three-Stage Pipeline

  1. CEL Rules (<1ms) — Instant handling of blocklists, allowlists, and hard policy constraints. New accounts posting links? Auto-review. Known spam domains? Auto-reject. Established users with clean history? Lower scrutiny threshold.

  2. Compiled Classifier (<100ms) — A compiled model trained on your specific moderation policy via synthetic data generated by an LLM teacher. Captures sarcasm, coded language, and contextual meaning — not just keywords.

  3. LLM Escalation (150ms+) — Only genuinely ambiguous content (typically 5-15% of volume) escalates to a full LLM call. The rest is handled at compiled speed.

What Makes This Different

Your moderation policy isn't the same as everyone else's. A gaming platform tolerates competitive trash talk. A children's education app doesn't. A financial forum needs to catch pump-and-dump schemes. A healthcare community needs sensitivity around self-harm.

Sparkient trains a model on your policy. You define what "approve," "review," and "reject" mean for your platform. The LLM teacher generates training data that matches your specific guidelines. The compiled model enforces them.

Code Example

python
import httpx

# Moderate a piece of content
response = httpx.post(
    "https://api.sparkient.ai/api/v1/decide",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "decision_type_id": "content-moderation",
        "input": {
            "text": "You're absolutely garbage at this game, uninstall already",
            "user_id": "player_789",
            "account_age_days": 45,
            "previous_violations": 1
        }
    }
)

result = response.json()
# {
#     "decision": "review",
#     "confidence": 0.82,
#     "latency_ms": 38,
#     "stage": "classifier"
# }

For offline or edge deployment:

python
from sparkient_edge import EdgePredictor

predictor = EdgePredictor.from_bundle("moderation.zip")
result = predictor.predict({"text": "Free money! Click here now!!!"})
# EdgeDecision(decision="reject", confidence=0.97, latency_ms=3.2)

Benchmark Results

| Metric | Sparkient Compiled Model | Rules Only | GPT-4o | |--------|--------------------------|------------|--------| | F1 Score | 91.5% | ~50-55% | ~93% | | Accuracy | 91-96% | 45-60% | ~94% | | p95 Latency | 41ms | <1ms | ~623ms | | Cost at 50K/day | $199/mo | $0 | ~$15,000/mo |

The compiled model gets within 2 points of GPT-4o's accuracy while running 15× faster and costing 75× less at 50K daily items.

Get Started

Define your moderation policy, train a compiled model, and start moderating in an afternoon. Start with the free tier — 5,000 credits, no credit card required.

Import this template

Get started in minutes. Import a pre-built decision type and customise it for your use case.

Import Template