[GH-ISSUE #1339] [BUG]: Model used isn't updated until save (which doesn't always appear) is explicitly pressed #847

Closed
opened 2026-02-22 18:21:46 -05:00 by yindo · 2 comments
Owner

Originally created by @tomrford on GitHub (May 10, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1339

Originally assigned to: @shatfield4 on GitHub.

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

Changed model from Dolphin Llama3 Q6 to Q5KM (both ran from Ollama), deleted Q6 after swapping, and when I tried to chat I got an error message that suggested the app was still asking for the Q6 model even after changing it in settings. Restarting Ollama, AnythingLLM, new workspace, all didn't change it. Was solved by changing to a completely different model, saving, and then going back to the new llama model.

image

Tried the same thing moving from Q5 to Q4 and deleting the old model, from that to llama3:instruct, and got the same result. Error message pictured above.

Could this be a generic issue where the model used by the app is only ever updated when saved in the settings? If I just delete the model I'm currently using, nothing works until I select a new one in settings (and am given the save option). My issue came about because the settings dropdown box already showed the new model I wanted, suggesting it had been updated (and there was no save option), even if it had never been saved.

Happy to show this in more detail - had a look at your code to see if I could fix it myself but I'm not a javascripter :(

Are there known steps to reproduce?

  • Download three models from ollama
  • configure AnythingLLM to use one of the models; check it works
  • remove the model currently in use
  • open settings, note the model currently in the dropdown in settings. Even when closing ollama, anythingllm, the chat interface will still request the old model
  • switch to the 3rd model; the save button will appear in settings; press it
  • chat should now work again
  • go back to the second model; save option should once again appear; and chat should now work with the second model
Originally created by @tomrford on GitHub (May 10, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1339 Originally assigned to: @shatfield4 on GitHub. ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? Changed model from Dolphin Llama3 Q6 to Q5KM (both ran from Ollama), deleted Q6 after swapping, and when I tried to chat I got an error message that suggested the app was still asking for the Q6 model even after changing it in settings. Restarting Ollama, AnythingLLM, new workspace, all didn't change it. Was solved by changing to a completely different model, saving, and then going back to the new llama model. <img width="782" alt="image" src="https://github.com/Mintplex-Labs/anything-llm/assets/109313432/1b527b81-a02b-4b84-8ec3-29d7abe81fa7"> Tried the same thing moving from Q5 to Q4 and deleting the old model, from that to llama3:instruct, and got the same result. Error message pictured above. Could this be a generic issue where the model used by the app is only ever updated when saved in the settings? If I just delete the model I'm currently using, nothing works until I select a new one in settings (and am given the save option). My issue came about because the settings dropdown box already showed the new model I wanted, suggesting it had been updated (and there was no save option), even if it had never been saved. Happy to show this in more detail - had a look at your code to see if I could fix it myself but I'm not a javascripter :( ### Are there known steps to reproduce? - Download three models from ollama - configure AnythingLLM to use one of the models; check it works - remove the model currently in use - open settings, note the model currently in the dropdown in settings. Even when closing ollama, anythingllm, the chat interface will still request the old model - switch to the 3rd model; the save button will appear in settings; press it - chat should now work again - go back to the second model; save option should once again appear; and chat should now work with the second model
yindo added the possible buginvestigating labels 2026-02-22 18:21:46 -05:00
yindo closed this issue 2026-02-22 18:21:46 -05:00
Author
Owner

@shatfield4 commented on GitHub (May 10, 2024):

This is actually intentional the way that this functions. We don't check for a model's existence before sending a chat each time because this would cause many unnecessary calls to the models endpoint of Ollama. This will just have to be something that you will need to maintain as you download and remove models from Ollama.

@shatfield4 commented on GitHub (May 10, 2024): This is actually intentional the way that this functions. We don't check for a model's existence before sending a chat each time because this would cause many unnecessary calls to the models endpoint of Ollama. This will just have to be something that you will need to maintain as you download and remove models from Ollama.
Author
Owner

@tomrford commented on GitHub (May 10, 2024):

I get that, and I don't think you need to check every time you send a message. my suggestion would be to check on launch if the model last used was still present. If you were in a scenario where you had 2 models and deleted one then there would be no way for the user to update whatever is behind the selection menu, as you can't get the save option to show without actively changing the model yourself. If the model was checked upon opening then it would mean even if you deleted a model mid conversation (for whatever reason) then at least closing and reopening the application would solve it.

For example, If you last configured AnythingLLM to be using model A, closed the app, uninstalled model A, and then reopened AnythingLLM, it would currently just throw errors at you, even if in the settings page it showed that model B was selected. In order to be able to use the app with model B you would need to select and save model C, then select and save model B.

My suggestion would be - when connecting to Ollama, if the model that you have saved for use (in my above example, model A) isn't present anymore, then you need to set the model to the same one as shows up in the dropdown menu (in this case model B, or I think it's just the top of the list alphabetically). Otherwise the error is very unintuitive to solve since restarting both apps doesn't help here, and you would need to actively reconfigure and then revert the settings in the app to solve it.

@tomrford commented on GitHub (May 10, 2024): I get that, and I don't think you need to check every time you send a message. my suggestion would be to check on launch if the model last used was still present. If you were in a scenario where you had 2 models and deleted one then there would be no way for the user to update whatever is behind the selection menu, as you can't get the save option to show without actively changing the model yourself. If the model was checked upon opening then it would mean even if you deleted a model mid conversation (for whatever reason) then at least closing and reopening the application would solve it. For example, If you last configured AnythingLLM to be using model A, closed the app, uninstalled model A, and then reopened AnythingLLM, it would currently just throw errors at you, even if in the settings page it showed that model B was selected. In order to be able to use the app with model B you would need to select and save model C, then select and save model B. My suggestion would be - when connecting to Ollama, if the model that you have saved for use (in my above example, model A) isn't present anymore, then you need to set the model to the same one as shows up in the dropdown menu (in this case model B, or I think it's just the top of the list alphabetically). Otherwise the error is very unintuitive to solve since restarting both apps doesn't help here, and you would need to actively reconfigure and then revert the settings in the app to solve it.
yindo changed title from [BUG]: Model used isn't updated until save (which doesn't always appear) is explicitly pressed to [GH-ISSUE #1339] [BUG]: Model used isn't updated until save (which doesn't always appear) is explicitly pressed 2026-06-05 14:37:32 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#847