from hearo.models.tiers import ( DEFAULT_TIER, TIERS, MTBackend, PromptStyle, get_tier, ordered_tiers, ) def test_exactly_five_tiers_ordered_by_quality(): tiers = ordered_tiers() assert len(tiers) == 5 assert [t.order for t in tiers] == [1, 2, 3, 4, 5] def test_latency_and_vram_increase_monotonically(): tiers = ordered_tiers() latencies = [t.approx_latency_s for t in tiers] vram = [t.min_vram_gb for t in tiers] assert latencies == sorted(latencies) assert vram == sorted(vram) def test_exactly_one_recommended_and_one_finetune_pick(): assert sum(t.recommended for t in TIERS.values()) == 1 assert sum(t.best_after_finetune for t in TIERS.values()) == 1 def test_only_instruct_models_support_prompt_glossary(): """LLM이라고 다 되는 게 아니다 — 지시문을 이해하는 instruct 모델만 가능하다. Seed-X 는 번역 전용 completion 모델이라 지시문을 넣으면 오히려 망가진다. """ for tier in TIERS.values(): expected = tier.mt.prompt_style is PromptStyle.INSTRUCT assert tier.mt.supports_prompt_glossary is expected, tier.key def test_seq2seq_backends_have_no_prompt_style(): for tier in TIERS.values(): if tier.mt.backend is MTBackend.CTRANSLATE2: assert tier.mt.prompt_style is PromptStyle.NONE, tier.key def test_unknown_key_falls_back_to_default(): assert get_tier("does-not-exist").key == DEFAULT_TIER def test_default_tier_exists(): assert DEFAULT_TIER in TIERS