ensure_ollama_available
ensure_ollama_available(
timeout=2.0,
start_if_needed=False,
startup_timeout=10.0,
)
Check that the Ollama server is reachable, optionally starting it locally.
Parameters
| timeout |
float |
Timeout in seconds for each connectivity probe. |
2.0 |
| start_if_needed |
bool |
If True, try to start ollama serve when the default local server is not reachable. |
False |
| startup_timeout |
float |
Maximum seconds to wait after auto-starting the server. |
10.0 |
Returns
|
str |
Base URL string for the reachable Ollama server. |
Raises
|
RuntimeError |
If Ollama is not reachable and cannot be started. |