[GH-ISSUE #2380] Ollama is unstable recently #63420

Closed
opened 2026-05-03 13:26:02 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @lestan on GitHub (Feb 7, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2380

As of at least the last two recent versions, I have been experiencing a lot of issues with Ollama. Primarily, it seems to report that it can't connect to the server when using the Ollama CLI commands, even though the server is running and I can curl it. Also when using the Ollama Python SDK, I often get a Connection Refused error, but retrying will eventually connect. I can't explain it.

I ran the following commands in succession. Ollama is launched via the Mac app (not command line) after killing it and no models have been loaded yet.

lestan@Lestans-MacBook-Pro ~ % ollama list
Error: could not connect to ollama app, is it running?

lestan@Lestans-MacBook-Pro ~ % curl http://localhost:11434/api/tags
{"models":[{"name":"mixtral:latest","model":"mixtral:latest","modified_at":"2024-01-15T16:11:18.289940736-06:00","size":26442481545,"digest":"7708c059a8bb4d950e5e679aef904fd4da96aa4d551a5cd14a7f7e2308a82f6d","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"47B","quantization_level":"Q4_0"}},{"name":"nous-hermes2-mixtral:latest","model":"nous-hermes2-mixtral:latest","modified_at":"2024-01-15T22:13:37.546667086-06:00","size":26442493141,"digest":"599da8dce2c14e54737c51f9668961bbc3526674249d3850b0875638a3e5e268","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"47B","quantization_level":"Q4_0"}},{"name":"orca2:latest","model":"orca2:latest","modified_at":"2023-12-22T19:44:49.948456023-06:00","size":3825836233,"digest":"ea98cc422de301a0714ee18d077d5c4ba4fd02f889234944bb2f45618fd5d5f7","details":{"parent_model":"","format":"gguf","family":"llama","families":null,"parameter_size":"7B","quantization_level":"Q4_0"}},{"name":"phi:latest","model":"phi:latest","modified_at":"2023-12-28T21:03:25.568996781-06:00","size":1602472424,"digest":"c651b7a89d7399ce7c52624e3cec9a0e0887c6e720f0d716da44c841bfcf9aeb","details":{"parent_model":"","format":"gguf","family":"phi2","families":["phi2"],"parameter_size":"3B","quantization_level":"Q4_0"}},{"name":"tinyllama:latest","model":"tinyllama:latest","modified_at":"2024-01-05T21:45:36.99553769-06:00","size":637700138,"digest":"2644915ede352ea7bdfaff0bfac0be74c719d5d5202acb63a6fb095b52f394a4","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"1B","quantization_level":"Q4_0"}}]}

lestan@Lestans-MacBook-Pro ~ % ollama -v
Warning: could not connect to a running Ollama instance
Warning: client version is 0.1.23

lestan@Lestans-MacBook-Pro ~ % ps -ef | grep ollama
  501 32212 32208   0 10:23PM ??         0:00.04 /Applications/Ollama.app/Contents/Resources/ollama serve
  501 32270 10253   0 10:33PM ttys014    0:00.00 grep ollama

I'm running on Apple M3 Max with 64GB RAM

Appreciate any help.

Thanks!

Originally created by @lestan on GitHub (Feb 7, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2380 As of at least the last two recent versions, I have been experiencing a lot of issues with Ollama. Primarily, it seems to report that it can't connect to the server when using the Ollama CLI commands, even though the server is running and I can curl it. Also when using the Ollama Python SDK, I often get a Connection Refused error, but retrying will eventually connect. I can't explain it. I ran the following commands in succession. Ollama is launched via the Mac app (not command line) after killing it and no models have been loaded yet. ``` lestan@Lestans-MacBook-Pro ~ % ollama list Error: could not connect to ollama app, is it running? lestan@Lestans-MacBook-Pro ~ % curl http://localhost:11434/api/tags {"models":[{"name":"mixtral:latest","model":"mixtral:latest","modified_at":"2024-01-15T16:11:18.289940736-06:00","size":26442481545,"digest":"7708c059a8bb4d950e5e679aef904fd4da96aa4d551a5cd14a7f7e2308a82f6d","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"47B","quantization_level":"Q4_0"}},{"name":"nous-hermes2-mixtral:latest","model":"nous-hermes2-mixtral:latest","modified_at":"2024-01-15T22:13:37.546667086-06:00","size":26442493141,"digest":"599da8dce2c14e54737c51f9668961bbc3526674249d3850b0875638a3e5e268","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"47B","quantization_level":"Q4_0"}},{"name":"orca2:latest","model":"orca2:latest","modified_at":"2023-12-22T19:44:49.948456023-06:00","size":3825836233,"digest":"ea98cc422de301a0714ee18d077d5c4ba4fd02f889234944bb2f45618fd5d5f7","details":{"parent_model":"","format":"gguf","family":"llama","families":null,"parameter_size":"7B","quantization_level":"Q4_0"}},{"name":"phi:latest","model":"phi:latest","modified_at":"2023-12-28T21:03:25.568996781-06:00","size":1602472424,"digest":"c651b7a89d7399ce7c52624e3cec9a0e0887c6e720f0d716da44c841bfcf9aeb","details":{"parent_model":"","format":"gguf","family":"phi2","families":["phi2"],"parameter_size":"3B","quantization_level":"Q4_0"}},{"name":"tinyllama:latest","model":"tinyllama:latest","modified_at":"2024-01-05T21:45:36.99553769-06:00","size":637700138,"digest":"2644915ede352ea7bdfaff0bfac0be74c719d5d5202acb63a6fb095b52f394a4","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"1B","quantization_level":"Q4_0"}}]} lestan@Lestans-MacBook-Pro ~ % ollama -v Warning: could not connect to a running Ollama instance Warning: client version is 0.1.23 lestan@Lestans-MacBook-Pro ~ % ps -ef | grep ollama 501 32212 32208 0 10:23PM ?? 0:00.04 /Applications/Ollama.app/Contents/Resources/ollama serve 501 32270 10253 0 10:33PM ttys014 0:00.00 grep ollama ``` I'm running on Apple M3 Max with 64GB RAM Appreciate any help. Thanks!
GiteaMirror added the bug label 2026-05-03 13:26:02 -05:00
Author
Owner

@jmorganca commented on GitHub (Feb 7, 2024):

Hi there, sorry this happened. Do you happen to have the OLLAMA_HOST environment variable set by chance? (you can check with the env command. This might explain why ollama commands fail but using curl works.

<!-- gh-comment-id:1931283494 --> @jmorganca commented on GitHub (Feb 7, 2024): Hi there, sorry this happened. Do you happen to have the `OLLAMA_HOST` environment variable set by chance? (you can check with the `env` command. This might explain why `ollama` commands fail but using `curl` works.
Author
Owner

@lestan commented on GitHub (Feb 7, 2024):

Hi - yes.

I set it in my ~/.zprofile

export OLLAMA_HOST=Lestans-MacBook-Pro.local

Here's the output of env

lestan@Lestans-MacBook-Pro ~ % env | grep OLLAMA
OLLAMA_HOST=Lestans-MacBook-Pro.local
<!-- gh-comment-id:1931290549 --> @lestan commented on GitHub (Feb 7, 2024): Hi - yes. I set it in my ~/.zprofile ` export OLLAMA_HOST=Lestans-MacBook-Pro.local` Here's the output of env ``` lestan@Lestans-MacBook-Pro ~ % env | grep OLLAMA OLLAMA_HOST=Lestans-MacBook-Pro.local ```
Author
Owner

@lestan commented on GitHub (Feb 7, 2024):

Once I removed the environment variable setting for OLLAMA_HOST, it was more reliable.

I'm wondering though, is this a bug? Shouldn't it still resolve if the host is valid? In my case, the host was still a local host

<!-- gh-comment-id:1932969187 --> @lestan commented on GitHub (Feb 7, 2024): Once I removed the environment variable setting for OLLAMA_HOST, it was more reliable. I'm wondering though, is this a bug? Shouldn't it still resolve if the host is valid? In my case, the host was still a local host
Author
Owner

@jmorganca commented on GitHub (Feb 8, 2024):

Thanks! It isn't recommended to set OLLAMA_HOST unless you mean to connect to a remote instance of Ollama. The reason for this is, if I recall, macOS hostnames can sometimes change based on your network connection. If you do want to hardcode it to the local computer, you can use 127.0.0.1 or similar. Hope this helps!

<!-- gh-comment-id:1933151590 --> @jmorganca commented on GitHub (Feb 8, 2024): Thanks! It isn't recommended to set `OLLAMA_HOST` unless you mean to connect to a remote instance of Ollama. The reason for this is, if I recall, macOS hostnames can sometimes change based on your network connection. If you do want to hardcode it to the local computer, you can use 127.0.0.1 or similar. Hope this helps!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#63420