goose: MacOS 404 reply with both Ollama and Chatgpt
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
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"
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 27
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
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)
This issue is affect also m1 with sequoia 15.1 , please can we look into this ?