[GH-ISSUE #261] api: make host configurable #111

Closed
opened 2026-04-12 09:38:57 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @bmizerany on GitHub (Aug 2, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/261

I'd like to run ollama serve somewhere other than where I am running my client. I'd like to propose a OLLAMA_HOST environment variable which is picked up by api.NewClient if no other hosts are specified in the hosts param.

I have a patch locally I'm happy to convert to a PR if anyone thinks this has legs the team is open to it.

Originally created by @bmizerany on GitHub (Aug 2, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/261 I'd like to run `ollama serve` somewhere other than where I am running my client. I'd like to propose a `OLLAMA_HOST` environment variable which is picked up by `api.NewClient` if no other hosts are specified in the `hosts` param. I have a patch locally I'm happy to convert to a PR if anyone thinks this has legs the team is open to it.
GiteaMirror added the feature request label 2026-04-12 09:38:57 -05:00
Author
Owner

@mxyng commented on GitHub (Aug 2, 2023):

This is already possible through OLLAMA_HOST and OLLAMA_PORT when starting the server. The server can be access with any HTTP client on this separate host/port but the client only uses 127.0.0.1:11434 (for now)

<!-- gh-comment-id:1662975870 --> @mxyng commented on GitHub (Aug 2, 2023): This is already possible through `OLLAMA_HOST` and `OLLAMA_PORT` when starting the server. The server can be access with any HTTP client on this separate host/port but the client only uses `127.0.0.1:11434` (for now)
Author
Owner

@bmizerany commented on GitHub (Aug 2, 2023):

but the client only uses 127.0.0.1:11434

I'm proposing changing it so that clients (including the CLI) can access an Ollama server running on a remote server, and by way of setting OLLAMA_HOST=https://example.com. Would a change like that be welcome?

<!-- gh-comment-id:1663019019 --> @bmizerany commented on GitHub (Aug 2, 2023): > but the client only uses 127.0.0.1:11434 I'm proposing changing it so that clients (including the CLI) can access an Ollama server running on a remote server, and by way of setting `OLLAMA_HOST=https://example.com`. Would a change like that be welcome?
Author
Owner

@bmizerany commented on GitHub (Aug 2, 2023):

Maybe keeping OLLAMA_HOST/POST for ollama serve and clients can honor a OLLAMA_BASE_URL=https://example.com?

<!-- gh-comment-id:1663025544 --> @bmizerany commented on GitHub (Aug 2, 2023): Maybe keeping `OLLAMA_HOST/POST` for `ollama serve` and clients can honor a `OLLAMA_BASE_URL=https://example.com`?
Author
Owner

@pdevine commented on GitHub (Aug 2, 2023):

maybe OLLAMA_CLIENT_HOST just to be explicit? I like the change though.

<!-- gh-comment-id:1663032418 --> @pdevine commented on GitHub (Aug 2, 2023): maybe `OLLAMA_CLIENT_HOST` just to be explicit? I like the change though.
Author
Owner

@bmizerany commented on GitHub (Aug 2, 2023):

@pdevine SGTM. I'll send a PR.

<!-- gh-comment-id:1663032813 --> @bmizerany commented on GitHub (Aug 2, 2023): @pdevine SGTM. I'll send a PR.
Author
Owner

@bmizerany commented on GitHub (Aug 2, 2023):

PR up https://github.com/jmorganca/ollama/pull/262

<!-- gh-comment-id:1663036857 --> @bmizerany commented on GitHub (Aug 2, 2023): PR up https://github.com/jmorganca/ollama/pull/262
Author
Owner

@jmorganca commented on GitHub (Aug 23, 2023):

Closed by #262

<!-- gh-comment-id:1690388567 --> @jmorganca commented on GitHub (Aug 23, 2023): Closed by #262
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#111