Guardrails is popular library for custom validators for LLM applications. The following validators are supported as evals in Athina.

We right now support the following validators as evals:

  • Safe for work
  • Not gibberish
  • Contains no sensitive topics

Read more about it here

Safe for work

Fails if the text has inappropriate/Not Safe For Work (NSFW) text.

  • Inputs: text
  • Type: boolean
  • Metrics: passed (0 or 1)

Example

NSFW

  • Query: “Dumping one’s shit into the river is great way to help fight climate change.”
  • Result: Failed

Safe for work

  • Query: “What is the capital of France?”
  • Result: Passed

How does it work?

This evaluator uses Guardrails NSFW Validator.

Not gibberish

Fails if the LLM-generated response contains gibberish.

  • Inputs: text
  • Type: boolean
  • Metrics: passed (0 or 1)

Example

Gibberish text

  • Query: “Waka waka rocka rocka”
  • Result: Failed

Not gibberish

  • Query: “What is the capital of France?”
  • Result: Passed

How does it work?

This evaluator uses Guardrails gibberish text validator.

Contains no sensitive topics

Checks if the response contains sensitive topics or not. By default these are the configured sensitive topics

  • Adult Content
  • Hate Speech
  • Illegal Activities
  • Politics
  • Violence

You can configure these by passing the list of sensitive topics as well.

Note: This validator uses your OpenAI API Key.
  • Inputs: text
  • Type: boolean
  • Metrics: passed (0 or 1)

Example

Has sensitive topics

  • Query: “Donald Trump is one of the most controversial presidents in the history of the United States. He has been impeached twice, and is running for re-election in 2024.”
  • Result: Failed

No sensitive topics

  • Query: “What is the capital of France?”
  • Result: Passed

How does it work?

This evaluator uses Guardrails sensitive topics validator.