fix: clarify Ollama inventory and download destination

This commit is contained in:
Hermes Agent
2026-08-24 21:32:16 +10:00
parent 8ca332854f
commit da3293fff4
5 changed files with 16 additions and 9 deletions
+9 -6
View File
@@ -1632,24 +1632,27 @@ def catalog_refresh() -> dict[str, Any]:
def pull_model(body: ModelRequest) -> dict[str, Any]:
name = _valid_name(body.name)
target = str(body.target or "local").strip().lower()
_target_endpoint(target)
return {"ok": True, "job_id": _new_job(name, "download", target), "message": f"Downloading or updating {name} on {target}"}
endpoint = _target_endpoint(target)
job_id = _new_job(name, "download", target)
return {"ok": True, "job_id": job_id, "endpoint": endpoint, "target": target, "message": f"Downloading or updating {name} on {target} ({endpoint})"}
@router.post("/redownload")
def redownload_model(body: ModelRequest) -> dict[str, Any]:
name = _valid_name(body.name)
target = str(body.target or "local").strip().lower()
_target_endpoint(target)
return {"ok": True, "job_id": _new_job(name, "redownload", target), "message": f"Re-downloading or updating {name} on {target}"}
endpoint = _target_endpoint(target)
job_id = _new_job(name, "redownload", target)
return {"ok": True, "job_id": job_id, "endpoint": endpoint, "target": target, "message": f"Re-downloading or updating {name} on {target} ({endpoint})"}
@router.delete("/model")
def delete_model(body: ModelRequest) -> dict[str, Any]:
name = _valid_name(body.name)
target = str(body.target or "local").strip().lower()
_target_endpoint(target)
return {"ok": True, "job_id": _new_job(name, "delete", target), "message": f"Removing {name} from {target}"}
endpoint = _target_endpoint(target)
job_id = _new_job(name, "delete", target)
return {"ok": True, "job_id": job_id, "endpoint": endpoint, "target": target, "message": f"Removing {name} from {target} ({endpoint})"}
def create_ollama_routes(app) -> None: