Skip to content

localmod

Offline moderation API that flags toxicity, PII, spam and prompt injection in text and

Permissive (OSI) · MIT AI-native

Listed by , founder & editor

47

Health

Slowing

Overview

Stars

116

Last commit

32 days ago

Oct 2026

Repository age

11 months

since Dec 2025

Latest version

v0.1.0

Dec 2025

Contributors

–

2 active in 90 days

Releases

1

last 12 months

Language

Python

LocalMod is a content moderation API that runs fully offline on your own infrastructure. It is written in Python and uses FastAPI. You can call it from Python with a safety pipeline, run it as an API server, or build a Docker image from the included Dockerfile.

It includes classifiers for PII (regex with validation), toxicity (an ensemble of four models), prompt injection, spam, NSFW text and NSFW images. Models download once, about 3.5 GB including the image model. The project reports a toxicity F1 of 0.75 on its benchmark, below OpenAI's Moderation API at 0.83 and Azure Content Moderator at 0.81. It also ships an example Discord bot that moderates text and images.

It is MIT licensed and acts as a self-hosted alternative to commercial moderation APIs such as OpenAI Moderation or Azure Content Moderator.

Who it's for

Developers adding guardrails to LLM apps

Prompt injection and PII classifiers run locally, so prompts stay in your environment.

Skip if: You need top benchmark accuracy for toxicity.

Community moderators running Discord servers

The example bot handles text and image moderation with auto-delete and timeouts.

Skip if: You want a hosted dashboard instead of running code.

The problem it solves

Sending user content to a hosted moderation API means your data leaves your infrastructure and every request has a cost. LocalMod runs the checks on your own machines instead.

Strengths

  • Runs fully offline once models are downloaded
  • Covers PII, toxicity, prompt injection, spam, NSFW text and images
  • REST API, Python library and Docker image
  • MIT licensed

Trade-offs

  • Toxicity F1 of 0.75 trails the commercial APIs it benchmarks against
  • Model download is about 3.5 GB
  • Early release at v0.1.0 with slowing development
  • NSFW text precision is 0.60 on its proxy benchmark

Self-host localmod

Self-hostable
Yes

Quick start

docker build -f docker/Dockerfile -t localmod:latest .
docker run -p 8000:8000 localmod:latest

From the project's own install instructions. Check the docs for production settings.

Frequently asked questions

Is it free?

Yes. It is MIT licensed and runs on your own hardware.

Can it run without internet?

Yes, after you download the models once.

How do I call it?

Through the Python SafetyPipeline, or the HTTP API started with localmod serve, such as the /analyze endpoint.

Does it work in Docker?

Yes. You build the image from docker/Dockerfile and expose port 8000.

Similar tools in AI security and guardrails

Claw-Hunter

AI security and guardrails

Script that finds OpenClaw AI agent installs on endpoints for IT security teams

89 8 9 months ago Dormant MIT

skill-audit

AI security and guardrails

63 3 10 months ago Dormant Unknown

clawsecure-openclaw-security

AI security and guardrails

Security scanner for OpenClaw agent skills, checked against the OWASP ASI Top 10

41 4 2 months ago Slowing MIT

agent-browser-shield

AI security and guardrails

Browser extension that cleans pages and blocks prompt injection for browsing AI agents

35 3 18 days ago Active PolyForm-Shield-1.0.0

onequery

AI security and guardrails

16 2 4 months ago Slowing Apache-2.0