Unable to install on Drupal CMS

Created on 26 January 2025, 27 days ago

Problem/Motivation

I get an error here:
https://drupal-cms-dev.ddev.site/admin/config/ai/explorers/chat_generato...

Which, is stopping me from accessing Ollama:

Error message
Failed to get models from Ollama: cURL error 7: Failed to connect to 127.0.0.1 port 11434 after 0 ms: Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://127.0.0.1:11434/api/tags

I can see the tags here:
http://127.0.0.1:11434/api/tags

{"models":[{"name":"incept5/llama3.1-claude:latest","model":"incept5/llama3.1-claude:latest","modified_at":"2025-01-26T17:47:56.441035889-05:00","size":4661237026,"digest":"4ba850d59c62aec94b7725677b98342e84dc2d450a4ffa42e7b3ff60c16a729f","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"8.0B","quantization_level":"Q4_0"}},{"name":"mistral:latest","model":"mistral:latest","modified_at":"2025-01-26T17:18:44.790634138-05:00","size":4113301824,"digest":"f974a74358d62a017b37c6f424fcdf2744ca02926c4f952513ddf474b2fa5091","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"7.2B","quantization_level":"Q4_0"}},{"name":"llama3.1:latest","model":"llama3.1:latest","modified_at":"2025-01-26T17:15:34.571773888-05:00","size":4920753328,"digest":"46e0c10c039e019119339687c3c1757cc81b9da49709a3b3924863ba87ca666e","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"8.0B","quantization_level":"Q4_K_M"}},{"name":"llama3:latest","model":"llama3:latest","modified_at":"2025-01-25T17:29:00.52193826-05:00","size":4661224676,"digest":"365c0bd3c000a25d28ddbf732fe1c6add414de7275464c4e4d1c3b5fcb5d8ad1","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"8.0B","quantization_level":"Q4_0"}}]}

Steps to reproduce

I installed the Ollama, worked to make sure I could access the access point.

Then installed the Ollama module and configured it.

Proposed resolution

Remaining tasks

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada mgifford Ottawa, Ontario

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mgifford
  • πŸ‡¨πŸ‡¦Canada mgifford Ottawa, Ontario
  • πŸ‡©πŸ‡ͺ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.

Production build 0.71.5 2024