Closed
Description
Follow up to #11870 and #12078.
Sub-issue of #11872
Setup:
- Download and install GPT4All. Go to GPT4All settings and enable "Local API Server".
- Download a large language model and configure it both in GPT4All and JabRef. An outdated example is depicted at Support GPT4All Server API #11870 (comment). Nowadays it is possible to choose GPT4All as AI provider at "File > Preferences > AI". Also, for testing, I recommend Replete-LLM-V2.5-Qwen-1.5b, since it is super small and fast, but it uses a different prompt template syntax than the phi-3 models.
Description of problem:
Chatting already works with GPT4All, but the embeddings of the pdf documents that are attached to JabRef's entries are seemingly not sent to GPT4All.
Hypotheses about the root of the problem:
- Hypothesis 0: JabRef does not try to send embeddings.
- Hypothesis 1: JabRef tries to attach the embeddings to the "system prompt" (as called in GPT4All) / "Instructions for AI" (As we call it in JabRef) and GPT4All does support system prompts, at least it is claimed in Enable system prompt for server. nomic-ai/gpt4all#2921, but I believe nomic-ai/gpt4all@328df85 might have disabled the ability for clients to send system prompts to GPT4All and instead force the system prompt that is configured in GPT4All. Basically there is a conflict between System prompt of GPT4All and System prompt of JabRef. Maybe it is the other way round though. Issue system prompt is ignored in API request nomic-ai/gpt4all#1855 shows somebody trying to send a system prompt via API, but there have been fixes since then that were supposed to fix it. Maybe it works now?! Worth a try.
- Hypothesis 2: JabRef should send the embeddings to the user prompt, but doesn't.
- Hypothesis 3: GPT4All's Local API Server is stateless and previous messages (including system prompt?!) are lost upon every new message. See Local server not remembering previous messages nomic-ai/gpt4all#2602 (comment). This is an unlikely hypothesis, as it requires multiple conditions to be fulfilled: (1) JabRef attaches embeddings to system prompt, (2) GPT4All is stateless and "forgets" the system prompt even before the first user message.
Additional info:
- There is a rework of GPT4All's Local API server in the works. Apparently they are trying to use Ollama as backend in future. See WIP: new server backend for GPT4All nomic-ai/gpt4all#2806.