aboutsummaryrefslogtreecommitdiffstats
path: root/test_llamachat.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-10 18:41:03 +0200
committerDanilo M. <danix@danix.xyz>2026-08-10 18:41:03 +0200
commit9d03d35eadbc1c5bdd8a1cde8397e7ed61791a33 (patch)
tree0b7c0ff3b25a18a069d50bb548bd1b0120bf0f4b /test_llamachat.py
parenta7dd41385baa8f3ac34deda827f0344f82fb713e (diff)
downloadllamachat-9d03d35eadbc1c5bdd8a1cde8397e7ed61791a33.tar.gz
llamachat-9d03d35eadbc1c5bdd8a1cde8397e7ed61791a33.zip
feat: list and route models through every configured provider
Metadata now resolves models.ini over provider defaults over presets.ini, so a local model keeps getting its context and vision from the preset while remaining overridable. A model whose vision support is unknown no longer blocks an attachment: unknown is not the same as no, and the API will reject an image if it really cannot take one. Key resolution moves to the worker thread so a pass: key's pinentry never freezes the GUI. KeyResolver gains a lock since StreamWorker and TitleWorker can now overlap. Skipped providers surface in the status bar rather than only on stderr. model_info uses dataclasses.replace to avoid mutating the ModelInfo that resolve() may return from the store. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'test_llamachat.py')
-rwxr-xr-xtest_llamachat.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/test_llamachat.py b/test_llamachat.py
index 18b6f0a..98776b8 100755
--- a/test_llamachat.py
+++ b/test_llamachat.py
@@ -646,6 +646,7 @@ def test_sidebar_toggle():
from llamachat import backend as _backend
from llamachat import config as _config
+ from llamachat import models as _models
from llamachat.ui import ChatWindow
app = QApplication.instance() or QApplication([])
@@ -660,10 +661,11 @@ def test_sidebar_toggle():
assert cfg.state_path.parent == Path(tmp), cfg.state_path
history = db.History(cfg.db_path)
- client = _backend.Client(cfg.base_url)
+ client = _backend.MultiClient(cfg.providers, cfg.request_timeout)
presets = _config.parse_presets(cfg.presets_path)
+ store = _models.ModelStore(cfg.models_path)
- window = ChatWindow(cfg, history, client, presets)
+ window = ChatWindow(cfg, history, client, presets, store)
window.resize(1000, 700)
# The shortcut must be registered on the window itself.
@@ -704,7 +706,7 @@ def test_sidebar_toggle():
# Hidden state and width must come back on the next start.
window.sidebar_button.setChecked(False)
window._save_layout()
- restored = ChatWindow(cfg, history, client, presets)
+ restored = ChatWindow(cfg, history, client, presets, store)
assert not restored.sidebar_button.isChecked()
assert restored.sidebar_width == 333, restored.sidebar_width
@@ -723,6 +725,7 @@ def test_shortcuts():
from llamachat import backend as _backend
from llamachat import config as _config
+ from llamachat import models as _models
from llamachat.ui import ChatWindow
app = QApplication.instance() or QApplication([])
@@ -735,8 +738,9 @@ def test_shortcuts():
window = ChatWindow(
cfg,
history,
- _backend.Client(cfg.base_url),
+ _backend.MultiClient(cfg.providers, cfg.request_timeout),
_config.parse_presets(cfg.presets_path),
+ _models.ModelStore(cfg.models_path),
)
window.resize(1000, 700)
window.show()