skillfed

datarobot-moderations

DataRobot Monitoring and Moderation framework

datarobot-moderations v11.3.1 89.5K downloads/30d#13,652 on PyPI
License unclear DataRobot Tool and Utility Agreement Active released

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 on this page — 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

datarobot-moderations on PyPI

pip

pip install datarobot-moderations

uv

uv add datarobot-moderations

poetry

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 the current Python release (<3.13,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 14 — aiohttp, backoff, click, numpy, opentelemetry-api, opentelemetry-exporter-otlp-proto-http, opentelemetry-instrumentation, opentelemetry-sdk, pandas, pillow, pydantic, requests, rouge-score, tiktoken
Maintenance actively maintained — 0 days since the last release
First released
Downloads 89,547/month — #13,652 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: datarobot_moderations-11.3.1-py3-none-any.whl

License :: Other/Proprietary LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12

Tags

llm prompt response moderationcontent guard enforcementai safety guardrailsprompt injection blockingllm output filtering
llm-safetycontent-moderationguardrails

More Artificial Intelligence packages

Further reading