ollama_host
ollama_host
¶
Normalize the Ollama server address read from OLLAMA_HOST or config.
Ollama's own CLI accepts OLLAMA_HOST=127.0.0.1:11434 with no scheme.
OpenJarvis passes the value to httpx as a base URL, and httpx rejects a URL
without http:// or https://. Every consumer therefore normalizes the
host through this one function.
Functions¶
normalize_ollama_host
¶
Return host as an HTTP base URL with no trailing slash.
A scheme is added when missing, so 127.0.0.1:11434 becomes
http://127.0.0.1:11434. An empty string is returned unchanged so the
caller can apply its own default.
Source code in src/openjarvis/core/ollama_host.py
ollama_host_from_env
¶
Resolve the environment setting, using the default when it is blank.