N8n ollama (or maybe just http + server) issues

The following curl code works when I type it into my raspberry pi terminal, however when I try and run the exact same curl copied into an n8n http request node it says:

The service refused the connection - perhaps it is offline

n8n is running on docker on the exact same raspberry pi!

curl http://localhost:11434/api/generate -d '{
  "model": "tinyllama",
  "prompt": "Please give me some wise words i don't know why you're not working",
  "stream": false
}'

I also tried using rpi.local:11434 as the base URL - which works on my mac terminal - but still not in the n8n node which comes out with the same error.

What URL can I use???

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

are you running n8n in docker?

Yes it’s running in docker

and which operating system?

This is why the Information on your n8n setup section exists when you create a new post. If you fill out the details when creating a post, it saves everyone time in the long run.

either way, the issue is that docker containers run in their own network by default, and localhost inside a container often means the container, and not the host machine.
can you please try this.

can you please also try http://host.docker.internal:11434

1 Like

I’ve tried the docker ip address by following the other guy’s instructions and it didn’t work

i tried http://ollama:11434 but it didn’t work but that may be because ollama is not on docker??
Both have the same issue

n8n is running on docker on raspberry pi
ollama is not on docker and is on the raspberry pi

Ah! I fixed it,
The base URL was the IP of my rpi

i found it using hostname -I and wrote the first option in

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.