[PR #562] [MERGED] fix OLLAMA_HOST parsing for ip6 #15493

Closed
opened 2026-04-16 05:00:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/562
Author: @mxyng
Created: 9/21/2023
Status: Merged
Merged: 9/21/2023
Merged by: @mxyng

Base: mainHead: mxyng/fix-ollama-host


📝 Commits (1)

  • 9297ff8 fix OLLAMA_HOST parsing for ip6

📊 Changes

1 file changed (+8 additions, -17 deletions)

View changed files

📝 cmd/cmd.go (+8 -17)

📄 Description

Fix the environment parsing for OLLAMA_HOST so it can recognize ipv6 addresses, e.g. ipv6 loopback [::1]:11434

Some examples:

Default

$ OLLAMA_HOST='' ollama serve
2023/09/20 17:55:23 routes.go:540: Listening on 127.0.0.1:11434

IPv6 loopback

$ OLLAMA_HOST='[::1]:11434' ollama serve
2023/09/20 17:58:08 routes.go:540: Listening on [::1]:11434

Random port (any IPv4 & IPv6 address)

$ OLLAMA_HOST=':0' ollama serve
2023/09/20 17:58:26 routes.go:540: Listening on [::]:63574

Only IPv4

$ OLLAMA_HOST='127.0.0.1:12345' ollama serve
2023/09/20 17:58:37 routes.go:540: Listening on 127.0.0.1:12345

Only IPv6

$ OLLAMA_HOST='[::1]:12345' ollama serve
2023/09/20 17:59:23 routes.go:540: Listening on [::1]:12345

Only setting the address

$ OLLAMA_HOST='0.0.0.0' ollama serve
2023/09/20 18:54:18 routes.go:540: Listening on [::]:11434

It also removes OLLAMA_PORT

Resolves #560


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/562 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 9/21/2023 **Status:** ✅ Merged **Merged:** 9/21/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/fix-ollama-host` --- ### 📝 Commits (1) - [`9297ff8`](https://github.com/ollama/ollama/commit/9297ff8330381e0e1e42db3af2e674413a33ba37) fix OLLAMA_HOST parsing for ip6 ### 📊 Changes **1 file changed** (+8 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+8 -17) </details> ### 📄 Description Fix the environment parsing for `OLLAMA_HOST` so it can recognize ipv6 addresses, e.g. ipv6 loopback `[::1]:11434` Some examples: Default ``` $ OLLAMA_HOST='' ollama serve 2023/09/20 17:55:23 routes.go:540: Listening on 127.0.0.1:11434 ``` IPv6 loopback ``` $ OLLAMA_HOST='[::1]:11434' ollama serve 2023/09/20 17:58:08 routes.go:540: Listening on [::1]:11434 ``` Random port (any IPv4 & IPv6 address) ``` $ OLLAMA_HOST=':0' ollama serve 2023/09/20 17:58:26 routes.go:540: Listening on [::]:63574 ``` Only IPv4 ``` $ OLLAMA_HOST='127.0.0.1:12345' ollama serve 2023/09/20 17:58:37 routes.go:540: Listening on 127.0.0.1:12345 ``` Only IPv6 ``` $ OLLAMA_HOST='[::1]:12345' ollama serve 2023/09/20 17:59:23 routes.go:540: Listening on [::1]:12345 ``` Only setting the address ``` $ OLLAMA_HOST='0.0.0.0' ollama serve 2023/09/20 18:54:18 routes.go:540: Listening on [::]:11434 ``` It also removes `OLLAMA_PORT` Resolves #560 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 05:00:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#15493