Skip to main content

Detector Algorithms for the FMS Guardrails Orchestrator

FMS Guardrails Orchestrator is an open source project led by IBM which provides a server for invocation of detectors on text generation input and output, and standalone detections.

This repository is intended to provide a collection of detector algorithms and microservices that are supported by the TrustyAI team.

Detectors

At the moment, the following detectors are supported:

  • huggingface -- a generic detector class that is intended to be compatible with any AutoModelForSequenceClassification or a specific kind of AutoModelForCausalLM, namely GraniteForCausalLM; this detector exposes /api/v1/text/contents and thus, could be configured to be a detector of type: text_contents within the FMS Guardrails Orchestrator framework. This detector is also intended to be deployed as a KServe inference service.
  • llm_judge -- Integrates the vLLM Judge library to use LLM-as-a-judge based guardrailing architecture
  • builtIn -- Small, lightweight detection functions that are deployed out-of-the-box alongside the Guardrails Orchestrator. The built-in detectors provide a number of heuristic or algorithmic detection functions, such as:
    • Regex-based detections, with pre-written regexes for flagging various Personally Identifiable Information items like emails or phone numbers, as well as the ability to provide custom regexes
    • File-type validations, for verifying if model input/output is valid JSON, XML, or YAML

Building

  • huggingface: podman build -f detectors/Dockerfile.hf detectors
  • llm_judge: podman build -f detectors/Dockerfile.llm_judge detectors
  • builtIn: podman build -f detectors/Dockerfile.builtIn detectors

Running locally

  • builtIn: podman run -p 8080:8080 $BUILT_IN_IMAGE

Examples

  • Check out built-in detector examples to see how to use the built-in detectors for file type validation and personally identifiable information (PII) detection
  • Check out Hugging Face detector examples to see how to use the Hugging Face detectors for detecting toxic content and prompt injection

API

See IBM Detector API

License

This project is licensed under the Apache License Version 2.0 - see the LICENSE file for details.

Metadata

Release files for guardrails-detectors 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for guardrails-detectors 0.1.0
File Size Uploaded
guardrails_detectors-0.1.0.tar.gz 22.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for guardrails-detectors 0.1.0
File Interpreter ABI Platform
guardrails_detectors-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 56.3 kB

Release files / guardrails_detectors-0.1.0.tar.gz

Download URL guardrails_detectors-0.1.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9882abab61bc1c3d774f2a3879059685eadec80600bcb9c8999e666883debb5a
BLAKE2b-256 checksum
How to use checksums
a60be5f0f4911d38b40c6a187c41e3fd17ef3986dbcf0dce4b318e1d17cf5feb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/8.7.0 pkginfo/1.12.1.2 requests/2.32.4 requests-toolbelt/1.0.0 tqdm/4.67.1 CPython/3.10.17

Release files / guardrails_detectors-0.1.0-py3-none-any.whl

Download URL guardrails_detectors-0.1.0-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47731ef4b5c7c610dc39b2f8e1ccc4f8a71696b6012c1a46ecd9153aa08ae70c
BLAKE2b-256 checksum
How to use checksums
3fcb9d30a2329df7d6bf07cfea9f8ca5bd28c77ec80ce0d7aa220129fb9c124f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/8.7.0 pkginfo/1.12.1.2 requests/2.32.4 requests-toolbelt/1.0.0 tqdm/4.67.1 CPython/3.10.17

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page