Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for all Granite Guardian risks #1576

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

martinscooper
Copy link
Collaborator

@martinscooper martinscooper commented Feb 4, 2025

This PR adds support for all available Granite Guardian risks, extending current support of RAG risks, plus bug fixes and several improvements. In summary, this PR:

  • Adds all supported risks (the ones available in this demo).
  • Adds flexibility for input field names.
  • Adds the concept of risks types: users risks, assistant risks, RAG risks, agentic risks and custom.
  • Adds examples for every risk type.
  • Adds catalog for every risk.
  • Updates default model version to 3.1.
  • Adds verification for early error detections.
  • Adds debugging logs.
  • Adds generation parameters to match those used in the Granite Guardian cookbook notebooks.
  • Fix probability of risk score: certainty was being used.
  • Adds support for 'Bring your own risk'.

@martinscooper
Copy link
Collaborator Author

I don't agree on calling 'question ' to the default user_message_field as it is not always a question. I would prefer user_message or user_prompt. This change may be not possible because of backward compatibility.

@martinscooper
Copy link
Collaborator Author

martinscooper commented Feb 5, 2025

The RAG Granite Guardian metrics are duplicated now, but not exactly. The current Granite Guardian RAG metric is defined differently in the catalog. Copy is used to set data in the task data param (link to file), but there is no example on how to use it.

@elronbandel let me know if this is the way I should define the metrics in the prepare file and how should I adapt the example.

@martinscooper
Copy link
Collaborator Author

I also changed the Granite-based LLM evaluators. I removed the '0' from the version as it looked awkward. Let me know if it is to late to make that change and I will revert it.

@martinscooper
Copy link
Collaborator Author

@arielge FYI, we are adding all the missing Granite Guardian risks.

Signed-off-by: Martín Santillán Cooper <msantillancooper@ibm.com>
Signed-off-by: Martín Santillán Cooper <msantillancooper@ibm.com>
Signed-off-by: Martín Santillán Cooper <msantillancooper@ibm.com>
Signed-off-by: Martín Santillán Cooper <msantillancooper@ibm.com>
Signed-off-by: Martín Santillán Cooper <msantillancooper@ibm.com>
Signed-off-by: Martín Santillán Cooper <msantillancooper@ibm.com>
Signed-off-by: Martín Santillán Cooper <msantillancooper@ibm.com>
Signed-off-by: Martín Santillán Cooper <msantillancooper@ibm.com>
@martinscooper martinscooper force-pushed the granite-guardian-support branch from 552fb4a to 84e15e9 Compare February 5, 2025 16:55
@@ -80,12 +80,10 @@ class EvaluatorNameEnum(str, Enum):
O1_PREVIEW = "o1-Preview"
O1_MINI = "o1-Mini"
GRANITE_13B = "Granite-13b"
GRANITE3_2B = "Granite3.0-2b"
GRANITE3_8B = "Granite3.0-8b"
GRANITE3_2B = "Granite3-2b"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martinscooper is this breaking change or just internal renaming?

Signed-off-by: Martín Santillán Cooper <msantillancooper@ibm.com>
@martinscooper martinscooper force-pushed the granite-guardian-support branch from d95a593 to 789e9b0 Compare February 6, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants