Update extensions and documentation for LLM integration and CLI enhancements
- Added support for a new extension, `swarm-assistent`, in `extensions.example.yaml` with a requirement for `ollama`. - Enhanced the README.md to clarify the setup process and provide a quick start guide for using extensions. - Updated documentation in `llm.md` to reflect the opt-in nature of LLM support and provide clearer instructions for enabling it. - Improved the `autocomplete.md` to detail the automatic setup of word lists during the initial launch. - Revised `cli.md` to include new commands and options related to LLM runtime handling and extension management. - Enhanced the `spike-notes.md` to guide users through the first live run with a focus on LLM integration.
This commit is contained in:
+50
-1
@@ -1,6 +1,9 @@
|
||||
from pathlib import Path
|
||||
|
||||
from gpu_rent.manifests import parse_extensions, parse_models
|
||||
import pytest
|
||||
|
||||
from gpu_rent.errors import ConfigError
|
||||
from gpu_rent.manifests import parse_extensions, parse_models, repo_matches_runtime
|
||||
|
||||
|
||||
def test_models_skips_version_zero(tmp_path: Path):
|
||||
@@ -30,3 +33,49 @@ def test_extensions_repo(tmp_path: Path):
|
||||
repos = parse_extensions(path)
|
||||
assert repos[0].kind == "swarmui"
|
||||
assert repos[0].directory == "Ext"
|
||||
assert repos[0].requires == "none"
|
||||
|
||||
|
||||
def test_extensions_requires_ollama(tmp_path: Path):
|
||||
path = tmp_path / "extensions.yaml"
|
||||
path.write_text(
|
||||
"swarmui:\n"
|
||||
" - url: https://gitea.example/swarm-assistent.git\n"
|
||||
" ref: main\n"
|
||||
" dir: swarm-assistent\n"
|
||||
" requires: ollama\n"
|
||||
" - url: https://github.com/org/Always.git\n"
|
||||
" ref: main\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
repos = parse_extensions(path)
|
||||
assert repos[0].requires == "ollama"
|
||||
assert repos[1].requires == "none"
|
||||
assert repo_matches_runtime(repos[0], "ollama")
|
||||
assert not repo_matches_runtime(repos[0], "none")
|
||||
assert not repo_matches_runtime(repos[0], "llamacpp")
|
||||
assert repo_matches_runtime(repos[1], "none")
|
||||
assert repo_matches_runtime(repos[1], "ollama")
|
||||
|
||||
|
||||
def test_extensions_requires_any_llm(tmp_path: Path):
|
||||
path = tmp_path / "extensions.yaml"
|
||||
path.write_text(
|
||||
"swarmui:\n - url: https://example/x.git\n requires: any-llm\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
repo = parse_extensions(path)[0]
|
||||
assert repo.requires == "any-llm"
|
||||
assert repo_matches_runtime(repo, "ollama")
|
||||
assert repo_matches_runtime(repo, "llamacpp")
|
||||
assert not repo_matches_runtime(repo, "none")
|
||||
|
||||
|
||||
def test_extensions_requires_invalid(tmp_path: Path):
|
||||
path = tmp_path / "extensions.yaml"
|
||||
path.write_text(
|
||||
"swarmui:\n - url: https://example/x.git\n requires: docker\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
with pytest.raises(ConfigError, match="requires"):
|
||||
parse_extensions(path)
|
||||
|
||||
Reference in New Issue
Block a user