Skip to main content

A collection of detector algorithms and microservices that are supported by the TrustyAI team.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

guardrails_detectors-0.1.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

guardrails_detectors-0.1.0-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file guardrails_detectors-0.1.0.tar.gz.

File metadata

  • Download URL: guardrails_detectors-0.1.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for guardrails_detectors-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9882abab61bc1c3d774f2a3879059685eadec80600bcb9c8999e666883debb5a
MD5 ce2fde74981f0d411e7c17fa94dc64e7
BLAKE2b-256 a60be5f0f4911d38b40c6a187c41e3fd17ef3986dbcf0dce4b318e1d17cf5feb

See more details on using hashes here.

File details

Details for the file guardrails_detectors-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: guardrails_detectors-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.1 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for guardrails_detectors-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47731ef4b5c7c610dc39b2f8e1ccc4f8a71696b6012c1a46ecd9153aa08ae70c
MD5 72961a3b7a1112810c1c5ea58e192726
BLAKE2b-256 3fcb9d30a2329df7d6bf07cfea9f8ca5bd28c77ec80ce0d7aa220129fb9c124f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page