goose icon indicating copy to clipboard operation
goose copied to clipboard

How to access remote Ollama server domain

Open clickbrain opened this issue 9 months ago • 4 comments

I have ollama hosted on a Mac Studio and have a domain mapped to the Ollama URL on that server: https://ollama.mydomain.com. Unfortunately, it looks like Goose adds :11434/v1/chat/completions to the end of whatever host a user puts into the Ollama setup field. Is there anyway to make sure it doesn't do that and just maps to the endpoint of the URL I provided?

I am assuming that is why I am getting the "Ran into this error: Execution error: error sending request for url" message, because I have Qwen 2.5 in Ollama on the remote server.

clickbrain avatar Mar 13 '25 17:03 clickbrain

Would it be possible to set up a reverse proxy? Like

server {
    listen 443 ssl;
    server_name ollama.mydomain.com;

    location / {
        proxy_pass http://127.0.0.1:11434;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

wendytang avatar Mar 14 '25 21:03 wendytang

maybe adding the :80 port is enough for goose to not do that ?

cbruyndoncx avatar Mar 15 '25 11:03 cbruyndoncx

I'm running into the same problem.

I have Ollama running on https://ollama.mydomain.com.

When I entered this URL in Goose (Desktop), it would try to access it on port 11434 instead of 443. After some effort, I added the url with the :443 port and now I get this error:

Ran into this error: Execution error: error sending request for url (https://ollama.mydomain.com/v1/chat/completions).

When I click on this link, it goes to the browser and this URL does not exist.

I looked into the Ollama API documentation at https://github.com/ollama/ollama/blob/main/docs/api.md and there all URL's begin with /api/ and there is nothing that ends with /chat/completions or /completions

Also I noticed that if I change the URL within Goose, I always have to Quit and Restart Goose before it takes effect.

Richie765 avatar Apr 14 '25 13:04 Richie765

Just to add to this defining the port ollama host did override the 11434 default ok for me, thanks! I'm using the open-webui chart which deploys an ollama sub chart as well accessible in k8s cluster via ingress.

🟢

$ goose configure

Welcome to goose! Let's get you set up with a provider.
  you can rerun this command later to update your configuration

┌   goose-configure 
│
◇  Which model provider should we use?
│  Ollama 
│
◇  Provider Ollama requires OLLAMA_HOST, please enter a value
│  https://ollama.somecooldomain.lan:443
│
◇  Model fetch complete
│
◇  Enter a model from that provider:
│  devstral:latest
│
◓  Checking your configuration...                                                                                                                                                       
└  Configuration saved successfully

  Tip: Run 'goose configure' again to adjust your config or add extensions

NerdyShawn avatar May 26 '25 15:05 NerdyShawn

So we should default to 443 if we have a fully qualified url?

DOsinga avatar Aug 02 '25 21:08 DOsinga

I'd say, default port for http is 80, for https it is 443. This is just the standard and everybody knows it. If you need another port you specify it.

Richie765 avatar Aug 04 '25 16:08 Richie765

if custom providers are fully functional, this is a good test case ...

cbruyndoncx avatar Sep 05 '25 12:09 cbruyndoncx

we have custom providers now! give it a whirl!

DOsinga avatar Sep 29 '25 21:09 DOsinga