UI update changed

This commit is contained in:
Dobromir Popov
2026-07-08 22:58:11 +03:00
parent 1e44e8e578
commit 4a10eb6013
7 changed files with 541 additions and 158 deletions

View File

@@ -186,3 +186,24 @@ def test_qwen_preset_prices_apply_to_all_aliases(tmp_path):
assert billing.price_for("some/other-model") == pytest.approx(0.02)
finally:
pass
def test_qwen25_preset_price_is_ten_x_commercial_reference(tmp_path):
"""Qwen2.5-0.5B bills at 10× ~$0.20/1M reference ($0.002/1k), not the 0.02 default."""
import pytest
from meshnet_tracker.server import TrackerServer, _resolve_model_preset, DEFAULT_MODEL_PRESETS
name, preset = _resolve_model_preset(DEFAULT_MODEL_PRESETS, "Qwen/Qwen2.5-0.5B-Instruct")
assert name == "qwen2.5-0.5b-instruct"
assert preset["price_per_1k_tokens"] == pytest.approx(0.002)
tracker = TrackerServer(billing_db=str(tmp_path / "billing.sqlite"))
billing = tracker._billing
assert billing is not None
for key in (
"qwen2.5-0.5b",
"Qwen2.5-0.5B-Instruct",
"Qwen/Qwen2.5-0.5B-Instruct",
):
assert billing.price_for(key) == pytest.approx(0.002), key
assert billing.price_for("unrelated-model") == pytest.approx(0.02)