Closed meonkeys closed 1 year ago
Thanks for the detailed issue, @meonkeys, and for testing this out! I was actually able to reproduce the error in my local machine without docker as well. This has to do with the way GPT4All loads models. Here it goes out to see supported models and downloads one that it finds matching the spec. In our case, we don't actually need this; we should be able to configure it using the allow_download
parameter. I'll push a fix for the issue.
This should be addressed with https://github.com/khoj-ai/khoj/commit/f9e09ba49006cdfabbdec9b24459931da78ffc67
If you want to try out the fix, get the latest image with docker image pull ghcr.io/khoj-ai/khoj:latest
. Let me know if there are any other issues!
Awesome! Works for me.
I install and start khoj in a Docker container with full network access. I persist the container's
/root
folder on the Docker host using a volume. I enable Offline Chat and it downloads llama, creating/root/.cache/gpt4all/llama-2-7b-chat.ggmlv3.q4_K_S.bin
. The Chat feature works, and guessing by the CPU usage, it is running locally.To confirm I'm offline, I turn off my network. Chat still works. Yay!
Now I try destroying the Docker container and creating a new one, again mounting the data preserved in
/root
. Now the Chat page says I need to set my OpenAI key or enable a local LLM. The Settings page indicates Offline Chat is still enabled, though. Why did Chat stop working? Is data persisted somewhere other than/root
? Is there some check that happens when khoj starts up that prevents it from trying offline Chat?Does this happen for non-Docker installs, too?
If I then destroy the container, turn on my network, and start a new container (same image, same
/root
data mounted) Chat works again. No changes to config, I don't have to re-download llama. The only change is whether or not network is available on startup.Here's my (original, work-in-progress, non-optimized)
Dockerfile
:Here's
requirements.txt
:I'm building my Docker image like so:
I'm starting my container like so:
I'm destroying the container with Ctrl-c.
Here's
/root/.khoj/khoj.yml
: