Skip to content

Remove GPT4All as AI-Provider#15439

Merged
ThiloteE merged 32 commits into
JabRef:mainfrom
ThiloteE:ThiloteE-2026-03-28-RemoveGPT4All
Apr 7, 2026
Merged

Remove GPT4All as AI-Provider#15439
ThiloteE merged 32 commits into
JabRef:mainfrom
ThiloteE:ThiloteE-2026-03-28-RemoveGPT4All

Conversation

@ThiloteE

@ThiloteE ThiloteE commented Mar 28, 2026

Copy link
Copy Markdown
Member

Related issues and pull requests

#11872

PR Description

Removes the AI-provider "GPT4All".
Reason: The project is unmaintained, there are no security updates and prior maintainers are unresponsive.
GPT4All had thousands of stars on GitHub, so maybe somebody will step up, fork and maintain it, but until then, I feel it would be irresponsible to promote it to our user-base.

After:
grafik

ToDO

  • Remove GPT4All from user-documentation

Steps to test

  1. Open File > Preferences > AI
  2. See that GPT4All has been removed

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • [/] I added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@ThiloteE ThiloteE changed the title Thilote e 2026 03 28 remove gpt4 all Remove GP4All as AI-Provider Mar 28, 2026
@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Mar 28, 2026
InAnYan

This comment was marked as duplicate.

Comment thread jablib/src/main/java/org/jabref/logic/ai/AiDefaultPreferences.java Outdated
@ThiloteE ThiloteE changed the title Remove GP4All as AI-Provider Remove GPT4All as AI-Provider Mar 29, 2026
@jabref-machine

This comment was marked as resolved.

Comment thread jabgui/src/main/java/org/jabref/gui/preferences/ai/AiTab.java
Co-authored-by: Ruslan <ruslanpopov1512@gmail.com>
Co-authored-by: ThiloteE <73715071+ThiloteE@users.noreply.github.com>
Comment thread jablib/src/main/java/org/jabref/model/ai/AiProvider.java Outdated
Comment thread jablib/src/main/java/org/jabref/logic/ai/AiPreferences.java
Co-authored-by: ThiloteE <73715071+ThiloteE@users.noreply.github.com>
Comment thread jablib/src/main/java/org/jabref/logic/ai/AiDefaultPreferences.java Outdated
InAnYan
InAnYan previously approved these changes Apr 3, 2026

@InAnYan InAnYan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's good to go

@ThiloteE

ThiloteE commented Apr 3, 2026

Copy link
Copy Markdown
Member Author

Will you fix JBang in a follow up PR?

ThiloteE added a commit to JabRef/user-documentation that referenced this pull request Apr 3, 2026
@ThiloteE ThiloteE marked this pull request as ready for review April 3, 2026 12:53
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Remove GPT4All as unmaintained AI provider

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Removes GPT4All AI provider due to unmaintained status
• Eliminates all GPT4All-related properties and configuration
• Removes GPT4All model implementation and related tests
• Cleans up API key binding logic for remaining providers
Diagram
flowchart LR
  A["GPT4All Provider"] -->|removed| B["AiProvider enum"]
  C["Gpt4AllModel class"] -->|deleted| D["Model implementations"]
  E["GPT4All properties"] -->|removed| F["AiPreferences & AiTabViewModel"]
  G["GPT4All tests"] -->|removed| H["Test files"]
  B -->|simplified| I["Remaining providers: OpenAI, Mistral, Gemini, HuggingFace"]
Loading

Grey Divider

File Changes

1. jablib/src/main/java/org/jabref/model/ai/AiProvider.java ✨ Enhancement +1/-2

Remove GPT4All enum value from provider list

jablib/src/main/java/org/jabref/model/ai/AiProvider.java


2. jablib/src/main/java/org/jabref/logic/ai/chatting/model/Gpt4AllModel.java ✨ Enhancement +0/-160

Delete entire GPT4All model implementation file

jablib/src/main/java/org/jabref/logic/ai/chatting/model/Gpt4AllModel.java


3. jablib/src/main/java/org/jabref/logic/ai/AiPreferences.java ✨ Enhancement +0/-36

Remove GPT4All chat model and API base URL properties

