--- id: datarobot-moderations version: "11.3.1" license: DataRobot Tool and Utility Agreement license_treatment: unclear maintenance: active --- # datarobot-moderations — DataRobot Monitoring and Moderation framework License: unclear · Maintenance: active · Downloads: 89.5K/mo ## What it is and what it does DataRobot Moderations is a library that wraps LLM inference pipelines to enforce content moderation policies. It reads guard rules from YAML configuration and evaluates prompts before they reach the LLM (prescore guards) and responses after generation (postscore guards), returning blocked/modified text and metric values. The library supports multiple guard types including token-count, ROUGE-1, cost, and optional evaluators for tasks like faithfulness and task adherence. The core workflow is: load a pipeline from YAML, dict, or Pydantic config, call evaluate_prompt_async or evaluate_response_async for individual checks, or use evaluate_full_pipeline_async to run prescore → LLM → postscore in sequence. It integrates with OpenTelemetry for tracing and metrics export. The library depends on aiohttp, requests, pydantic, and data libraries (numpy, pandas, pillow, tiktoken, rouge-score) for core functionality; optional extras pull in heavier ML runtimes and cloud SDK dependencies. Use it for: - Block adversarial or injection-attack prompts before they reach a production LLM deployment. - Enforce output safety policies on LLM responses (e.g., block factually inconsistent or off-topic completions). - Monitor and log moderation metrics (token counts, ROUGE scores, cost) for compliance and audit trails. - Integrate model-backed evaluators for task-specific guards like faithfulness or guideline adherence. - Ship traces and metrics to DataRobot's telemetry backend for centralized monitoring of LLM safety. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Enforces content moderation on LLM prompts and responses using configurable guard rules, blocking or modifying text according to a YAML-defined policy before and after LLM inference. Yes, if you are already in the DataRobot ecosystem and need LLM moderation with centralized telemetry. The library is actively maintained, has low install friction, and covers common guard types out of the box. However, the proprietary license and unclear license treatment require legal review before use outside DataRobot deployments. Consider alternatives if you need a permissively licensed or vendor-neutral moderation framework. ## Install pip install datarobot-moderations uv add datarobot-moderations poetry add datarobot-moderations ## Installing datarobot-moderations Before you install: Low install friction; pure Python wheel with 14 runtime dependencies including standard data/ML libraries (numpy, pandas, pillow) and OpenTelemetry instrumentation. Active maintenance as of latest release. License in practice: Licensed under DataRobot Tool and Utility Agreement (proprietary, non-standard). License treatment is unclear—review the full terms before use in commercial or redistributed projects. Quickstart: pip install datarobot-moderations from datarobot_moderations import ModerationPipeline pipeline = ModerationPipeline.from_yaml("moderation_config.yaml", endpoint="...", api_token="...") result, latency, df = await pipeline.evaluate_prompt_async("user prompt") Requires DataRobot API credentials (endpoint and api_token) via environment variables or explicit arguments; async/await context required for evaluation methods. Verify before relying: - Whether the proprietary DataRobot Tool and Utility Agreement permits use outside DataRobot deployments. - Performance characteristics and latency overhead of guard evaluation at scale. - Availability and stability of optional extras and their transitive dependency footprint. ## Package facts - License: DataRobot Tool and Utility Agreement (unclear) - Python support: capped_below_current - Install friction: low - Maintenance: active - Downloads: 89.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags llm prompt response moderation, content guard enforcement, ai safety guardrails, prompt injection blocking, llm output filtering, llm-safety, content-moderation, guardrails [View on SkillFed](https://skillfed.io/packages/datarobot-moderations) · [View on PyPI](https://pypi.org/project/datarobot-moderations/)