{"repo":"kisugez/moderator","free":true,"listed":false,"github":"https://github.com/kisugez/moderator","clone":"git clone https://github.com/kisugez/moderator.git","description":"BYOK AI content moderation API. Plug in your own AI key, moderate messages, track repeat offenders with a 5-strike pipeline. FastAPI + PostgreSQL + Docker.","language":"Python","stars":51,"topics":["ai","byok","content-moderation","docker","fastapi","fernet","jwt","llm","microservice","postgresql"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"BYOK AI content moderation microservice. Bring your own API key, plug it in, get a verdict on every message. That simple. --- Architecture --- What it does Any app sends POST /moderate with a user ID and message. The service runs it through your connected AI provider (Claude, GPT-4o, or Gemini), returns a verdict, and tracks repeat offenders across a persistent strike pipeline. Five strikes and the user is permanently flagged — no more moderating them, no more wasted inference calls. The key design decision: you supply the API key . The service encrypts it with Fernet symmetric encryption and stores it server-side. Your AI usage stays on your billing account. The service just handles the routing, session management, strike tracking, and admin tooling. --- Technical decisions worth knowing Provider abstraction (Strategy pattern) — all three AI providers implement a single AIProvider ABC with one method: moderate(message) → ModerationResult . At request time, provider factory.py resolves the correct provider from the user's stored credentials, decrypts the key, and hands back the right implementation. Swapping providers doesn't touch the moderation logic. Fernet encryption for stored keys — provider API keys are never stored in plaintext. Every key goes through cryptography.Fernet before hitting the database. Decryption only happens inside the request cycle, never logged, never returned. JWT + server-side session table — access tokens are signed with HS256 but also hashed (SHA-","default_branch":null,"files":null,"tree":[],"storefront":"/r/kisugez","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kisugez/moderator/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}