From d9d2c213f69724a7ca5da7e1b4ff7aabd79f065b Mon Sep 17 00:00:00 2001 From: Abiba Date: Tue, 19 May 2026 17:24:41 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20routing=20=E2=80=94=20remove=20turn=20li?= =?UTF-8?q?mit=20from=20default=20tier,=20no=20gaps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router/router.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/router/router.py b/router/router.py index 238d7ff..87c62ba 100644 --- a/router/router.py +++ b/router/router.py @@ -172,23 +172,23 @@ def route(rd, tier): result = select_best_gpu(fallback, "lightweight_fallback") if result: return result - # TIER 2: Simple conversations — low token, short context → VLM preferred - if not sys and t <= 1000 and turns <= 4 and "qwen3.5-9b-vlm" in avail: + # TIER 2: Simple conversations — short context, any prompt → VLM preferred + if t <= 1000 and turns <= 4 and "qwen3.5-9b-vlm" in avail: if not is_gpu_busy("qwen3.5-9b-vlm"): return {"model":"qwen3.5-9b-vlm","reason":"simple_conv"} # VLM busy — try Dense if "qwen3.6-27B-code" in avail and not is_gpu_busy("qwen3.6-27B-code"): return {"model":"qwen3.6-27B-code","reason":"simple_conv_fallback"} - # TIER 3: Heavy reasoning — large context, system prompts, long conversations - if t > 4000 or sys or turns > 8: + # TIER 3: Heavy reasoning — large context or very long conversations + if t > 4000 or turns > 8: candidates = [m for m in ["qwen3.6-27B-code","qwen3.6-35B-A3B","qwen3.5-9b-vlm"] if m in avail] result = select_best_gpu(candidates, "heavy_reasoning") if result: return result - # TIER 4: Default — Dense preferred for medium tasks, MoE as workhorse, VLM as overflow - if turns <= 6 and t <= 4000: - # Medium complexity — try Dense first, then MoE, then VLM + # TIER 4: Default — Dense preferred for medium tasks, MoE as workhorse, VLM overflow + if t <= 4000: + # Catch everything that isn't heavy (≤4000 tokens, any turn count) candidates = [m for m in ["qwen3.6-27B-code","qwen3.6-35B-A3B","qwen3.5-9b-vlm"] if m in avail] result = select_best_gpu(candidates, "medium_task") if result: return result