[GH-ISSUE #2199] Go API client: make base URL and http client public fields #47768

Closed
opened 2026-04-28 05:16:48 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @emidoots on GitHub (Jan 26, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2199

It would be nice if these were public fields:

https://github.com/ollama/ollama/blob/main/api/client.go#L23-L24

ClientFromEnvironment is good, but there are cases where supplying one's own http client, transparent, etc. may be quite useful. It's strange to not be able to supply these in a client library.

Just thought I'd leave this feedback here, feel free to close if not helpful :)

Originally created by @emidoots on GitHub (Jan 26, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2199 It would be nice if these were public fields: https://github.com/ollama/ollama/blob/main/api/client.go#L23-L24 `ClientFromEnvironment` is good, but there are cases where supplying one's own http client, transparent, etc. may be quite useful. It's strange to not be able to supply these in a client library. Just thought I'd leave this feedback here, feel free to close if not helpful :)
GiteaMirror added the feature request label 2026-04-28 05:16:48 -05:00
Author
Owner

@mxyng commented on GitHub (Mar 11, 2024):

The Go client is intended to be used for the CLI and not really intended for public use. If/when Ollama launches an official Go API client, these will definitely things to consider

<!-- gh-comment-id:1989197158 --> @mxyng commented on GitHub (Mar 11, 2024): The Go client is intended to be used for the CLI and not really intended for public use. If/when Ollama launches an official Go API client, these will definitely things to consider
Author
Owner

@pdevine commented on GitHub (May 17, 2024):

Hey @slimsag you can use NewClient() and pass in your own base and http variables. Sorry for the long delay in responding!

<!-- gh-comment-id:2116456408 --> @pdevine commented on GitHub (May 17, 2024): Hey @slimsag you can use `NewClient()` and pass in your own `base` and `http` variables. Sorry for the long delay in responding!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#47768