Is "docker exec open-notebook-ollama-1 ollama pull ..." necessary if local host ollama exists and connectable? #1260
Replies: 2 comments
|
Answer it myself. My testing indicated that there was no need to pull Ollama models into a container if using Ollama models natively installed on the local host. |
|
Your conclusion is right, and it is worth writing down why, because there are two conditions that have to hold and they are easy to trip over later. The containerised ollama in The two conditions: First, ollama has to be listening on an address the container can reach. By default it binds to On macOS with the ollama app, this goes in Second, extra_hosts:
- "host.docker.internal:host-gateway"That makes the same One thing you get for free by going this route: models pulled on the host are shared with every other tool on your machine rather than living in a container volume that only open-notebook can see. If you already run ollama for other things, the containerised copy would have been a second full set of weights on disk, which for anything in the 7B and up range is the bulk of the space you were asking about. |
Uh oh!
There was an error while loading. Please reload this page.
I have local host ollama and models installed and running prior to using open-notebook. Setting up open-notebook, I notice that
https://github.com/lfnovo/open-notebook/blob/main/examples/docker-compose-full-local.ymlsuggests pulling and running ollama and models in a Docker containeropen-notebook-ollama-1. However, configuring Ollama and local models in the UI page athttp://localhost:8502/allows me to connect to the local host Ollama and models externally viahttp://host.docker.internal:11434. I successfully configured this external connection on the page athttp://localhost:8502/settings/api-keys. So, this leads to my question here. I would remove ollama and models from the Docker container to save space if it is not necessary given the said context.All reactions