- Issue created by @mgifford
- π©πͺGermany marcus_johansson
hi mgifford - if you use ddev you should try with ttp://host.docker.internal as the host. 127.0.0.1 is the local machine and in this case I'm guessing you have installed Ollama on your laptop, not the ddev web container?
This is documented in the setup process:
However we should have better validation here, so you can not setup a broken connection, I create issue π Make validation better on setup Active and will give you credits on it.
- π©πͺGermany marcus_johansson
Oh, to clarify since I moved this to a support request - if you truly have the Ollama instance installed on the ddev web container, please set this back to a bug report, since something is wrong with the module then.
- πΊπΈUnited States rtdean93
@marcus - I am running Ollama locally and can access it via http://127.0.0.1:11434/
My Drupal instance is running via DDEV. (Orbstack)
However - http://host.docker.internal is not listing models so I cannot chose which model to use for the defualt models.
- πΊπΈUnited States rtdean93
Disregard my previous comment. I changed computers, and this is working. Seems my other laptop had a firewall on port 11434. This is working as expected.
- π©πͺGermany marcus_johansson
With this being fixed [# https://www.drupal.org/project/ai_provider_ollama/issues/3502452] β , I think we can close this?
- π¨π¦Canada mgifford Ottawa, Ontario
Sorry, looking at this again @marcus_johansson
I'm not clear if I need to install something like this:
https://github.com/stinis87/ddev-ollamaI have ollama running
I can access it via http://localhost:11434 but not when I use
dev ssh
to login to the ddev instance. However, from within ddev I can access http://host.docker.internalI have a number of models that are listed with http://localhost:11434/api/tags or from within ddev http://host.docker.internal/api/tags but I can't see any default models
I'm not getting an error message, but I'm also not getting any tips as to why I can't see any Default Models to choose from after I have selected a Default Provider. in the /admin/config/ai/settings of Drupal.
- πΊπΈUnited States heatherwoz Seattle
I got it to work by using http://ollama as the hostname (and that ddev add-on)
- πΊπΈUnited States afinnarn
I was fooled by this too and then remembered I'm using ddev inside Docker, d'oh!
Using "http://host.docker.internal" works for me, but if I accidentally add a space at the end, it fails to concatenate the port. Not sure if that is worth an issue or not...
As far as the help text, when I saw "The host name for the API, including protocol, typically http://127.0.0.1 on a server. Use http://host.docker.internal for DDEV, see AI documentation." I thought, "well, I am not running Ollama in Docker so I should ignore this text."
Maybe the text should be...well, I tried several revisions and am not sure how to improve it without making the help text really verbose, which could screw things up more.
What if you just put default config of "http://host.docker.internal" for host and "11434" for the port? That would have auto-magically worked for me and probably 90+% of users. Then, the error message would point you to change to another host. I think it is worth trying, and if it causes issue, then people will file tickets.
My main brain fart was seeing the error referencing "http://127.0.0.1:11434/api/tags", correctly loading that in Chrome, and then diving into logs/Xdebug/ect before getting to this issue.
- πΊπΈUnited States kevinquillen
For DDEV and typical Docker based services, the service name is enough (Docker will resolve this behind the scenes).
http://ollama
will work - similar to running Solr in DDEV.