Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS 404 reply with both Ollama and Chatgpt #949

Open
johanlantz opened this issue Jan 30, 2025 · 25 comments · May be fixed by #985
Open

MacOS 404 reply with both Ollama and Chatgpt #949

johanlantz opened this issue Jan 30, 2025 · 25 comments · May be fixed by #985
Assignees
Labels
bug Something isn't working ui

Comments

@johanlantz
Copy link

johanlantz commented Jan 30, 2025

Describe the bug
I have Ollama running serving Qwen2.5. I can access it on localhost:11434 and Goose also finds it and can list the models and I can select Qwen2.5.

However, Goose then sends the requests to:
/v1/chat/completions

for which Ollama returns a 404.

I believe the Ollama API is not mimicing the chatgpt one anymore but expects calls on /api/chat instead, or must I do something on my end to make the /v1/chat/completions available in Ollama?

The stranger thing is that also after adding my ChatGPT API key and switched to gpt-4o, I also get a 404 response trying to use OpenAI, but it says it successfully switched to gpt-4o.

To Reproduce

Expected behavior
No 404

Screenshots

Image

Please provide following information:

  • MacOS Sequioa, Ollama 0.5.7
  • Interface: UI
  • Version: 1.0.0
  • Extensions enabled: [e.g. Computer Controller, Figma]
  • Provider & Model: Qwen2.5 and gpt-4o

Additional context

