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 notice on usage of local models #12298

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

Conversation

InAnYan
Copy link
Collaborator

@InAnYan InAnYan commented Dec 16, 2024

image

Changes:

  1. Rename AI provider OpenAI to OpenAI (or API compatible).
  2. When local models are used, add additional notice that JabRef is not responsible for model output.

Rationales:

  1. When using a local model (by choosing "OpenAI" and changing API base URL), funny thing happen: AI chat will display: "Current model: OpenAI qwen2.5:3b", however OpenAI does not provide Qwen models.
  2. For EU act on AI. Refs https://github.com/JabRef/jabref-issue-melting-pot/issues/730

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
    - [ ] Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
    - [ ] Tests created for changes (if applicable)
    - [x] Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

BorderPane.alignment="CENTER"/>
<VBox fx:id="noticeVbox" spacing="5" alignment="CENTER">
<Label fx:id="noticeText"
text="%Current AI model: %0. This content is generated by an AI system. Please verify its accuracy and relevance before use."
Copy link
Member

@subhramit subhramit Dec 16, 2024

Choose a reason for hiding this comment

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

I think the second sentence is redundant after the first is read. Also, the third sentence ends with "before use" - but accuracy can be verified only after the content is generated.
Based on chatgpt:

image

Three possible suggestions:

Suggested change
text="%Current AI model: %0. This content is generated by an AI system. Please verify its accuracy and relevance before use."
text="%Current AI model: %0. AI generated content may not always be accurate. Verify any important information."

Or:

Suggested change
text="%Current AI model: %0. This content is generated by an AI system. Please verify its accuracy and relevance before use."
text="%Current AI model: %0. Always verify the correctness of any important information."

Or:

Suggested change
text="%Current AI model: %0. This content is generated by an AI system. Please verify its accuracy and relevance before use."
text="%Current AI model: %0. Please always verify the correctness of AI-generated content."

and other permutations...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ha! I haven't looked at "Current model:...". But you are right. I rewrote the message a bit now, what do you think about it now?

Copy link
Member

Choose a reason for hiding this comment

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

Yes! This one reads good.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

BorderPane.alignment="CENTER"/>
<VBox fx:id="noticeVbox" spacing="5" alignment="CENTER">
<Label fx:id="noticeText"
text="%You are using AI model: %0. AI generated content may not always be accurate. Verify any important information."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
text="%You are using AI model: %0. AI generated content may not always be accurate. Verify any important information."
text="%You are using AI model \"%0\". AI generated content may not always be accurate. Verify any important information."

I hope this works. Reason to use quotes: AI model names may contain spaces - and maybe dots. With that change, it should be visible to the users...

@@ -109,6 110,10 @@ private void initializeNotice() {
.replaceAll("%0", aiPreferences.getAiProvider().getLabel() " " aiPreferences.getSelectedChatModel());

noticeText.setText(newNotice);

if (aiPreferences.isUnsafeModelSelected()) {
noticeVbox.getChildren().add(new Label(Localization.lang("A custom or local AI model is used, JabRef is not responsible for the content generated by the model.")));
Copy link
Member

Choose a reason for hiding this comment

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

What about the other models? Do we take responsibility? I hope not :).

Proposal: "A model not covered by the EU AI act is selected. Use with extra care."

* are subject to the EU AI act. However, when user selects a local model or models from Hugging Face, then any model
* can be used in JabRef, including uncensored and harmful ones.
*/
public boolean isUnsafeModelSelected() {
Copy link
Member

Choose a reason for hiding this comment

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

Rename to isSubjectToEuAiAct?

In all cases do NOT use negations in the method name. Use isSafeModelSelected.

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.

3 participants