If a user never opens the Options page, then the default model is hardcoded to llama2. If llama2 isn't available, then no error is displayed and the app hangs when calling /api/generate (which returns a 404).
Solution: Set the default model to the first model returned from /api/tags and persist the model even if the user never visits the Options page. The API connectivity check logic is also refactored into a common function.
Summary
This PR resolves https://github.com/andrewnguonly/Lumos/issues/126.
If a user never opens the Options page, then the default model is hardcoded to
llama2
. Ifllama2
isn't available, then no error is displayed and the app hangs when calling/api/generate
(which returns a 404).Solution: Set the default model to the first model returned from
/api/tags
and persist the model even if the user never visits the Options page. The API connectivity check logic is also refactored into a common function.