MCPcopy
hub / github.com/PromtEngineer/localGPT / is_ollama_running

Method is_ollama_running

backend/ollama_client.py:13–19  ·  view source on GitHub ↗

Check if Ollama server is running

(self)

Source from the content-addressed store, hash-verified

11 self.api_url = f"{base_url}/api"
12
13 def is_ollama_running(self) -> bool:
14 """Check if Ollama server is running"""
15 try:
16 response = requests.get(f"{self.base_url}/api/tags", timeout=5)
17 return response.status_code == 200
18 except requests.exceptions.RequestException:
19 return False
20
21 def list_models(self) -> List[str]:
22 """Get list of available models"""

Callers 6

mainFunction · 0.95
mainFunction · 0.95
test_ollama_connectivityFunction · 0.95
do_GETMethod · 0.80
handle_chatMethod · 0.80
handle_get_modelsMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_ollama_connectivityFunction · 0.76