[claude] Add content moderation pipeline with Llama Guard integration (#987) #1224

Closed
claude wants to merge 1 commits from claude/issue-987 into main
Collaborator

Fixes #987

Summary

This branch implements a real-time content moderation pipeline for narration output using Llama Guard 3 via Ollama, designed to run in parallel with TTS preprocessing for near-zero added latency.

Key components:

  • ContentModerator singleton with async check() method
  • Game-context profiles (Morrowind vocabulary whitelist, fallback narrations)
  • Configurable fail-open/fail-closed degradation when model unavailable
  • Llama Guard response parsing (safe/unsafe with category codes)
  • 40 unit tests covering profiles, parsing, whitelist, and async checks

Config settings added: moderation_enabled, moderation_model, moderation_timeout_ms, moderation_fail_open, moderation_game_profile


Rescued from unmerged branch by issue #1218

Fixes #987 ## Summary This branch implements a real-time content moderation pipeline for narration output using Llama Guard 3 via Ollama, designed to run in parallel with TTS preprocessing for near-zero added latency. **Key components:** - `ContentModerator` singleton with async `check()` method - Game-context profiles (Morrowind vocabulary whitelist, fallback narrations) - Configurable fail-open/fail-closed degradation when model unavailable - Llama Guard response parsing (safe/unsafe with category codes) - 40 unit tests covering profiles, parsing, whitelist, and async checks **Config settings added:** `moderation_enabled`, `moderation_model`, `moderation_timeout_ms`, `moderation_fail_open`, `moderation_game_profile` --- *Rescued from unmerged branch by issue #1218*
claude added 1 commit 2026-03-23 22:45:05 +00:00
feat: add content moderation pipeline (Llama Guard + game-context profiles)
Some checks failed
Tests / test (pull_request) Has been skipped
Tests / lint (pull_request) Failing after 14s
3e5a3ac05f
Implement real-time content moderation for narration output using a
local safety model (Llama Guard 3 via Ollama). The pipeline is designed
to run in parallel with TTS preprocessing for near-zero added latency.

Key components:
- ContentModerator singleton with async check() method
- Game-context profiles (Morrowind vocabulary whitelist, fallback narrations)
- Configurable fail-open/fail-closed degradation when model unavailable
- Llama Guard response parsing (safe/unsafe with category codes)
- 40 unit tests covering profiles, parsing, whitelist, and async checks

Config settings: moderation_enabled, moderation_model, moderation_timeout_ms,
moderation_fail_open, moderation_game_profile

Fixes #987

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner

Merge conflicts — please rebase onto main and force-push.

Merge conflicts — please rebase onto main and force-push.
Owner

Closing stale PR — not mergeable (behind main, CI never ran). Issue remains open for re-implementation.

Closing stale PR — not mergeable (behind main, CI never ran). Issue remains open for re-implementation.
Timmy closed this pull request 2026-03-23 22:58:19 +00:00
Some checks failed
Tests / test (pull_request) Has been skipped
Tests / lint (pull_request) Failing after 14s

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1224