mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
Check if ollama server is running or not #197
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @emilioMaddalena on GitHub (Jan 3, 2025).
Wouldn't it be useful to have a method to check if ollama is running (if the server is active) or not?
IMO it would make more sense to call it before say ollama.chat, instead of directly calling ollama.chat and having it throw a "httpx.ConnectError: [Errno 61] Connection refused".
@ParthSareen commented on GitHub (Jan 3, 2025):
I have a PR WIP for a better error message (https://github.com/ollama/ollama-python/pull/398) but I don't think we need to have a full method around it. You can also request curl/request
http://localhost:11434to see if Ollama is running