Files
gpu-rent/tests/test_llm_only.py
T
Leonid Pershin 2ab32a8ab5 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.
2026-08-21 08:51:36 +03:00

43 lines
1.4 KiB
Python

from gpu_rent.config import parse_enable_swarmui
from gpu_rent.tunnel import tunnel_forwards
def test_parse_enable_swarmui_workload(monkeypatch):
monkeypatch.delenv("WORKLOAD", raising=False)
assert parse_enable_swarmui(None) is True
assert parse_enable_swarmui("false") is False
monkeypatch.setenv("WORKLOAD", "llm")
assert parse_enable_swarmui("true") is False
monkeypatch.setenv("WORKLOAD", "both")
assert parse_enable_swarmui("false") is True
def test_tunnel_forwards_llm_only(monkeypatch):
class Cfg:
swarmui_local_port = 17801
llm_runtime = "ollama"
enable_swarmui = False
ollama_local_port = 17811
monkeypatch.setattr("gpu_rent.tunnel.load_state", lambda: type("S", (), {"notes": {}})())
assert tunnel_forwards(Cfg()) == [(17811, 11434)]
def test_access_links_llm_only(monkeypatch):
from gpu_rent.access_card import collect_access_links, mcp_snippet_lines
class Cfg:
swarmui_local_port = 17801
llm_runtime = "ollama"
enable_swarmui = False
ollama_local_port = 17811
monkeypatch.setattr(
"gpu_rent.access_card.load_state",
lambda: type("S", (), {"notes": {}})(),
)
labels = [x.label for x in collect_access_links(Cfg(), tunneled=True)]
assert "SwarmUI UI" not in labels
assert "Ollama API" in labels
assert mcp_snippet_lines(Cfg())[0].startswith("#")