Refactor LLM configuration to remove llamacpp support
- Removed references to llamacpp from configuration files, scripts, and documentation, streamlining the LLM setup process to focus solely on Ollama. - Updated environment variables and paths to eliminate llamacpp-related entries, ensuring clarity in the configuration. - Adjusted CLI commands and help messages to reflect the removal of llamacpp, enhancing user experience and reducing confusion. - Revised documentation to provide clear guidance on using Ollama exclusively, including updates to setup instructions and runtime options.
This commit is contained in:
+6
-27
@@ -95,7 +95,6 @@ def unit_active(name):
|
||||
checks = []
|
||||
want_swarm = WANT_SWARM
|
||||
want_ollama = WANT_OLLAMA
|
||||
want_llama = WANT_LLAMA
|
||||
|
||||
if want_swarm:
|
||||
ok, detail = http_ok("http://127.0.0.1:7801/")
|
||||
@@ -131,18 +130,6 @@ if want_ollama:
|
||||
"unit": unit_active("gpu-rent-ollama"),
|
||||
})
|
||||
|
||||
if want_llama:
|
||||
ok, detail = http_ok("http://127.0.0.1:8080/health")
|
||||
if not ok:
|
||||
ok2, d2 = http_ok("http://127.0.0.1:8080/v1/models")
|
||||
ok, detail = ok2, d2
|
||||
checks.append({
|
||||
"name": "llamacpp",
|
||||
"ok": ok,
|
||||
"detail": detail,
|
||||
"unit": unit_active("gpu-rent-llamacpp"),
|
||||
})
|
||||
|
||||
print(json.dumps({"checks": checks}, ensure_ascii=False))
|
||||
'''
|
||||
|
||||
@@ -192,18 +179,17 @@ def wait_backend_idle(
|
||||
)
|
||||
|
||||
|
||||
def _expected_services(cfg: Config) -> tuple[bool, bool, bool]:
|
||||
def _expected_services(cfg: Config) -> tuple[bool, bool]:
|
||||
swarm = bool(getattr(cfg, "enable_swarmui", True))
|
||||
rt = normalize_runtime(getattr(cfg, "llm_runtime", "none"))
|
||||
return swarm, rt == "ollama", rt == "llamacpp"
|
||||
return swarm, rt == "ollama"
|
||||
|
||||
|
||||
def _probe_vm_once(cfg: Config, host: str) -> list[ServiceCheck]:
|
||||
want_swarm, want_ollama, want_llama = _expected_services(cfg)
|
||||
want_swarm, want_ollama = _expected_services(cfg)
|
||||
script = (
|
||||
_REMOTE_STACK_PROBE.replace("WANT_SWARM", "True" if want_swarm else "False")
|
||||
.replace("WANT_OLLAMA", "True" if want_ollama else "False")
|
||||
.replace("WANT_LLAMA", "True" if want_llama else "False")
|
||||
)
|
||||
out = run_ssh(
|
||||
cfg,
|
||||
@@ -251,8 +237,8 @@ def verify_stack_on_vm(
|
||||
raise_on_fail: bool = True,
|
||||
) -> list[ServiceCheck]:
|
||||
"""Poll until every enabled service answers on the VM loopback."""
|
||||
want_swarm, want_ollama, want_llama = _expected_services(cfg)
|
||||
if not (want_swarm or want_ollama or want_llama):
|
||||
want_swarm, want_ollama = _expected_services(cfg)
|
||||
if not (want_swarm or want_ollama):
|
||||
log("проверка стека: нечего ждать (swarm off, LLM none)")
|
||||
return []
|
||||
|
||||
@@ -261,8 +247,6 @@ def verify_stack_on_vm(
|
||||
names.append("SwarmUI :7801")
|
||||
if want_ollama:
|
||||
names.append("Ollama :11434")
|
||||
if want_llama:
|
||||
names.append("llama.cpp :8080")
|
||||
log(f"проверка на VM: {', '.join(names)}")
|
||||
|
||||
deadline = time.time() + timeout
|
||||
@@ -447,7 +431,7 @@ def verify_stack_local(
|
||||
raise_on_fail: bool = True,
|
||||
) -> list[ServiceCheck]:
|
||||
"""After tunnel: local ports + light HTTP for enabled services."""
|
||||
want_swarm, want_ollama, want_llama = _expected_services(cfg)
|
||||
want_swarm, want_ollama = _expected_services(cfg)
|
||||
targets: list[tuple[str, int, str | None]] = []
|
||||
if want_swarm:
|
||||
targets.append(("swarmui", int(cfg.swarmui_local_port), None))
|
||||
@@ -459,9 +443,6 @@ def verify_stack_local(
|
||||
f"http://127.0.0.1:{cfg.ollama_local_port}/api/tags",
|
||||
)
|
||||
)
|
||||
if want_llama:
|
||||
p = int(cfg.llamacpp_local_port)
|
||||
targets.append(("llamacpp", p, f"http://127.0.0.1:{p}/health"))
|
||||
|
||||
if not targets:
|
||||
return []
|
||||
@@ -481,8 +462,6 @@ def verify_stack_local(
|
||||
continue
|
||||
if url:
|
||||
ok, detail = _http_local(url)
|
||||
if not ok and name == "llamacpp":
|
||||
ok, detail = _http_local(f"http://127.0.0.1:{port}/v1/models")
|
||||
last.append(ServiceCheck(name, ok, detail, "local"))
|
||||
else:
|
||||
ok, detail = _http_local(f"http://127.0.0.1:{port}/")
|
||||
|
||||
Reference in New Issue
Block a user