Files
jundot--omlx/tests/test_admin_model_settings_template.py
wehub-resource-sync e9a2f726c9
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.13) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:29:51 +08:00

44 lines
1.2 KiB
Python

"""Regression tests for admin model-settings UI gates."""
from pathlib import Path
def _model_settings_template() -> str:
root = Path(__file__).resolve().parents[1]
return (
root / "omlx/admin/templates/dashboard/_modal_model_settings.html"
).read_text()
def _section(html: str, start_marker: str, end_marker: str) -> str:
return html.split(start_marker, 1)[1].split(end_marker, 1)[0]
def test_lightning_mtp_and_turboquant_are_not_ui_mutexed():
html = _model_settings_template()
turboquant = _section(
html,
"<!-- TurboQuant KV Cache -->",
"<!-- IndexCache (DSA models only) -->",
)
lightning_mtp = _section(
html,
"<!-- Lightning MTP (built-in MTP head speculative decoding) -->",
"<!-- Experimental Features -->",
)
assert "modelSettings.mtp_enabled" not in turboquant
assert "modelSettings.turboquant_kv_enabled" not in lightning_mtp
def test_vlm_mtp_still_conflicts_with_turboquant():
html = _model_settings_template()
vlm_mtp = _section(
html,
"<!-- VLM MTP",
"<!-- Performance",
)
assert "modelSettings.turboquant_kv_enabled" in vlm_mtp