jablib/src/main/java/org/jabref/logic/ai/AiPreferences.java


View more (12)
4. jablib/src/main/java/org/jabref/logic/ai/AiDefaultPreferences.java ✨ Enhancement +2/-4

Remove GPT4All from predefined models and defaults

jablib/src/main/java/org/jabref/logic/ai/AiDefaultPreferences.java


5. jablib/src/main/java/org/jabref/logic/ai/chatting/model/JabRefChatLanguageModel.java ✨ Enhancement +2/-6

Remove GPT4All case from model builder and validation

jablib/src/main/java/org/jabref/logic/ai/chatting/model/JabRefChatLanguageModel.java


6. jablib/src/main/java/org/jabref/logic/ai/models/OpenAiCompatibleModelProvider.java ✨ Enhancement +1/-2

Remove GPT4All from supported providers list

jablib/src/main/java/org/jabref/logic/ai/models/OpenAiCompatibleModelProvider.java


7. jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java ✨ Enhancement +0/-8

Remove GPT4All preference keys and default values

jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java


8. jabgui/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java ✨ Enhancement +0/-25

Remove GPT4All properties from view model

jabgui/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java


9. jabgui/src/main/java/org/jabref/gui/preferences/ai/AiTab.java ✨ Enhancement +1/-12

Remove GPT4All UI bindings and prompt text

jabgui/src/main/java/org/jabref/gui/preferences/ai/AiTab.java


10. jabgui/src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.java ✨ Enhancement +0/-1

Remove GPT4All privacy policy hyperlink

jabgui/src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.java


11. jabgui/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java ✨ Enhancement +1/-2

Remove GPT4All chat model property from dependencies

jabgui/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java


12. jablib/src/test/java/org/jabref/logic/ai/models/OpenAiCompatibleModelProviderTest.java 🧪 Tests +2/-20

Remove GPT4All test cases from model provider tests

jablib/src/test/java/org/jabref/logic/ai/models/OpenAiCompatibleModelProviderTest.java


13. jablib/src/test/java/org/jabref/logic/ai/models/FetchAiModelsBackgroundTaskTest.java 🧪 Tests +0/-21

Remove GPT4All provider test case

jablib/src/test/java/org/jabref/logic/ai/models/FetchAiModelsBackgroundTaskTest.java


14. jabgui/src/test/java/org/jabref/gui/ai/components/aichat/AiChatComponentTest.java 🧪 Tests +0/-5

Remove GPT4All model property from component tests

jabgui/src/test/java/org/jabref/gui/ai/components/aichat/AiChatComponentTest.java


15. CHANGELOG.md 📝 Documentation +2/-0

Document GPT4All removal in changelog

CHANGELOG.md


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0)   📘 Rule violations (1)   📎 Requirement gaps (0)   🎨 UX Issues (0)
📘\ ⚙ Maintainability (1)

Grey Divider


Action required

1. GPT4ALL removal breaks valueOf📘
Description
AiProvider.GPT4ALL was removed, but preferences are still parsed via AiProvider.valueOf(...),
which will throw if a user has AI_PROVIDER=GPT4ALL stored from a previous version. This introduces
a backward-compatibility break that can prevent JabRef from starting or loading AI preferences for
existing users.
Code

jablib/src/main/java/org/jabref/model/ai/AiProvider.java[R6-10]

OPEN_AI("OpenAI (or API compatible)", "https://api.openai.com/v1", "https://openai.com/policies/privacy-policy/"),
MISTRAL_AI("Mistral AI", "https://api.mistral.ai/v1", "https://mistral.ai/terms/#privacy-policy"),
GEMINI("Gemini", "https://generativelanguage.googleapis.com/v1beta/", "https://ai.google.dev/gemini-api/terms"),
-    HUGGING_FACE("Hugging Face", "https://router.huggingface.co/v1", "https://huggingface.co/privacy"),
-    GPT4ALL("GPT4All", "http://localhost:4891/v1", "https://www.nomic.ai/gpt4all/legal/privacy-policy");
+    HUGGING_FACE("Hugging Face", "https://router.huggingface.co/v1", "https://huggingface.co/privacy");
Evidence
The PR removes the GPT4ALL enum constant, while the preferences loader still calls
AiProvider.valueOf(get(AI_PROVIDER)); if the stored value is GPT4ALL, valueOf will fail at
runtime. This violates the backward-compatibility requirement unless migration/fallback handling is
added.

