It has a SOTA hallucination detection model Lynx, which is also open source. Portkey integrates with multiple Patronus evaluators to help you enforce LLM behavior.

Browse Patronus’ docs for more info:

What is Patronus AI?

Learn more about Patronus AI and their offerings.

Using Patronus with Portkey

1. Add Patronus API Key to Portkey

Grab your Patronus API key from here.

On the Integrations page, click on the edit button for the Patronus and add your API key.

2. Add Patronus’ Guardrail Checks & Actions

Navigate to the Guardrails page and you will see the Guardrail Checks offered by Patronus there. Add the ones you want, set actions, and create the Guardrail!

List of Patronus Guardrail Checks

Check NameDescriptionParametersSupported Hooks
Retrieval Answer RelevanceChecks whether the answer is on-topic to the input question. Does not measure correctness.ON or OFFafterRequestHooks
Custom EvaluatorChecks against custom criteria, based on Patronus evaluator profile name.string(evaluator’s profile name)afterRequestHooks
Is ConciseCheck that the output is clear and concise.ON or OFFafterRequestHooks
Is HelpfulCheck that the output is helpful in its tone of voice.ON or OFFafterRequestHooks
Is PoliteCheck that the output is polite in conversation.ON or OFFafterRequestHooks
No ApologiesCheck that the output does not contain apologies.ON or OFFafterRequestHooks
No Gender BiasCheck whether the output contains gender stereotypes. Useful to mitigate PR risk from sexist or gendered model outputs.ON or OFFafterRequestHooks
No Racias BiasCheck whether the output contains any racial stereotypes or not.ON or OFFafterRequestHooks
Detect ToxicityChecks output for abusive and hateful messages.ON or OFFafterRequestHooks
Detect PIIChecks for personally identifiable information (PII) - this is information that, in conjunction with other data, can identify an individual.ON or OFFafterRequestHooks
Detect PHIChecks for protected health information (PHI), defined broadly as any information about an individual’s health status or provision of healthcare.ON or OFFafterRequestHooks

Your Patronus Guardrail is now ready to be added to any Portkey request you’d like!

3. Add Guardrail ID to a Config and Make Your Request

Patronus integration on Portkey currently only works on model outputs and not inputs.

  • When you save a Guardrail, you’ll get an associated Guardrail ID - add this ID to the after_request_hooks params in your Portkey Config.
  • Save this Config and pass it along with any Portkey request you’re making!

Your requests are now guarded by your Patronus evaluators and you can see the Verdict and any action you take directly on Portkey logs! More detailed logs for your requests will also be available on your Patronus dashboard.


Get Support

If you face any issues with the Patronus integration, just ping the @patronusai team on the community forum.