Update configuration and documentation for LLM support and local watchdog

- Added `ollama-models.yaml` to .gitignore and implemented logic to copy it in gpu-rent.ps1 and gpu-rent.sh.
- Enhanced env.example to include new variables for LLM runtime options and local watchdog configuration.
- Updated CLI commands to support LLM options during setup and execution, including new flags for Ollama and llama.cpp.
- Improved documentation in cli.md and README.md to reflect changes in LLM integration and local watchdog functionality.
- Adjusted architecture and decisions documentation to clarify the role of LLMs and local watchdog in the system.
This commit is contained in:
Leonid Pershin
2026-08-21 05:29:23 +03:00
parent a9cf2e0f90
commit 2005b00175
43 changed files with 2258 additions and 197 deletions
+59
View File
@@ -0,0 +1,59 @@
from pathlib import Path
import pytest
from gpu_rent.llm_runtime import (
decide_runtime,
normalize_runtime,
parse_ollama_models,
write_ollama_models_preset,
)
def test_normalize_runtime():
assert normalize_runtime(None) == "none"
assert normalize_runtime("OLLAMA") == "ollama"
assert normalize_runtime("llama-cpp") == "llamacpp"
with pytest.raises(ValueError):
normalize_runtime("foo")
def test_decide_runtime_flags_win():
assert (
decide_runtime(flag=None, ollama_flag=True, llamacpp_flag=False, from_config="none")
== "ollama"
)
assert (
decide_runtime(flag="llamacpp", ollama_flag=False, llamacpp_flag=False, from_config="ollama")
== "llamacpp"
)
with pytest.raises(ValueError):
decide_runtime(flag=None, ollama_flag=True, llamacpp_flag=True, from_config="none")
def test_parse_ollama_models(tmp_path: Path):
path = tmp_path / "m.yaml"
path.write_text(
"models:\n - name: huihui_ai/qwen2.5-abliterate:7b\n default: true\n - qwen2.5:3b\n",
encoding="utf-8",
)
entries = parse_ollama_models(path)
assert [e.name for e in entries] == [
"huihui_ai/qwen2.5-abliterate:7b",
"qwen2.5:3b",
]
assert entries[0].default is True
def test_parse_empty_manifest(tmp_path: Path):
path = tmp_path / "empty.yaml"
path.write_text("models: []\n", encoding="utf-8")
assert parse_ollama_models(path) == []
assert parse_ollama_models(tmp_path / "missing.yaml") == []
def test_write_preset(tmp_path: Path):
path = tmp_path / "out.yaml"
write_ollama_models_preset(path, "recommended")
entries = parse_ollama_models(path)
assert entries[0].name == "huihui_ai/qwen2.5-abliterate:7b"