fix: let saved Ollama URL override environment fallback
This commit is contained in:
@@ -59,7 +59,7 @@ In Hermes Dashboard, open **Plugins**, choose **Install from repository**, enter
|
||||
|
||||
The dashboard now includes a connection panel in the header. Enter an Ollama base URL, choose **Local** or **Remote**, and use **Test** before **Save**. Saved URLs are stored in Hermes plugin data with file permissions restricted to the Hermes account. Credential-bearing URLs are rejected.
|
||||
|
||||
The plugin probes the configured local endpoint and known Docker endpoints, and tests a configured remote endpoint. A successful connection reports the Ollama version and installed model count. The active local endpoint continues to drive chat, status, load, and runtime telemetry.
|
||||
The plugin probes the configured local endpoint and known Docker endpoints, and tests a configured remote endpoint. A successful connection reports the Ollama version and installed model count. The active local endpoint continues to drive chat, status, load, and runtime telemetry. A URL saved from the dashboard takes precedence over the initial `OLLAMA_HOST` environment fallback, so the field can correct or replace an inherited container setting.
|
||||
|
||||
When both local and remote endpoints are online, downloading or re-downloading a model opens a destination chooser. The selected target is recorded on the job and the pull is sent to that endpoint. Remote downloads do not alter the local installed-model inventory.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"label": "Ollama Models",
|
||||
"description": "Inspect, manage, and chat with local Ollama models, including shared persistent conversations, performance metrics, images, PDFs, URLs, and live memory telemetry.",
|
||||
"icon": "Cpu",
|
||||
"version": "1.5.5",
|
||||
"version": "1.5.6",
|
||||
"tab": {"path": "/ollama-manager", "position": "after:models"},
|
||||
"entry": "dist/index.js",
|
||||
"css": "dist/style.css",
|
||||
|
||||
@@ -305,11 +305,13 @@ def _write_connections(value: dict[str, str]) -> None:
|
||||
|
||||
def _apply_saved_connection() -> None:
|
||||
global LOCAL_OLLAMA
|
||||
if os.environ.get("OLLAMA_HOST", "").strip():
|
||||
return
|
||||
saved = _read_connections().get("active_url")
|
||||
if saved:
|
||||
LOCAL_OLLAMA = saved
|
||||
return
|
||||
configured = os.environ.get("OLLAMA_HOST", "").strip()
|
||||
if configured:
|
||||
LOCAL_OLLAMA = configured.rstrip("/")
|
||||
|
||||
|
||||
def _target_endpoint(target: str = "local") -> str:
|
||||
@@ -336,7 +338,7 @@ def _probe_endpoint(url: str, timeout: int = 5) -> dict[str, Any]:
|
||||
|
||||
def _connection_snapshot() -> list[dict[str, Any]]:
|
||||
saved = _read_connections()
|
||||
configured_local = os.environ.get("OLLAMA_HOST", "").strip() or saved.get("local_url")
|
||||
configured_local = saved.get("local_url") or os.environ.get("OLLAMA_HOST", "").strip()
|
||||
candidates: list[tuple[str, str, str]] = []
|
||||
if configured_local:
|
||||
candidates.append(("local", "Configured local endpoint", configured_local))
|
||||
@@ -1475,7 +1477,7 @@ def chat(body: ChatRequest) -> dict[str, Any]:
|
||||
@router.get("/connections")
|
||||
def connections() -> dict[str, Any]:
|
||||
saved = _read_connections()
|
||||
active = os.environ.get("OLLAMA_HOST", "").strip() or saved.get("active_url") or LOCAL_OLLAMA
|
||||
active = saved.get("active_url") or os.environ.get("OLLAMA_HOST", "").strip() or LOCAL_OLLAMA
|
||||
return {"active_url": active, "connections": _connection_snapshot(), "containerized": _running_in_container()}
|
||||
|
||||
|
||||
@@ -1494,10 +1496,10 @@ def connections_configure(body: ConnectionRequest) -> dict[str, Any]:
|
||||
raise HTTPException(400, "Connection role must be local or remote")
|
||||
saved = _read_connections()
|
||||
saved[f"{role}_url"] = url
|
||||
if role == "local" and not os.environ.get("OLLAMA_HOST", "").strip():
|
||||
if role == "local":
|
||||
saved["active_url"] = url
|
||||
_write_connections(saved)
|
||||
if role == "local" and not os.environ.get("OLLAMA_HOST", "").strip():
|
||||
if role == "local":
|
||||
global LOCAL_OLLAMA
|
||||
LOCAL_OLLAMA = url
|
||||
result = _probe_endpoint(url, timeout=8)
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
name: ollama-manager
|
||||
version: 1.5.5
|
||||
version: 1.5.6
|
||||
description: Native dashboard manager and chat interface for local Ollama models, attachments, URLs, shared persistent conversations, performance metrics, and live runtime telemetry.
|
||||
auto_install_dependencies: true
|
||||
python_dependencies:
|
||||
|
||||
Reference in New Issue
Block a user