[GH-ISSUE #560] Is IPv6 supported? #255

Closed
opened 2026-04-12 09:46:50 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @jamesbraza on GitHub (Sep 20, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/560

With the Ollama server running:

> curl -X POST --header 'Content-Type: application/json' "http://[::1]:11434/api/generate" -d '{
  "model": "llama2:13b",
  "prompt": "Your first prompt goes here"
}'
curl: (7) Failed to connect to ::1 port 11434 after 5 ms: Couldn't connect to server

I am wondering, is IPv6 supported with Ollama server?

Originally created by @jamesbraza on GitHub (Sep 20, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/560 With the Ollama server running: ```bash > curl -X POST --header 'Content-Type: application/json' "http://[::1]:11434/api/generate" -d '{ "model": "llama2:13b", "prompt": "Your first prompt goes here" }' curl: (7) Failed to connect to ::1 port 11434 after 5 ms: Couldn't connect to server ``` I am wondering, is IPv6 supported with Ollama server?
Author
Owner

@mxyng commented on GitHub (Sep 21, 2023):

Ollama listens on 127.0.0.1 by default so IPv6 requires setting OLLAMA_HOST to either any address e.g. :11434 or explicitly IPv6 e.g. [::1]:11434. There's a bug with the latter which is fixed in the linked PR

<!-- gh-comment-id:1728615348 --> @mxyng commented on GitHub (Sep 21, 2023): Ollama listens on 127.0.0.1 by default so IPv6 requires setting `OLLAMA_HOST` to either any address e.g. `:11434` or explicitly IPv6 e.g. `[::1]:11434`. There's a bug with the latter which is fixed in the linked PR
Author
Owner

@jamesbraza commented on GitHub (Sep 21, 2023):

Thank you @mxyng ! Appreciated.

One note is to get this to work, I had to rebuild ./ollama with go generate ./... && go build ..

> export OLLAMA_HOST=":11434"
> ./ollama serve
...
2023/09/20 23:13:20 routes.go:540: Listening on [::]:11434
<!-- gh-comment-id:1728914041 --> @jamesbraza commented on GitHub (Sep 21, 2023): Thank you @mxyng ! Appreciated. One note is to get this to work, I had to rebuild `./ollama` with `go generate ./... && go build .`. ```bash > export OLLAMA_HOST=":11434" > ./ollama serve ... 2023/09/20 23:13:20 routes.go:540: Listening on [::]:11434 ```
Author
Owner

@mxyng commented on GitHub (Sep 21, 2023):

Yes, you'll need to pull main and rebuild right now but it'll be part of the next release

<!-- gh-comment-id:1729913297 --> @mxyng commented on GitHub (Sep 21, 2023): Yes, you'll need to pull main and rebuild right now but it'll be part of the next release
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#255