[GH-ISSUE #2948] Allow api.Client to be constructed using URL & http.Client #63848

Closed
opened 2026-05-03 15:11:38 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @jackielii on GitHub (Mar 6, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2948

I'm using github.com/jmorganca/ollama/api to connect to Ollama in my Go project. It works great. But I run two instance of ollama via different URL & port. At the moment the api package only supports construct client from env:

func ClientFromEnvironment() (*Client, error) {}

I have to use hacks like SetEnv to construct 2 clients.

Proposal: add a new method that takes url and http.client as parameters

Originally created by @jackielii on GitHub (Mar 6, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2948 I'm using `github.com/jmorganca/ollama/api` to connect to Ollama in my Go project. It works great. But I run two instance of ollama via different URL & port. At the moment the `api` package only supports construct client from env: ```go func ClientFromEnvironment() (*Client, error) {} ``` I have to use hacks like SetEnv to construct 2 clients. Proposal: add a new method that takes `url` and `http.client` as parameters
GiteaMirror added the good first issuefeature request labels 2026-05-03 15:11:38 -05:00
Author
Owner

@jackielii commented on GitHub (May 7, 2024):

this is already fixed as #2949 is closed

<!-- gh-comment-id:2097687401 --> @jackielii commented on GitHub (May 7, 2024): this is already fixed as #2949 is closed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#63848