ollama serve
2025/01/30 19:34:00 routes.go:1187: INFO server config env="map[HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/Users/johan/.ollama/models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://*] OLLAMA_SCHED_SPREAD:false http_proxy: https_proxy: no_proxy:]"
time=2025-01-30T19:34:00.878+01:00 level=INFO source=images.go:432 msg="total blobs: 5"
time=2025-01-30T19:34:00.879+01:00 level=INFO source=images.go:439 msg="total unused blobs removed: 0"
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] POST   /api/pull                 --> github.com/ollama/ollama/server.(*Server).PullHandler-fm (5 handlers)
[GIN-debug] POST   /api/generate             --> github.com/ollama/ollama/server.(*Server).GenerateHandler-fm (5 handlers)
[GIN-debug] POST   /api/chat                 --> github.com/ollama/ollama/server.(*Server).ChatHandler-fm (5 handlers)
[GIN-debug] POST   /api/embed                --> github.com/ollama/ollama/server.(*Server).EmbedHandler-fm (5 handlers)
[GIN-debug] POST   /api/embeddings           --> github.com/ollama/ollama/server.(*Server).EmbeddingsHandler-fm (5 handlers)
[GIN-debug] POST   /api/create               --> github.com/ollama/ollama/server.(*Server).CreateHandler-fm (5 handlers)
[GIN-debug] POST   /api/push                 --> github.com/ollama/ollama/server.(*Server).PushHandler-fm (5 handlers)
[GIN-debug] POST   /api/copy                 --> github.com/ollama/ollama/server.(*Server).CopyHandler-fm (5 handlers)
[GIN-debug] DELETE /api/delete               --> github.com/ollama/ollama/server.(*Server).DeleteHandler-fm (5 handlers)
[GIN-debug] POST   /api/show                 --> github.com/ollama/ollama/server.(*Server).ShowHandler-fm (5 handlers)
[GIN-debug] POST   /api/blobs/:digest        --> github.com/ollama/ollama/server.(*Server).CreateBlobHandler-fm (5 handlers)
[GIN-debug] HEAD   /api/blobs/:digest        --> github.com/ollama/ollama/server.(*Server).HeadBlobHandler-fm (5 handlers)
[GIN-debug] GET    /api/ps                   --> github.com/ollama/ollama/server.(*Server).PsHandler-fm (5 handlers)
[GIN-debug] POST   /v1/chat/completions      --> github.com/ollama/ollama/server.(*Server).ChatHandler-fm (6 handlers)
[GIN-debug] POST   /v1/completions           --> github.com/ollama/ollama/server.(*Server).GenerateHandler-fm (6 handlers)
[GIN-debug] POST   /v1/embeddings            --> github.com/ollama/ollama/server.(*Server).EmbedHandler-fm (6 handlers)
[GIN-debug] GET    /v1/models                --> github.com/ollama/ollama/server.(*Server).ListHandler-fm (6 handlers)
[GIN-debug] GET    /v1/models/:model         --> github.com/ollama/ollama/server.(*Server).ShowHandler-fm (6 handlers)
[GIN-debug] GET    /                         --> github.com/ollama/ollama/server.(*Server).GenerateRoutes.func1 (5 handlers)
[GIN-debug] GET    /api/tags                 --> github.com/ollama/ollama/server.(*Server).ListHandler-fm (5 handlers)
[GIN-debug] GET    /api/version              --> github.com/ollama/ollama/server.(*Server).GenerateRoutes.func2 (5 handlers)
[GIN-debug] HEAD   /                         --> github.com/ollama/ollama/server.(*Server).GenerateRoutes.func1 (5 handlers)
[GIN-debug] HEAD   /api/tags                 --> github.com/ollama/ollama/server.(*Server).ListHandler-fm (5 handlers)
[GIN-debug] HEAD   /api/version              --> github.com/ollama/ollama/server.(*Server).GenerateRoutes.func2 (5 handlers)
time=2025-01-30T19:34:00.879+01:00 level=INFO source=routes.go:1238 msg="Listening on 127.0.0.1:11434 (version 0.5.7)"
time=2025-01-30T19:34:00.879+01:00 level=INFO source=routes.go:1267 msg="Dynamic LLM libraries" runners=[metal]
time=2025-01-30T19:34:00.930+01:00 level=INFO source=types.go:131 msg="inference compute" id=0 library=metal variant="" compute="" driver=0.0 name="" total="27.0 GiB" available="27.0 GiB"
[GIN] 2025/01/30 - 19:34:19 | 404 |    3.302083ms |       127.0.0.1 | POST     "/v1/chat/completions"
[GIN] 2025/01/30 - 19:34:19 | 404 |     756.334µs |       127.0.0.1 | POST     "/v1/chat/completions"
[GIN] 2025/01/30 - 19:34:19 | 404 |     1.45025ms |       127.0.0.1 | POST     "/v1/chat/completions"
[GIN] 2025/01/30 - 19:34:19 | 404 |     805.292µs |       127.0.0.1 | POST     "/v1/chat/completions"
[GIN] 2025/01/30 - 19:34:19 | 404 |    2.177584ms |       127.0.0.1 | POST     "/v1/chat/completions"
[GIN] 2025/01/30 - 19:42:02 | 200 |        29.5µs |       127.0.0.1 | GET      "/api/version"
[GIN] 2025/01/30 - 19:42:51 | 200 |      23.542µs |       127.0.0.1 | HEAD     "/"
[GIN] 2025/01/30 - 19:42:51 | 200 |      62.584µs |       127.0.0.1 | GET      "/api/ps"

@kevinjam
Copy link

This issue is affect also m1 with sequoia 15.1 , please can we look into this ?

@johanlantz johanlantz changed the title MacOS 404 replt with both Ollama and Chatgpt MacOS 404 reply with both Ollama and Chatgpt Jan 30, 2025
@salman1993
Copy link
Collaborator

salman1993 commented Jan 30, 2025

can you toggle the developer tools and check if anything shows up in the console logs? please let us know. you can also try reconfiguring the provider (fresh launch screen of goose to configure the provider)

Image

@salman1993 salman1993 added the help wanted Extra attention is needed label Jan 30, 2025
@johanlantz
Copy link
Author

Console output below:

Image

@thesoulpole
Copy link

I have the same problem- attempting to use any ollama model produces the above 404 messages...

@Badhansen
Copy link

Ran into this error: Request failed: Request failed with status: 400 Bad Request.