AGENTS.md
jablib/src/main/java/org/jabref/model/ai/AiProvider.java[6-10]
jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1946-1953]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Removing `AiProvider.GPT4ALL` can break existing user installations if their stored preference `AI_PROVIDER` is still `GPT4ALL`, because `AiProvider.valueOf(...)` will throw.
## Issue Context
The PR removes the provider, but existing preferences may still contain `GPT4ALL`. JabRef should gracefully migrate or fall back (e.g., switch to `OPEN_AI` provider with a sensible default), instead of failing.
## Fix Focus Areas
- jablib/src/main/java/org/jabref/model/ai/AiProvider.java[6-10]
- jablib/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java[1946-1953]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Extra blank line in changelog 📘
Description
An extra blank line was added after the new ### Removed bullet, which breaks the
no-extra-blank-lines formatting rule for CHANGELOG.md. This can lead to inconsistent release note
formatting.
Code

CHANGELOG.md[R84-85]

+- We removed GPT4All as AI-provider as this project is currently unmaintained and does not receive any security updates [#15439](https://github.com/JabRef/jabref/pull/15439)
+
Evidence
The compliance checklist requires CHANGELOG.md changes to avoid extra blank lines; the added empty
line after the new bullet introduces additional spacing before the next version header.

AGENTS.md
CHANGELOG.md[84-86]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`CHANGELOG.md` contains an extra blank line after the newly added bullet under `### Removed`.
## Issue Context
The repository formatting rule for `CHANGELOG.md` disallows extra blank lines.
## Fix Focus Areas
- CHANGELOG.md[84-86]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment thread jablib/src/main/java/org/jabref/model/ai/AiProvider.java
@InAnYan

InAnYan commented Apr 3, 2026

Copy link
Copy Markdown
Member

I don't know how to fix Jbang tests(

But I think I'll fix that problem with .valueof in the next PR

@ThiloteE

ThiloteE commented Apr 3, 2026

Copy link
Copy Markdown
Member Author

Current blocker:

2026-04-03 20:37:13 [JavaFX Application Thread] org.jabref.gui.JabRefGUI.start()
ERROR: Error during initialization: java.lang.IllegalArgumentException: No enum constant org.jabref.model.ai.AiProvider.GPT4ALL
        at java.base/java.lang.Enum.valueOf(Enum.java:293)
        at org.jabref.jablib/org.jabref.model.ai.AiProvider.valueOf(AiProvider.java:5)
        at org.jabref.jablib/org.jabref.logic.preferences.JabRefCliPreferences.getAiPreferences(JabRefCliPreferences.java:1952)
        at org.jabref/org.jabref.gui.JabRefGUI.initialize(JabRefGUI.java:232)
        at org.jabref/org.jabref.gui.JabRefGUI.start(JabRefGUI.java:114)
        at javafx.graphics@26/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$4(LauncherImpl.java:845
        at javafx.graphics@26/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$0(PlatformImpl.java:449)
        at javafx.graphics@26/com.sun.javafx.application.PlatformImpl.lambda$runLater$0(PlatformImpl.java:424)
        at javafx.graphics@26/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at javafx.graphics@26/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics@26/com.sun.glass.ui.win.WinApplication.lambda$runLoop$0(WinApplication.java:173)
        at java.base/java.lang.Thread.run(Thread.java:1474)
Exception in Application start method
2026-04-03 20:37:15 [] org.jabref.gui.JabRefGUI.lambda$stop$1()
ERROR: Unable to close AI service: java.lang.NullPointerException: Cannot invoke "org.jabref.logic.ai.AiService.close()" because "org.jabref.gui.JabRefGUI.aiService" is null
        at org.jabref/org.jabref.gui.JabRefGUI.lambda$stop$1(JabRefGUI.java:502)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
        at java.base/java.util.concurrent.ThreadPerTaskExecutor$ThreadBoundFuture.run(ThreadPerTaskExecutor.java:323)
        at java.base/java.lang.VirtualThread.run(VirtualThread.java:456)

Edit: This was the error that triggered when I had GPT4All selected as provider while trying to run this PR.

@Siedlerchr

Copy link
Copy Markdown
Member

You need a preferences migration to replace GPT4All if it was in the preferences

@calixtus

calixtus commented Apr 3, 2026

Copy link
Copy Markdown
Member

Na, just made a default to fallback to

@calixtus

calixtus commented Apr 3, 2026

Copy link
Copy Markdown
Member

Will you fix JBang in a follow up PR?

Tried to repoduce on my local machine, but had no success. Think we need to ask @koppor here.

@InAnYan

InAnYan commented Apr 4, 2026

Copy link
Copy Markdown
Member

Current blocker:

Details

```java

2026-04-03 20:37:13 [JavaFX Application Thread] org.jabref.gui.JabRefGUI.start()

ERROR: Error during initialization: java.lang.IllegalArgumentException: No enum constant org.jabref.model.ai.AiProvider.GPT4ALL

    at java.base/java.lang.Enum.valueOf(Enum.java:293)

    at org.jabref.jablib/org.jabref.model.ai.AiProvider.valueOf(AiProvider.java:5)

    at org.jabref.jablib/org.jabref.logic.preferences.JabRefCliPreferences.getAiPreferences(JabRefCliPreferences.java:1952)

    at org.jabref/org.jabref.gui.JabRefGUI.initialize(JabRefGUI.java:232)

    at org.jabref/org.jabref.gui.JabRefGUI.start(JabRefGUI.java:114)

    at javafx.graphics@26/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$4(LauncherImpl.java:845

    at javafx.graphics@26/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$0(PlatformImpl.java:449)

    at javafx.graphics@26/com.sun.javafx.application.PlatformImpl.lambda$runLater$0(PlatformImpl.java:424)

    at javafx.graphics@26/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

    at javafx.graphics@26/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)

    at javafx.graphics@26/com.sun.glass.ui.win.WinApplication.lambda$runLoop$0(WinApplication.java:173)

    at java.base/java.lang.Thread.run(Thread.java:1474)

Exception in Application start method

2026-04-03 20:37:15 [] org.jabref.gui.JabRefGUI.lambda$stop$1()

ERROR: Unable to close AI service: java.lang.NullPointerException: Cannot invoke "org.jabref.logic.ai.AiService.close()" because "org.jabref.gui.JabRefGUI.aiService" is null

    at org.jabref/org.jabref.gui.JabRefGUI.lambda$stop$1(JabRefGUI.java:502)

    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)

    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)

    at java.base/java.util.concurrent.ThreadPerTaskExecutor$ThreadBoundFuture.run(ThreadPerTaskExecutor.java:323)

    at java.base/java.lang.VirtualThread.run(VirtualThread.java:456)



Edit: This was the error that triggered when I had GPT4All selected as provider while trying to run this PR.
</p>
</details> 

I think this is exactly what qodo was warning about.

And I agree with Carl's approach, I would do the same

calixtus added 3 commits April 4, 2026 09:01
…teE-2026-03-28-RemoveGPT4All

# Conflicts:
#	jabgui/src/main/java/org/jabref/gui/preferences/ai/AiTab.java
#	jablib/src/main/java/org/jabref/logic/ai/AiDefaultPreferences.java
@calixtus calixtus enabled auto-merge April 5, 2026 21:28
@calixtus

calixtus commented Apr 5, 2026

Copy link
Copy Markdown
Member

In private chat @koppor suggested Jbang issue might be a workflow related issue. Can be ignored in PR.
So lets move forward here.

ThiloteE added a commit to JabRef/user-documentation that referenced this pull request Apr 5, 2026
* Removes GPT4All as AI provider from User Documentation
* Follow up to JabRef/jabref#15439
@InAnYan

InAnYan commented Apr 6, 2026

Copy link
Copy Markdown
Member

I ran a JBang script and it worked without errors

@ThiloteE ThiloteE disabled auto-merge April 7, 2026 13:03
@ThiloteE ThiloteE merged commit 54b90f4 into JabRef:main Apr 7, 2026
45 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: no-bot-comments If set, there should be no comments from our bots status: changes-required Pull requests that are not yet complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants