datarobot-moderations
DataRobot Monitoring and Moderation framework
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-moderationsuv
uv add datarobot-moderationspoetry
poetry add datarobot-moderationsInstalling 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
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
llm-guardLLM Guard provides input and output scanning…
unclear · top 15,000 on PyPI
nemoguardrailsAdds programmable guardrails to LLM-based…
permissive · top 15,000 on PyPI
toolguardGenerates deterministic Python code that…
permissive · top 15,000 on PyPI
guardrails-aiGuardrails is a Python framework that validates…
permissive · top 15,000 on PyPI
datarobot-genaiA toolkit for building and deploying AI agents…
permissive · top 15,000 on PyPI
datarobotA Python client library for programmatically…
unclear · top 15,000 on PyPI
guardrails-ai-typesProvides type definitions and data structures…
permissive · top 15,000 on PyPI
datarobot-drumDRUM is a command-line tool for developing,…
permissive · top 15,000 on PyPI
deepteamDeepTeam is an open-source red teaming…
permissive · top 15,000 on PyPI
datarobot-predictProvides a unified Python interface for making…
permissive · top 15,000 on PyPI