fix: clarify Ollama inventory and download destination
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user