Please retry if you think this is a transient or recoverable error.

I am experiencing the same issue; I keep receiving a 404 bad request message.

Image

@salman1993
Copy link
Collaborator

we just released a new version: https://github.com/block/goose/releases/download/stable/Goose.zip

can you please retry and see if that works for you?

@salman1993 salman1993 added bug Something isn't working ui and removed help wanted Extra attention is needed labels Jan 31, 2025
@xkrogen
Copy link

xkrogen commented Jan 31, 2025

Just downloaded the version you shared @salman1993 (1.0.3) and still seeing the same issue with Ollama:

Image

@Badhansen
Copy link

we just released a new version: https://github.com/block/goose/releases/download/stable/Goose.zip

can you please retry and see if that works for you?

Hello! @salman1993 now facing a different issue with this version

Ran into this error: Execution error: builder error.

Please retry if you think this is a transient or recoverable error.

Image

@rgasper
Copy link

rgasper commented Jan 31, 2025

New user, I just installed Goose on Mac OS 15.2 a few minutes ago, tried to get it to talk to ollama serve - running into the same exact error message as @Badhansen running trying to run either michaelneale/deepseek-r1-goose or qwen2.5.

@yingjiehe-xyz
Copy link
Collaborator

Thanks for reporting, let me check it

@yingjiehe-xyz
Copy link
Collaborator

yingjiehe-xyz commented Jan 31, 2025

Can you try to run cat ~/.config/goose/config.yaml to view the yaml file?

@DancingPotatoes
Copy link

DancingPotatoes commented Jan 31, 2025

I got the same issue I ran cat ~/.config/goose/config.yaml its the exact same ip in goose for ollama

"Ran into this error: Execution error: builder error.
Please retry if you think this is a transient or recoverable error."

@yingjiehe-xyz
Copy link
Collaborator

yingjiehe-xyz commented Jan 31, 2025

I got the same issue I ran cat ~/.config/goose/config.yaml its the exact same ip in goose for ollama

"Ran into this error: Execution error: builder error. Please retry if you think this is a transient or recoverable error."

Can you share your yaml? Would like to confirm what format ollama host looks like? Also, can you try to restart mac to see whether the issue is resolved?

I am still debugging it and find restarting mac can be a walkaround

@DancingPotatoes
Copy link

DancingPotatoes commented Jan 31, 2025

sure this is what's inside the yaml "OLLAMA_HOST: 127.0.0.1:11434"

I restarted same issue

@yingjiehe-xyz
Copy link
Collaborator

sure this is what's inside the yaml "OLLAMA_HOST: 127.0.0.1:11434"

I restarted same issue

Can you try to set your host to "http://127.0.0.1:11434"(adding http:// prefix)

@DancingPotatoes
Copy link

I did try same issue

@yingjiehe-xyz
Copy link
Collaborator

yingjiehe-xyz commented Jan 31, 2025

Are you using UI? If so, can you click Reset Provider and start a new window after you update the host name?

Image

@DancingPotatoes
Copy link

I am not sure what you meant but I clicked Reset Provider and it started a new window the ollama key is already there and I can't change it I can only change it from configure and also when I close the window and open a new one after clicking Reset Provider same issue

@yingjiehe-xyz
Copy link
Collaborator

Thanks, I will continue debug on our side, to unblock you, can you try the previous version: https://github.com/block/goose/releases/tag/v1.0.2

@thesoulpole
Copy link

Thanks, I will continue debug on our side, to unblock you, can you try the previous version: https://github.com/block/goose/releases/tag/v1.0.2

just fyi - I had the 404 message yestrerday after installing and using 1.0.0, so doubt that 1.0.2 will be a remedy...

@harikt
Copy link

harikt commented Jan 31, 2025

I had faced the same issue. I wonder whether the problem is with the model and without checking whether the model exists in the system.

Image

You can see the model added is qwen2.5 . But I don't have that model downloaded.

Image

These are the current models I have downloaded. One issue I noticed is when I switch to deepseek-r1:14b it is not working. qwen2.5:14b, qwen2.5-coder:14b is working.

FYI : My goose version is 1.0.3

@rgasper
Copy link

rgasper commented Jan 31, 2025

sure this is what's inside the yaml "OLLAMA_HOST: 127.0.0.1:11434"
I restarted same issue

Can you try to set your host to "[http://127.0.0.1:11434"(adding](http://127.0.0.1:11434%22(adding) http:// prefix)

Thanks, I will continue debug on our side, to unblock you, can you try the previous version: https://github.com/block/goose/releases/tag/v1.0.2

Thanks @yingjiehe-xyz, it took both suggestions in combination, but it's working

 ~  cat ~/.config/goose/config.yaml
OLLAMA_HOST: http://127.0.0.1:11434
 ~  ollama list
NAME                                     ID              SIZE      MODIFIED      
qwen2.5:latest                           845dbda0ea48    4.7 GB    5 minutes ago    
michaelneale/deepseek-r1-goose:latest    425664f4d998    9.0 GB    12 hours ago     
 ~  ps aux | grep ollama
raymondgasper    25890   0.0  0.0 410742592   1696 s011  S+    8:17AM   0:00.01 grep --color=auto ollama
raymondgasper     7382   0.0  0.1 411863504  35568   ??  S     8:09AM   0:44.23 /Applications/Ollama.app/Contents/Resources/ollama serve
 ~  

Goose is working w/ both models

@salman1993
Copy link
Collaborator

salman1993 commented Jan 31, 2025

The issue seems to be that Ollama sets the host to "0.0.0.0" without the http:// prefix but Goose looks for it (which is a bug we will fix). Goose's config system gives highest priority to env vars which it always finds for OLLAMA_HOST but can't construct the url properly in this case. The builder error is coming from reqwest library.

In the mean time, can try the following for goose v1.0.3:

On Mac:

launchctl setenv OLLAMA_HOST "http://localhost:11434"  # update to your different port 
launchctl getenv OLLAMA_HOST # verify

For Linux, it'll be similar but you'd have to update systemctl edit ollama.service, instructions here:
https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-linux

Then, you should restart Ollama and Goose. That should make it work. Please let us know if that works.

@thesoulpole
Copy link

thesoulpole commented Jan 31, 2025

no, still bad. I did the above launchctl setenv etc. Am on goose 1.0.3.
still getting error, now the build one. Worse, now it does not work with Gemini (1.5 or 2.0) either (the second error in the screenshot). Though perhaps with Gemini it really is overloaded, not a Goose error...
btw - Now downgraded to 1.0.2 and same thing.
Image

@jame25
Copy link

jame25 commented Jan 31, 2025

I had the same error on Windows using WSL2 (Ubuntu). The key issue is networking between WSL2 and your Windows host. Since I had Ollama running on the Windows host, and Goose running in WSL - I had to take measures to allow interaction between the two.

Find Windows host IP in WSL2:

cat /etc/resolv.conf | grep nameserver | awk '{print $2}'

Test the Ollama server running on Windows host:

curl http://172.27.*.1:11434
Ollama is running

By default, Ollama binds to 127.0.0.1 (localhost), which is only accessible within Windows. To allow connections from WSL2:

In Windows PowerShell (run as admin):

$env:OLLAMA_HOST="0.0.0.0:11434"
ollama serve

Configure Goose:

OLLAMA_HOST=http://172.27.*.1:11434
Model=michaelneale/deepseek-r1-goose

Optional: In powershell (run as admin):

Enable-NetFirewallRule -DisplayName 'Virtual Machine Monitoring (Echo Request - ICMPv4-In)'

Tip: If you still have an issue, disable VPN

@salman1993 salman1993 linked a pull request Jan 31, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ui
Projects
None yet
Development

Successfully merging a pull request may close this issue.